{"_id":"@craftalley/lightspeed-sdk","_rev":"10-6c89243b03839a03f5c7926f381bedf0","time":{"created":"2023-06-19T20:36:57.851Z","0.1.0-beta.11":"2023-06-19T16:46:48.727Z","modified":"2023-08-28T19:56:46.743Z","0.1.0-beta.12":"2023-06-19T16:59:02.416Z","0.1.0-beta.13":"2023-06-19T20:36:58.025Z","0.1.0-beta.14":"2023-08-17T18:03:08.208Z","0.1.0-beta.15":"2023-08-17T18:19:42.123Z","0.1.0-beta.16":"2023-08-17T20:13:21.595Z","0.1.0-beta.17":"2023-08-17T20:24:40.113Z","0.1.0-beta.18":"2023-08-28T19:55:49.792Z","0.1.0-beta.19":"2023-08-28T19:56:46.523Z"},"name":"@craftalley/lightspeed-sdk","dist-tags":{"latest":"0.1.0-beta.19"},"versions":{"0.1.0-beta.13":{"name":"@craftalley/lightspeed-sdk","version":"0.1.0-beta.13","description":"Unofficial Lightspeed SDK for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest --env=node","build":"npx tsc","check":"prettier --check src","lint":"prettier --write src"},"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"keywords":["lightspeed"],"author":{"name":"Digitaport"},"license":"MIT","bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"homepage":"https://github.com/digitaport/lightspeed-sdk#readme","dependencies":{"axios":"^0.21.0","form-data":"^3.0.0"},"devDependencies":{"@types/jest":"^27.5.0","jest":"^28.0.0","nock":"^13.0.5","prettier":"2.1.2","ts-jest":"^28.0.1","typescript":"^4.9.5"},"gitHead":"e3c53cd3c4e7f14f1643a1df037697cb05ebfbef","_id":"@craftalley/lightspeed-sdk@0.1.0-beta.13","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-2cWSeyuRl2Co2mdaq416Pa4lSIOZuOBzSjTWia7vstQ2+M0ol/7kD57A9umrmeJSsPIdy+hG/o19zKGLIl9mWw==","shasum":"81f3b26e7ae05d81c0c756d16e0a9ec491f217d6","tarball":"https://registry.npmjs.org/@craftalley/lightspeed-sdk/-/lightspeed-sdk-0.1.0-beta.13.tgz","fileCount":20,"unpackedSize":104065,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCO8AuRZJ3JkeeNczZwPot3xaU/mubFfP2xkvYOQ5uiAwIgNpLOhg4Y0mAB0N4hisVtfe82iGcLx4G+asRMuI7PVSU="}]},"_npmUser":{"name":"clubstack","email":"eugene@clubstack.tech"},"directories":{},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightspeed-sdk_0.1.0-beta.13_1687207017901_0.915232578840764"},"_hasShrinkwrap":false},"0.1.0-beta.14":{"name":"@craftalley/lightspeed-sdk","version":"0.1.0-beta.14","description":"Unofficial Lightspeed SDK for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest --env=node","build":"npx tsc","check":"prettier --check src","lint":"prettier --write src"},"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"keywords":["lightspeed"],"author":{"name":"Digitaport"},"license":"MIT","bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"homepage":"https://github.com/digitaport/lightspeed-sdk#readme","dependencies":{"axios":"^0.21.0","form-data":"^3.0.0"},"devDependencies":{"@types/jest":"^27.5.0","jest":"^28.0.0","nock":"^13.0.5","prettier":"2.1.2","ts-jest":"^28.0.1","typescript":"^4.6.4"},"gitHead":"e210f1814d96c8b1c2f8e73aa43014be8f0b28a0","_id":"@craftalley/lightspeed-sdk@0.1.0-beta.14","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-kbGa8btRVQH5NsvOlNs9kqDBRUAvEfI9e+Z4iJQMeGiYRkWyXl+3p9PxyGe7F9tbAh9UoowD8KiLH4hvY+h5Nw==","shasum":"6271a77ad3720f4429eb496007d1b24807016b16","tarball":"https://registry.npmjs.org/@craftalley/lightspeed-sdk/-/lightspeed-sdk-0.1.0-beta.14.tgz","fileCount":2,"unpackedSize":3769,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo2WmT75E1rRYbj4iGDX6TDmUwcLzv8kBLiSDuK+4wgAIgMaQ9ZGcM1WtaB6OqEznm5P9mVU6x4ejB4g/N665EO3o="}]},"_npmUser":{"name":"clubstack","email":"eugene@clubstack.tech"},"directories":{},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightspeed-sdk_0.1.0-beta.14_1692295388010_0.06271572127325209"},"_hasShrinkwrap":false},"0.1.0-beta.15":{"name":"@craftalley/lightspeed-sdk","version":"0.1.0-beta.15","description":"Unofficial Lightspeed SDK for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest --env=node","build":"npx tsc","check":"prettier --check src","lint":"prettier --write src"},"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"keywords":["lightspeed"],"author":{"name":"Digitaport"},"license":"MIT","bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"homepage":"https://github.com/digitaport/lightspeed-sdk#readme","dependencies":{"axios":"^0.21.0","form-data":"^3.0.0"},"devDependencies":{"@types/jest":"^27.5.0","@types/node":"^20.5.0","jest":"^28.0.0","nock":"^13.0.5","prettier":"2.1.2","ts-jest":"^28.0.1","typescript":"^4.9.5"},"gitHead":"e45f5389172e015b24ca5ca8b2fcf9fa4940a1af","_id":"@craftalley/lightspeed-sdk@0.1.0-beta.15","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-3zGdqNdDpwvQeVkJ5t9/cRWVgL8fMaoInv7GanoCTFCp70dG/ybXFePl/ZFHDa0Rz+wrmre8O17YNTItTjYqgQ==","shasum":"f10332dcf5450f8e3da3d74277505fa6b11a07e0","tarball":"https://registry.npmjs.org/@craftalley/lightspeed-sdk/-/lightspeed-sdk-0.1.0-beta.15.tgz","fileCount":20,"unpackedSize":104476,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD73vZBn550rniDwp6Wv/5vJBX1WBB0JhF+vAmlCZM0iwIgGlKCcX0IH2I568ErGgfJAiVE70/g3vdwPcpExMLRFJE="}]},"_npmUser":{"name":"clubstack","email":"eugene@clubstack.tech"},"directories":{},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightspeed-sdk_0.1.0-beta.15_1692296381965_0.24404483479588723"},"_hasShrinkwrap":false},"0.1.0-beta.16":{"name":"@craftalley/lightspeed-sdk","version":"0.1.0-beta.16","description":"Unofficial Lightspeed SDK for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest --env=node","build":"npx tsc","check":"prettier --check src","lint":"prettier --write src"},"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"keywords":["lightspeed"],"author":{"name":"Digitaport"},"license":"MIT","bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"homepage":"https://github.com/digitaport/lightspeed-sdk#readme","dependencies":{"axios":"^0.21.0","form-data":"^3.0.0"},"devDependencies":{"@types/jest":"^27.5.0","@types/node":"^20.5.0","jest":"^28.0.0","nock":"^13.0.5","prettier":"2.1.2","ts-jest":"^28.0.1","typescript":"^4.9.5"},"gitHead":"e93c04403fedac53cdd2f1911c36838e9d16c74b","_id":"@craftalley/lightspeed-sdk@0.1.0-beta.16","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-6u2NgCEsoeklUJbYU4eC5iZF0znq+9Ni80hymH1vvH5HSAV6BYTaVfHJgYM5/Lq6KcLcvyuVDJGHr6gjD5uArQ==","shasum":"c5dd4f9e3352de44814fd244c61d4da32b903bd3","tarball":"https://registry.npmjs.org/@craftalley/lightspeed-sdk/-/lightspeed-sdk-0.1.0-beta.16.tgz","fileCount":20,"unpackedSize":105733,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIFkFHNdiQoE7d5MkW9ISJtc0OfVjArZ63IdiuOy8VfAiB0ugXQ5JMBPjgC2ZlwfH4BQm+byMCCia50NzqcONRAnw=="}]},"_npmUser":{"name":"clubstack","email":"eugene@clubstack.tech"},"directories":{},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightspeed-sdk_0.1.0-beta.16_1692303201410_0.21904394042079334"},"_hasShrinkwrap":false},"0.1.0-beta.17":{"name":"@craftalley/lightspeed-sdk","version":"0.1.0-beta.17","description":"Unofficial Lightspeed SDK for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest --env=node","build":"npx tsc","check":"prettier --check src","lint":"prettier --write src"},"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"keywords":["lightspeed"],"author":{"name":"Digitaport"},"license":"MIT","bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"homepage":"https://github.com/digitaport/lightspeed-sdk#readme","dependencies":{"axios":"^0.21.0","form-data":"^3.0.0"},"devDependencies":{"@types/jest":"^27.5.0","@types/node":"^20.5.0","jest":"^28.0.0","nock":"^13.0.5","prettier":"2.1.2","ts-jest":"^28.0.1","typescript":"^4.9.5"},"gitHead":"151baac61ec6c1b3d0385004f740d71424b9ddff","_id":"@craftalley/lightspeed-sdk@0.1.0-beta.17","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-yA9olFL3jh3RkQeb5BOkpwAPOkxGxJOyDqhwZ5Ew4bX3JDLrZyznSrA0l+Imp5xq7xsKsJj6/QpQa6OEvIUQ5Q==","shasum":"1e195bd5630b279b2b337ff1f92d1a17280cd814","tarball":"https://registry.npmjs.org/@craftalley/lightspeed-sdk/-/lightspeed-sdk-0.1.0-beta.17.tgz","fileCount":20,"unpackedSize":105613,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl/tfdpHZG4S9na95i08xlzsme2/JvTyddaYawzNZQhgIgCdsmTwYh46puah5sPL15SngD0VG0utpNVintxAdia10="}]},"_npmUser":{"name":"clubstack","email":"eugene@clubstack.tech"},"directories":{},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightspeed-sdk_0.1.0-beta.17_1692303879952_0.13251570155119574"},"_hasShrinkwrap":false},"0.1.0-beta.18":{"name":"@craftalley/lightspeed-sdk","version":"0.1.0-beta.18","description":"Unofficial Lightspeed SDK for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest --env=node","build":"npx tsc","check":"prettier --check src","lint":"prettier --write src"},"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"keywords":["lightspeed"],"author":{"name":"Digitaport"},"license":"MIT","bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"homepage":"https://github.com/digitaport/lightspeed-sdk#readme","dependencies":{"axios":"^0.21.0","form-data":"^3.0.0"},"devDependencies":{"@types/jest":"^27.5.0","@types/node":"^20.5.0","jest":"^28.0.0","nock":"^13.0.5","prettier":"2.1.2","ts-jest":"^28.0.1","typescript":"^4.9.5"},"gitHead":"762b4e53dd48a99337a1ef354340793df2c5f009","_id":"@craftalley/lightspeed-sdk@0.1.0-beta.18","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-9cXmoEhEuTozR8PotVqAUz48As1eeMuiha5k8/1eAnrl+yKwPPAheLXCS4fJp35fxU7tCo2RWCYEyn66NvluAA==","shasum":"ce9907ecfa0940e15ee61230c53f23450d4499c7","tarball":"https://registry.npmjs.org/@craftalley/lightspeed-sdk/-/lightspeed-sdk-0.1.0-beta.18.tgz","fileCount":20,"unpackedSize":105683,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJN+6Ddp6tmaOpoHxLZHZep2dyP8qvYc4lTSieBBQJ3AiA+vY0+2dMHlBBsGjO0PQ9qoBpOSAM0mvLFkpCwHIpNjg=="}]},"_npmUser":{"name":"clubstack","email":"eugene@clubstack.tech"},"directories":{},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightspeed-sdk_0.1.0-beta.18_1693252549581_0.5047399229716509"},"_hasShrinkwrap":false},"0.1.0-beta.19":{"name":"@craftalley/lightspeed-sdk","version":"0.1.0-beta.19","description":"Unofficial Lightspeed SDK for Node.js","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"jest --env=node","build":"npx tsc","check":"prettier --check src","lint":"prettier --write src"},"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"keywords":["lightspeed"],"author":{"name":"Digitaport"},"license":"MIT","bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"homepage":"https://github.com/digitaport/lightspeed-sdk#readme","dependencies":{"axios":"^0.21.0","form-data":"^3.0.0"},"devDependencies":{"@types/jest":"^27.5.0","@types/node":"^20.5.0","jest":"^28.0.0","nock":"^13.0.5","prettier":"2.1.2","ts-jest":"^28.0.1","typescript":"^4.9.5"},"gitHead":"80d9b07fa95d1ee14e58ef127e4b481f1447b6ef","_id":"@craftalley/lightspeed-sdk@0.1.0-beta.19","_nodeVersion":"20.3.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-3m36UlakWluehtshzwwY4J5VitGGmELf2CUxHDSB89hv9GI9zCUEmZDqctEeyDHqeCciiZs9ECMyMKm+WKs8kw==","shasum":"40552ffadd037d450adbd97423f151ce8f065ff5","tarball":"https://registry.npmjs.org/@craftalley/lightspeed-sdk/-/lightspeed-sdk-0.1.0-beta.19.tgz","fileCount":20,"unpackedSize":106917,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICyT7a4PN1EEMm0rrVMlVSlCdSwaONCLBaqqmkEmTe3PAiEA144c1oa12n2gXBmbXUU9yRfhHb9baji4wmBDXdXWzOQ="}]},"_npmUser":{"name":"clubstack","email":"eugene@clubstack.tech"},"directories":{},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lightspeed-sdk_0.1.0-beta.19_1693252606303_0.5818989393905554"},"_hasShrinkwrap":false}},"maintainers":[{"name":"clubstack","email":"eugene@clubstack.tech"}],"description":"Unofficial Lightspeed SDK for Node.js","homepage":"https://github.com/digitaport/lightspeed-sdk#readme","keywords":["lightspeed"],"repository":{"type":"git","url":"git+https://github.com/digitaport/lightspeed-sdk.git"},"author":{"name":"Digitaport"},"bugs":{"url":"https://github.com/digitaport/lightspeed-sdk/issues"},"license":"MIT","readme":"# Lightspeed SDK\n\n**Note**: _This is not a Lightspeed official package._\n\n[![npm version](https://badge.fury.io/js/@craftalley%2Flightspeed-sdk.svg)](https://badge.fury.io/js/@craftalley%2Flightspeed-sdk)\n\n## Installation\n\nUse your favorite package manager to install any of the packages and save to your package.json:\n\n```\nnpm install lightspeed-sdk\n```\n\n## Usage\n\nImport the Retail API and initialize it:\n\n```js\nconst { LightspeedRetailApi } = import 'lightspeed-sdk';\n\nconst retailApi= new LightspeedRetailApi({\n  clientId: 'CLIENT_ID',\n  clientSecret: 'CLIENT_SECRET',\n  refreshToken: 'REFRESH_TOKEN',\n});\n```\n\nImport the Ecom API and initialize it:\n\n```js\nconst { LightspeedEcomApi } = import 'lightspeed-sdk';\n\nconst ecomApi = new LightspeedEcomApi({ \n  apiKey: 'my_api_key', \n  apiSecret: 'my_api_key', \n  clusterId: 'US1', \n});\n```\n\n### Retail API Examples\n\nPost customer information:\n\n```js\nconst customer = await retailApi.postCustomer(customer);\n```\n\nUpdate customer information:\n\n```js\nconst customer = await retailApi.putCustomer(customer, customerID);\n```\n\nRetrieve account information:\n\n```js\nconst account = await retailApi.getAccount();\n```\n\nRetrieve items by id:\n\n```js\nconst item = await retailApi.getItemById('accountNumber', 'id');\n```\n\nRetrieve all items:\n\n```js\nconst items = await retailApi.getItems('accountNumber');\nfor await (const item of items) {\n  console.log(item); // { itemID: 'X', ... }\n}\n```\n\nor\n\n```js\nconst items = await retailApi.getItems('accountNumber').toArray();\nconsole.log(items); // [{ itemID: 'X', ... }, {...}]\n```\n\n### Retail Pagination\n\nPagination is handled by the SDK by returning a cursor when querying:\n\n- getItems\n- getCategories\n- getManufacturers\n- getSales\n- getSaleLineBySaleID\n- getSalePaymentBySaleID\n- getItemsByMatrixID\n- getCustomers\n- getCustomerTypes\n\nThe object has an [async iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator)\nso you can do a `for await` loop to retrieve all the items,\nor load all at the same time by doing `.toArray()` on the object. Doing `.toArray()` could lead to performance\nissues if the collection is too big.\n\n## Ecom API Examples\n\nRetrieve account information:\n\n```js\nconst account = await ecomApi.getAccount();\n```\n\nGet orders:\n\n```js\nconst orders = await ecomApi.getOrders();\n```\n\n### Ecom Pagination\n\nPagination in the ecom api works similarly to the retail api with some minor differences\n\n```js\nconst orders = await ecomApi.getOrders();\nconsole.log('Number of orders=', orders.getCount());\nconst iterator = orders.items();\nconst firstItem = await iterator.next().value;\n```\n\n\n## Requirements\n\nThis package supports Node v8 LTS and higher. It's highly recommended to use the latest LTS version of node, and the documentation is written using syntax and features from that version.\n","readmeFilename":"README.md"}