From 4cd1828677a7c2b2bc7be159f876dd8f824c7b67 Mon Sep 17 00:00:00 2001 From: Fady Fawzy Date: Tue, 17 Nov 2020 11:14:59 +0100 Subject: [PATCH 01/18] fixes for solutions --- TODO | 8 +++++++- Task03_import_sync_products.js | 2 +- handson/customer.js | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index e996475..feec092 100644 --- a/TODO +++ b/TODO @@ -1 +1,7 @@ -set up the main branch to include the exercises +update docker to latest in the import sync and maybe use docker settings sync too +task 9 performance considerations. +retry +set correlation id +loggings +reuse tokens +use updateActions arary \ No newline at end of file diff --git a/Task03_import_sync_products.js b/Task03_import_sync_products.js index a062043..9606009 100644 --- a/Task03_import_sync_products.js +++ b/Task03_import_sync_products.js @@ -18,4 +18,4 @@ checkImportOperationStatus("productsImporter&Sync","bd71c221-e799-4d2c-bc9d-b6cb // -e TARGET_PROJECT_KEY=xxx \ // -e TARGET_CLIENT_ID=xxx \ // -e TARGET_CLIENT_SECRET=xxx \ -// commercetools/commercetools-project-sync:3.4.1 -s all +// commercetools/commercetools-project-sync:3.8.0 -s all diff --git a/handson/customer.js b/handson/customer.js index cb87fb1..6de1038 100644 --- a/handson/customer.js +++ b/handson/customer.js @@ -7,7 +7,7 @@ module.exports.getCustomerById = (ID) => .withId({ ID }) .get() .execute(); - + module.exports.getCustomerByKey = (key) => apiRoot .withProjectKey({ projectKey }) From f2897cd8301fc10fb07c8b21bfce295fd7a531e0 Mon Sep 17 00:00:00 2001 From: Lam Tran Date: Mon, 11 Jan 2021 16:41:42 +0100 Subject: [PATCH 02/18] Update product import solution to the newest API changes --- handson/importService.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handson/importService.js b/handson/importService.js index 2de7624..cc9f38a 100644 --- a/handson/importService.js +++ b/handson/importService.js @@ -21,7 +21,7 @@ const createImportSinkDraft = (importSinkDraftData) => { module.exports.checkImportOperationStatus = (importSinkKey, id) => importApiRoot .withProjectKeyValue({ projectKey }) - .products() + .productDrafts() .importSinkKeyWithImportSinkKeyValue({ importSinkKey }) .importOperations() .withIdValue({ id }) @@ -31,7 +31,7 @@ module.exports.checkImportOperationStatus = (importSinkKey, id) => module.exports.importProducts = async (importSinkKey) => importApiRoot .withProjectKeyValue({ projectKey }) - .products() + .productDrafts() .importSinkKeyWithImportSinkKeyValue({ importSinkKey }) .post({ body: await createImportProductsDraft(), @@ -74,6 +74,7 @@ const getProductDraftsArray = () => { prices: [ { value: { + type: "centPrecision", currencyCode: product.currencyCode, centAmount: parseInt(product.basePrice), }, From ac92a01ec9f7162609668c1c7050feb7714ed923 Mon Sep 17 00:00:00 2001 From: Fady Fawzy Date: Thu, 26 Aug 2021 13:37:16 +0200 Subject: [PATCH 03/18] security fixes --- package.json | 7 +++++++ yarn.lock | 40 ++++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index b027eaf..6f5aeb7 100644 --- a/package.json +++ b/package.json @@ -31,5 +31,12 @@ "dotenv": "^8.2.0", "express": "^4.17.1", "node-fetch": "^2.6.1" + }, + "resolutions": { + "csvtojson/**/lodash":"^4.17.21", + "cli-highlight/**/y18n":"^5.0.5", + "chalk-animation/**/hosted-git-info":"^2.8.9", + "chalk-animation/**/path-parse":"1.0.7", + "chalk-animation/**/trim-newlines":"4.0.1" } } diff --git a/yarn.lock b/yarn.lock index e78ff6a..3457f55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -434,10 +434,10 @@ highlight.js@^9.6.0: resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.3.tgz#a1a0a2028d5e3149e2380f8a865ee8516703d634" integrity sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ== -hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== +hosted-git-info@^2.1.4, hosted-git-info@^2.8.9: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== http-errors@1.7.2: version "1.7.2" @@ -543,10 +543,10 @@ lodash.defaultsdeep@^4.6.0: resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6" integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA== -lodash@^4.17.3: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== +lodash@^4.17.21, lodash@^4.17.3: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== loud-rejection@^1.0.0: version "1.6.0" @@ -750,10 +750,10 @@ path-exists@^4.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== +path-parse@1.0.7, path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-to-regexp@0.1.7: version "0.1.7" @@ -1021,10 +1021,10 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== -trim-newlines@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" - integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= +trim-newlines@4.0.1, trim-newlines@^2.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-4.0.1.tgz#caa1a0c92e86282c9cc8485ccd3ee5a6a4fbd958" + integrity sha512-5n5GIW0uEbjCB2PO6OoaG11rscJmLOLw12ZG9e0vBKNMToDJ2n1+AkUhJpGO2bLj3jXKa/gYTGVmilX5CCxqmA== type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" @@ -1071,10 +1071,10 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== +y18n@^4.0.0, y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yargs-parser@^18.1.2: version "18.1.3" From 4b3976cd6ad6eea37e868da1b873dea0171783e1 Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Mon, 1 Nov 2021 08:07:56 -0400 Subject: [PATCH 04/18] added custom objects task --- ...7_extensions.js => Task07a_custom_types.js | 19 ++---------- Task07b_custom_objects.js | 23 ++++++++++++++ Task07c_extensions.js | 18 +++++++++++ handson/customObjects.js | 31 +++++++++++++++++++ package.json | 4 ++- 5 files changed, 77 insertions(+), 18 deletions(-) rename Task07_extensions.js => Task07a_custom_types.js (51%) create mode 100644 Task07b_custom_objects.js create mode 100644 Task07c_extensions.js create mode 100644 handson/customObjects.js diff --git a/Task07_extensions.js b/Task07a_custom_types.js similarity index 51% rename from Task07_extensions.js rename to Task07a_custom_types.js index 9597ff1..bdaa213 100644 --- a/Task07_extensions.js +++ b/Task07a_custom_types.js @@ -1,11 +1,10 @@ const {createCustomType} = require('./handson/customTypes'); -const {createExtension} = require('./handson/extensions'); const {log} = require('./logger'); -const sampleTypeDraft = { +const sampleTypeDraftData = { key:'allowed-to-place-orders', name:{ "de-DE":'allowed-to-place-orders' @@ -28,18 +27,4 @@ const sampleTypeDraft = { } -//createCustomType(sampleTypeDraft).then(log).catch(log); - -const sampleExtensionDraft = { - key:'orderChecker', - destination:{ - type:'HTTP', - url:'https://europe-west3-ct-support.cloudfunctions.net/training-extensions-sample' - }, - triggers:[{ - resourceTypeId:'order', - actions:['Create'] - }] -} - -createExtension(sampleExtensionDraft).then(log).catch(log); +createCustomType(sampleTypeDraftData).then(log).catch(log); diff --git a/Task07b_custom_objects.js b/Task07b_custom_objects.js new file mode 100644 index 0000000..4ad61bd --- /dev/null +++ b/Task07b_custom_objects.js @@ -0,0 +1,23 @@ +const {createCustomObject, getCustomObjectByContainerAndKey} = require('./handson/customObjects'); +const {log} = require('./logger'); + + + +const sampleCustomObjectDraftData = { + container: "compatibility-info", + key:'basil-seed-box', + value: { + IncompatibleSKUs: "tulip-seed-box", + LeafletID: "leaflet_1234", + Instructions: { + Title: "Plant Handling", + Distance: "2 meter", + Watering: "heavy watering" + } + } + +} + +createCustomObject(sampleCustomObjectDraftData).then(log).catch(log); + +// getCustomObjectByContainerAndKey("compatibility-info","basil-seed-box").then(log).catch(log); \ No newline at end of file diff --git a/Task07c_extensions.js b/Task07c_extensions.js new file mode 100644 index 0000000..18c15a5 --- /dev/null +++ b/Task07c_extensions.js @@ -0,0 +1,18 @@ +const {createExtension} = require('./handson/extensions'); +const {log} = require('./logger'); + + + +const sampleExtensionDraft = { + key:'orderChecker', + destination:{ + type:'HTTP', + url:'https://europe-west3-ct-support.cloudfunctions.net/training-extensions-sample' + }, + triggers:[{ + resourceTypeId:'order', + actions:['Create'] + }] +} + +createExtension(sampleExtensionDraft).then(log).catch(log); diff --git a/handson/customObjects.js b/handson/customObjects.js new file mode 100644 index 0000000..d1f429c --- /dev/null +++ b/handson/customObjects.js @@ -0,0 +1,31 @@ +const { apiRoot, projectKey } = require("./client.js"); + + +module.exports.getCustomObjectByContainerAndKey = (container, key) => + apiRoot + .withProjectKey({ projectKey }) + .customObjects() + .withContainerAndKey({ + container, + key + }) + .get() + .execute(); + + +module.exports.createCustomObject = (customObjectDraftData) => + apiRoot + .withProjectKey({ projectKey }) + .customObjects() + .post({ body: createCustomObjectDraft(customObjectDraftData) }) + .execute(); + + +const createCustomObjectDraft = (customObjectDraftData) => { + const {container, key, value}=customObjectDraftData + return { + container, + key, + value + } +} diff --git a/package.json b/package.json index 6f5aeb7..2d2c0f5 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,9 @@ "6a": "node Task06a_search.js", "6b": "node Task06b_pagination.js", "6c": "node Task06c_graphql.js", - "7": "node Task07_extensions.js", + "7a": "node Task07a_custom_types.js", + "7b": "node Task07b_custom_objects.js", + "7c": "node Task07c_extensions.js", "8": "node Task08_subscriptions.js" }, "dependencies": { From b635c1866fa93e6473e9172ffd2725c8d7bca7ee Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Fri, 5 Nov 2021 08:50:43 -0400 Subject: [PATCH 05/18] updated import sdk version --- .env.sample | 14 ++++------ Task03_import_sync_products.js | 18 ++++++------ handson/importService.js | 26 ++++++------------ package.json | 6 ++-- yarn.lock | 50 ++++++++++++++++++++++------------ 5 files changed, 60 insertions(+), 54 deletions(-) diff --git a/.env.sample b/.env.sample index 772babd..95c2108 100644 --- a/.env.sample +++ b/.env.sample @@ -1,8 +1,6 @@ -adminClientId= -adminClientSecret= -importClientId= -importClientSecret= -storeClientId= -storeClientSecret= -myClientId= -myClientSecret= \ No newline at end of file +CTP_PROJECT_KEY= +CTP_CLIENT_SECRET= +CTP_CLIENT_ID= +CTP_AUTH_URL= +CTP_API_URL= +CTP_SCOPES= \ No newline at end of file diff --git a/Task03_import_sync_products.js b/Task03_import_sync_products.js index 9606009..b6f957f 100644 --- a/Task03_import_sync_products.js +++ b/Task03_import_sync_products.js @@ -1,14 +1,14 @@ -const { createImportSink, importProducts,checkImportOperationStatus } = require("./handson/importService"); +const { createImportContainer, importProducts,checkImportOperationStatus } = require("./handson/importService"); const { log } = require("./logger.js"); -// createImportSink({ -// key:'productsImporter&Sync', -// resourceType:'product-draft' -// }).then(log).catch(log); +const containerKey = "ff-ImportContainer"; -//importProducts("productsImporter&Sync").then(log).catch(log); -checkImportOperationStatus("productsImporter&Sync","e8a74464-c00a-4e43-a372-15839d508c05").then(log).catch(log); -checkImportOperationStatus("productsImporter&Sync","bd71c221-e799-4d2c-bc9d-b6cb1403c2da").then(log).catch(log); +createImportContainer(containerKey).then(log).catch(log); + +importProducts(containerKey).then(log).catch(log); + +// checkImportOperationStatus("e8a74464-c00a-4e43-a372-15839d508c05").then(log).catch(log); +// checkImportOperationStatus("bd71c221-e799-4d2c-bc9d-b6cb1403c2da").then(log).catch(log); //https://github.com/commercetools/commercetools-project-sync#run // docker run \ @@ -18,4 +18,4 @@ checkImportOperationStatus("productsImporter&Sync","bd71c221-e799-4d2c-bc9d-b6cb // -e TARGET_PROJECT_KEY=xxx \ // -e TARGET_CLIENT_ID=xxx \ // -e TARGET_CLIENT_SECRET=xxx \ -// commercetools/commercetools-project-sync:3.8.0 -s all +// commercetools/commercetools-project-sync:5.0.0 -s all diff --git a/handson/importService.js b/handson/importService.js index cc9f38a..a1d4bba 100644 --- a/handson/importService.js +++ b/handson/importService.js @@ -1,38 +1,29 @@ const { importApiRoot, projectKey } = require("./client.js"); const csvtojsonV2 = require("csvtojson"); -module.exports.createImportSink = (importSinkDraftData) => +module.exports.createImportContainer = (key) => importApiRoot .withProjectKeyValue({ projectKey }) - .importSinks() + .importContainers() .post({ - body: createImportSinkDraft(importSinkDraftData), + body: {key}, }) .execute(); -const createImportSinkDraft = (importSinkDraftData) => { - const { key, resourceType } = importSinkDraftData; - return { - key, - resourceType, - }; -}; - -module.exports.checkImportOperationStatus = (importSinkKey, id) => +module.exports.checkImportOperationStatus = (id) => importApiRoot .withProjectKeyValue({ projectKey }) - .productDrafts() - .importSinkKeyWithImportSinkKeyValue({ importSinkKey }) .importOperations() - .withIdValue({ id }) + .withIdValue({id}) .get() .execute(); -module.exports.importProducts = async (importSinkKey) => +module.exports.importProducts = async (importContainerKey) => importApiRoot .withProjectKeyValue({ projectKey }) .productDrafts() - .importSinkKeyWithImportSinkKeyValue({ importSinkKey }) + .importContainers() + .withImportContainerKeyValue({importContainerKey}) .post({ body: await createImportProductsDraft(), }) @@ -71,6 +62,7 @@ const getProductDraftsArray = () => { }, masterVariant: { sku: product.inventoryId, + key: participantNamePrefix + "-" + product.productName, prices: [ { value: { diff --git a/package.json b/package.json index 2d2c0f5..f8bc299 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,11 @@ }, "dependencies": { "@commercetools/api-request-builder": "^5.6.3", - "@commercetools/importapi-sdk": "^1.3.0", - "@commercetools/sdk-auth": "^3.0.9", + "@commercetools/importapi-sdk": "^1.20.0", + "@commercetools/sdk-auth": "^3.0.12", "@commercetools/sdk-client": "^2.1.2", "@commercetools/sdk-middleware-auth": "^6.1.4", - "@commercetools/sdk-middleware-http": "^6.0.8", + "@commercetools/sdk-middleware-http": "^6.1.0", "@commercetools/typescript-sdk": "^1.2.0", "chalk-animation": "^1.6.0", "cli-highlight": "^2.1.4", diff --git a/yarn.lock b/yarn.lock index 3457f55..6f7a798 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,36 +7,47 @@ resolved "https://registry.yarnpkg.com/@commercetools/api-request-builder/-/api-request-builder-5.6.3.tgz#d87c4961fec95a9186dd59fcd0256ea56cd89772" integrity sha512-Oazb2Exuc4RR+p86m1xFkruQscX/hakejCSiUrxOmeqMKY5CBeFXXVAlfpDTjxgZ0nXgkPWGWye1FHCXlSRLOw== -"@commercetools/importapi-sdk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-1.3.0.tgz#907498892300d104569b2114da5380bfc3d17eb3" - integrity sha512-IPKubLllEqtys8mEpOWZ1HyIe+vLYt5v9TFLLc0uXGdbO7tvu5ybvMU0jo+nkDH9B4RWGRvzfTdXzX96J5YyBw== - -"@commercetools/sdk-auth@^3.0.9": - version "3.0.9" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-auth/-/sdk-auth-3.0.9.tgz#4cbee3e9729bc50ef42a080c1fd2a15efa7f2019" - integrity sha512-j7KYF5a2JTdfsONONE8NsHzFRqz40OTsPTS/GDyjnrDFvCT6gez665pheMS5ASRz/CjltrA+z5ucYFd4iaXxEg== - dependencies: - "@commercetools/sdk-middleware-http" "^6.0.8" +"@commercetools/importapi-sdk@^1.20.0": + version "1.20.0" + resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-1.20.0.tgz#6a0f068ff655cf6a3bf25fcaa766e9616e11ae9d" + integrity sha512-vskmvv7HgoMDorQzla3Y/tRD4qHbX0r3AJo6mdaNN9QlDkIeMH8srf94nykyWtdl3+uzqs6OJkfdo2dVw+RXvw== + dependencies: + "@commercetools/sdk-client" "^2.1.1" + "@commercetools/sdk-middleware-auth" "^6.0.4" + "@commercetools/sdk-middleware-http" "^6.0.4" + "@commercetools/sdk-middleware-logger" "^2.1.1" + querystring "^0.2.1" + +"@commercetools/sdk-auth@^3.0.12": + version "3.0.12" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-auth/-/sdk-auth-3.0.12.tgz#6b6930f697f2311beeb909677df08bd5c7f523b8" + integrity sha512-t7F71oNK+A23hLGzlEYnjTtqhxDUFST8f4l9YAf7mmVCA9Qeu668pDvJ/kf5gVLMQVazEQM8Vjy4JyyeQctEkQ== + dependencies: + "@commercetools/sdk-middleware-http" "^6.0.11" lodash.defaultsdeep "^4.6.0" qss "2.0.3" -"@commercetools/sdk-client@^2.1.2": +"@commercetools/sdk-client@^2.1.1", "@commercetools/sdk-client@^2.1.2": version "2.1.2" resolved "https://registry.yarnpkg.com/@commercetools/sdk-client/-/sdk-client-2.1.2.tgz#fe1e442f67a385f103470669784c0fa20d7a2314" integrity sha512-YPpK39pkjfedjS1/BFg2d7CrvTeN7vIS5vfiqEkKOtAoUxiNkugv59gRSoh2Em8SOccxyM/skpgHyTqfmJzXug== -"@commercetools/sdk-middleware-auth@^6.1.4": +"@commercetools/sdk-middleware-auth@^6.0.4", "@commercetools/sdk-middleware-auth@^6.1.4": version "6.1.4" resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.1.4.tgz#c5f464ae1627336715681e4590b63777e034c890" integrity sha512-49R1DWsA+pNHH7/2K6QU5wnJSXabljKA8dvzs5HcbLwutlDp3Io0XHgIJa9qpfYhgW6k0h9dPICcLbESrQBXYw== dependencies: node-fetch "^2.3.0" -"@commercetools/sdk-middleware-http@^6.0.8": - version "6.0.8" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.0.8.tgz#15e2cc2eb9b12d2913061cb4c7f770d6d03b0166" - integrity sha512-o1y96K5sZ5zOpHqesZt8I14SZMrZchDIOAv2pc3DDJwqguxEBvQMqAE7pwBySH/CLayrC8z6pfljPNFEMQNXGQ== +"@commercetools/sdk-middleware-http@^6.0.11", "@commercetools/sdk-middleware-http@^6.0.4", "@commercetools/sdk-middleware-http@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.1.0.tgz#e4aebc0a4865dab00cd986449d7b395dc86fe124" + integrity sha512-j/k66riaQv50Y3iK0CLJglHh56id7PfxGIDyL0PjlLSkQe2TPVGFnM//CZAQ8a6fHT9adQYLxDMYqlb1nWEDZw== + +"@commercetools/sdk-middleware-logger@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-logger/-/sdk-middleware-logger-2.1.1.tgz#9283fdc8c403a7e2d4d06637e6015770b864e64a" + integrity sha512-k/Jm3lsWbszPBHtPAvu0rINTq398p4ddv0zbAH8R4p6Yc1GkBEy6tNgHPzX/eFskI/qerPy9IsW1xK8pqgtHHQ== "@commercetools/typescript-sdk@^1.2.0": version "1.2.0" @@ -790,6 +801,11 @@ qss@2.0.3: resolved "https://registry.yarnpkg.com/qss/-/qss-2.0.3.tgz#630b38b120931b52d04704f3abfb0f861604a9ec" integrity sha512-j48ZBT5IZbSqJiSU8EX4XrN8nXiflHvmMvv2XpFc31gh7n6EpSs75bNr6+oj3FOLWyT8m09pTmqLNl34L7/uPQ== +querystring@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" + integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== + quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" From 4626b207727a88821941f957a3af70ba304cfb15 Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Fri, 12 Nov 2021 12:27:19 -0500 Subject: [PATCH 06/18] updated store and search tasks --- .env.sample | 9 +++++++- README.md | 14 +++++++----- Task01_project_setup.js | 2 +- Task02_customers.js | 10 ++++---- Task03_import_sync_products.js | 18 ++++++++++----- Task04a_states.js | 7 +++--- Task04b_checkout.js | 5 ++-- Task04c_merging.js | 34 +++++++++++++++------------ Task05_stores.js | 9 ++++++-- Task06b_pagination.js | 20 ++++++++++++---- Task06c_graphql.js | 22 ++++++++++++++++-- Task07a_custom_types.js | 15 ++++++------ Task07b_custom_objects.js | 6 ++--- handson/client.js | 42 ++++++++++++++++++---------------- handson/graphql.js | 24 ++----------------- handson/importService.js | 9 ++++++++ handson/search.js | 5 ++-- handson/store.js | 20 +++++++++++++++- package.json | 2 +- 19 files changed, 168 insertions(+), 105 deletions(-) diff --git a/.env.sample b/.env.sample index 95c2108..a6689a2 100644 --- a/.env.sample +++ b/.env.sample @@ -1,6 +1,13 @@ +# admin api client CTP_PROJECT_KEY= CTP_CLIENT_SECRET= CTP_CLIENT_ID= CTP_AUTH_URL= CTP_API_URL= -CTP_SCOPES= \ No newline at end of file +CTP_SCOPES= + +# admin api client + +# store api client + +# my api client \ No newline at end of file diff --git a/README.md b/README.md index 08804e1..9095621 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,23 @@ # commercetools-js-sdk-v2-training commercetools-js-sdk-v2-training -** COMING SOON ** +https://ok.commercetools.com/training-offering-calendar + NEW JAVASCRIPT COURSE USING THE NEW COMMERCETOOLS JS SDK https://github.com/commercetools/commercetools-sdk-typescript#sdk +Usage Add API Client Credentials in .env.sample then remove the ".sample" file name should be only ".env" then follow your trainer instructions to solve the exercises. -use the command yarn to install dependencies +Use the command `yarn` to install dependencies -then you should be able to run any file using yarn [fileNumber] +then you should be able to run any file using `yarn [fileNumber]` example -yarn 1 -yarn 4c -yarn 6b +- yarn 1 +- yarn 4c +- yarn 6b for questions email training@commercetools.com \ No newline at end of file diff --git a/Task01_project_setup.js b/Task01_project_setup.js index fc85dc3..f0f2526 100644 --- a/Task01_project_setup.js +++ b/Task01_project_setup.js @@ -14,4 +14,4 @@ getProject().then(log).catch(log); //getShippingMethodById("fb9d70f3-c59a-4507-b1ad-73ad5acfac94").then(log).catch(log); -//getTaxCategoryByKey("VAT").then(log).catch(log); +// getTaxCategoryByKey("standard-tax-category").then(log).catch(log); diff --git a/Task02_customers.js b/Task02_customers.js index dbbe473..e77011f 100644 --- a/Task02_customers.js +++ b/Task02_customers.js @@ -7,21 +7,21 @@ const { } = require("./handson/customer"); const { log } = require("./logger.js"); -const customerSampleData = { +const customerDraftData = { firstName: "test2", lastName: "test", email: "test2@test.com", - password: "123", + password: "password", key: "test1233", countryCode: "DE", }; -//createCustomer(customerSampleData).then(log).catch(log); +//createCustomer(customerDraftData).then(log).catch(log); //getCustomerByKey('test123').then(log).catch(log); getCustomerById("10cb16bf-a5d8-4f47-b664-fe5cae2f75d0").then(log).catch(log); -//createCustomerKeyVerfiedEmail(customerSampleData).then(log).catch(log); +// createCustomerKeyVerfiedEmail(customerDraftData).then(log).catch(log); -//assignCustomerToCustomerGroup('test123','testCustomerGroup123').then(log).catch(log); +//assignCustomerToCustomerGroup('test123','indoor-customers').then(log).catch(log); diff --git a/Task03_import_sync_products.js b/Task03_import_sync_products.js index b6f957f..0813fe9 100644 --- a/Task03_import_sync_products.js +++ b/Task03_import_sync_products.js @@ -1,16 +1,22 @@ -const { createImportContainer, importProducts,checkImportOperationStatus } = require("./handson/importService"); +const { createImportContainer, importProducts, checkImportSummary, checkImportOperationStatus } = require("./handson/importService"); const { log } = require("./logger.js"); const containerKey = "ff-ImportContainer"; -createImportContainer(containerKey).then(log).catch(log); +// Create an import container +//createImportContainer(containerKey).then(log).catch(log); -importProducts(containerKey).then(log).catch(log); +// import products +// importProducts(containerKey).then(log).catch(log); -// checkImportOperationStatus("e8a74464-c00a-4e43-a372-15839d508c05").then(log).catch(log); -// checkImportOperationStatus("bd71c221-e799-4d2c-bc9d-b6cb1403c2da").then(log).catch(log); +// check import summary for your container +checkImportSummary(containerKey).then(log).catch(log); -//https://github.com/commercetools/commercetools-project-sync#run +// Check the status of import operations by their Ids + checkImportOperationStatus("2e325e01-1193-4d8a-92c9-af29da1cc0fb").then(log).catch(log); + checkImportOperationStatus("cd61acae-301d-4984-8dc2-2deb0ba5035c").then(log).catch(log); + +// https://github.com/commercetools/commercetools-project-sync#run // docker run \ // -e SOURCE_PROJECT_KEY=xxx \ // -e SOURCE_CLIENT_ID=xxx \ diff --git a/Task04a_states.js b/Task04a_states.js index 0eb9558..8088a3b 100644 --- a/Task04a_states.js +++ b/Task04a_states.js @@ -2,10 +2,11 @@ const states = require("./handson/states"); const { log } = require("./logger.js"); const stateDraftData = { - key: "order-completed", + key: "ff-order-completed", type: "OrderState", name: { - "de-DE": "Order Completed ", + "de": "FF Order Completed ", + "en": "FF Order Completed ", }, initial: false, }; @@ -14,4 +15,4 @@ const stateDraftData = { //states.getStateById("67c67c4e-a3ab-4d38-ab0b-741cfd4b3d44").then(log).catch(log) -//states.addTransition("eb35b1d8-9cad-478f-a7a6-11d95cc5e79a", "a5f8b4bd-6314-4f4e-acbb-780ac3e3772e").then(log).catch(log) +states.addTransition("eb35b1d8-9cad-478f-a7a6-11d95cc5e79a", "a5f8b4bd-6314-4f4e-acbb-780ac3e3772e").then(log).catch(log) diff --git a/Task04b_checkout.js b/Task04b_checkout.js index d45be5d..2c6955b 100644 --- a/Task04b_checkout.js +++ b/Task04b_checkout.js @@ -19,8 +19,9 @@ const paymentDraft = { } //checkout.createCart(cartDraftData).then(log).catch(log) -//checkout.addLineItemsToCart(['123','123'],'294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log) +//checkout.addLineItemsToCart(['sku123','sku123'],'294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log) +// checkout.addDiscountCodeToCart("SUMMER",'294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log); //checkout.getCartById('294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log) //checkout.createOrderFromCart('294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log) @@ -41,7 +42,7 @@ const checkoutProcess = async () => { let emptyCart = await checkout.createCart(cartDraftData); let filledCart = await checkout.addLineItemsToCart( - ["123", "123",'123'], + ["sku123", "sku123",'sku111'], emptyCart.body.id ); filledCart = await checkout.addDiscountCodeToCart( diff --git a/Task04c_merging.js b/Task04c_merging.js index bebdfe7..c7b0247 100644 --- a/Task04c_merging.js +++ b/Task04c_merging.js @@ -1,40 +1,46 @@ const checkout = require("./handson/order"); const { log } = require("./logger.js"); -const cartDraftData = { +const anonymousCartDraftData = { currency: "EUR", - //customerId: "10cb16bf-a5d8-4f47-b664-fe5cae2f75d0", countryCode: "DE", }; -const cartDraftData2 = { +const customerCartDraftData = { currency: "EUR", customerId: "10cb16bf-a5d8-4f47-b664-fe5cae2f75d0", countryCode: "DE", }; const mergingProcessTest = async () => { - let anonymousCart = await checkout.createCart(cartDraftData); + let anonymousCart = await checkout.createCart(anonymousCartDraftData); - let customerCart = await checkout.createCart(cartDraftData2); + let customerCart = await checkout.createCart(customerCartDraftData); anonymousCart = await checkout.addLineItemsToCart( - ["123", "123"], + ["sku111", "sku123","sku123"], anonymousCart.body.id ); customerCart = await checkout.addLineItemsToCart( - ["123"], + ["sku123"], customerCart.body.id ); - log(anonymousCart.body.id); // look it up in impex you will see it's merged - log(customerCart.body.id); + log("Anonymous Cart: " + anonymousCart.body.id); + log("Customer Cart: "+ customerCart.body.id); const customerDetails = { - email: "persona1@example.com", - password: "123", + email: "test2@test.com", + password: "password", anonymousCartId: anonymousCart.body.id, + anonymousCartSignInMode: "MergeWithExistingCustomerCart", // try switching to UseAsNewActiveCustomerCart }; - let test = await checkout.customerSignIn(customerDetails); - return test; + let result = await checkout.customerSignIn(customerDetails); + return result.body.cart; }; -mergingProcessTest().then(log).catch(log); +mergingProcessTest().then((cart) => { + log("Active cart: " + cart.id); + cart.lineItems.forEach(item => { + log(item.variant.sku+ " :" + item.quantity); + }); +}) +.catch(log); diff --git a/Task05_stores.js b/Task05_stores.js index cc9fe80..7eeb4ee 100644 --- a/Task05_stores.js +++ b/Task05_stores.js @@ -1,6 +1,11 @@ -const { getCustomersInStore, getMe } = require("./handson/store"); +const { getCustomersInStore, createInSoreCart, getMe } = require("./handson/store"); +const { getCustomerByKey } = require("./handson/customer"); const { log } = require("./logger"); -getCustomersInStore('de-store').then(log).catch(log); + getCustomersInStore('berlin-store').then(log).catch(log); + +//getCustomerByKey("nage1223").then((customer) => { +// createInSoreCart("berlin-store",customer).then(log).catch(log); +//}).catch(log); //getMe().then(log).catch(log); diff --git a/Task06b_pagination.js b/Task06b_pagination.js index 666ba54..261c185 100644 --- a/Task06b_pagination.js +++ b/Task06b_pagination.js @@ -2,8 +2,18 @@ const { simulatePagination } = require("./handson/search"); const { log } = require("./logger"); -simulatePagination(2,2).then(products =>{ - products.body.results.forEach(element => { - log(element.id) - }); -}).catch(log); \ No newline at end of file +var page = 1, perPage = 3, lastPage = false, products = null; + +const getPagedQueryResults = async _ => { + while (!lastPage){ + products = await simulatePagination(perPage,page) + log("Showing results for page " + page) + products.body.results.forEach(element => { + log(element.id) + }); + lastPage = (products.body.count < perPage)? true : false; + page++; + } +} + +getPagedQueryResults().catch(log); diff --git a/Task06c_graphql.js b/Task06c_graphql.js index ee8a6a8..263809b 100644 --- a/Task06c_graphql.js +++ b/Task06c_graphql.js @@ -2,5 +2,23 @@ const {getCustomerWithOrders} = require ('./handson/graphql'); const { log } = require("./logger"); - -getCustomerWithOrders().then(log).catch(log) \ No newline at end of file +const testQuery = ` +query { + orders { + results { + customer { + email + } + lineItems { + nameAllLocales { + value + } + } + totalPrice { + centAmount + } + } + } + } + `; +getCustomerWithOrders(testQuery).then(log).catch(log) \ No newline at end of file diff --git a/Task07a_custom_types.js b/Task07a_custom_types.js index bdaa213..acb811e 100644 --- a/Task07a_custom_types.js +++ b/Task07a_custom_types.js @@ -2,15 +2,15 @@ const {createCustomType} = require('./handson/customTypes'); const {log} = require('./logger'); - - const sampleTypeDraftData = { - key:'allowed-to-place-orders', + key:'ff-allowed-to-place-orders', name:{ - "de-DE":'allowed-to-place-orders' + "de":'ff-allowed-to-place-orders', + "en":'ff-allowed-to-place-orders' }, description:{ - "de-DE":'allowed-to-place-orders' + "de":'allowed-to-place-orders', + "en":'allowed-to-place-orders' }, resourceTypeIds:['customer'], fieldDefinitions:[{ @@ -19,12 +19,11 @@ const sampleTypeDraftData = { }, name:'allowed-to-place-orders', label:{ - "de-DE":'Allowed to place orders' + "de":'Allowed to place orders', + "en":'Allowed to place orders' }, required:false, - }] - } createCustomType(sampleTypeDraftData).then(log).catch(log); diff --git a/Task07b_custom_objects.js b/Task07b_custom_objects.js index 4ad61bd..ef5d6a9 100644 --- a/Task07b_custom_objects.js +++ b/Task07b_custom_objects.js @@ -5,9 +5,9 @@ const {log} = require('./logger'); const sampleCustomObjectDraftData = { container: "compatibility-info", - key:'basil-seed-box', + key:'tulip-seed-product', value: { - IncompatibleSKUs: "tulip-seed-box", + IncompatibleSKUs: "basil-seed-product", LeafletID: "leaflet_1234", Instructions: { Title: "Plant Handling", @@ -20,4 +20,4 @@ const sampleCustomObjectDraftData = { createCustomObject(sampleCustomObjectDraftData).then(log).catch(log); -// getCustomObjectByContainerAndKey("compatibility-info","basil-seed-box").then(log).catch(log); \ No newline at end of file +// getCustomObjectByContainerAndKey("compatibility-info","tulip-seed-product").then(log).catch(log); \ No newline at end of file diff --git a/handson/client.js b/handson/client.js index 21c88de..3be50c0 100644 --- a/handson/client.js +++ b/handson/client.js @@ -15,21 +15,23 @@ require("dotenv").config(); const fetch = require("node-fetch"); -const projectKey = "training-fady-24-7"; +const projectKey = process.env.CTP_PROJECT_KEY; + +//use .env for credentials process.env.adminClientId const getClient = () => { const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({ - host: "https://auth.europe-west1.gcp.commercetools.com", + host: process.env.CTP_AUTH_URL, projectKey, credentials: { - clientId: process.env.adminClientId, - clientSecret: process.env.adminClientSecret, + clientId: process.env.CTP_CLIENT_ID, + clientSecret: process.env.CTP_CLIENT_SECRET }, fetch, }); const httpMiddleware = createHttpMiddleware({ - host: "https://api.europe-west1.gcp.commercetools.com", + host: process.env.CTP_API_URL, fetch, }); @@ -41,24 +43,24 @@ const getClient = () => { const getImportClient = () => { const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({ - host: "https://auth.europe-west1.gcp.commercetools.com", + host: process.env.IMPORT_AUTH_URL, projectKey, credentials: { - clientId: process.env.importClientId, - clientSecret: process.env.importClientSecret, + clientId: process.env.IMPORT_CLIENT_ID, + clientSecret: process.env.IMPORT_CLIENT_SECRET, }, fetch, }); const httpMiddleware = createHttpMiddleware({ - host: "https://import.europe-west1.gcp.commercetools.com", + host: process.env.IMPORT_API_URL, fetch, }); - const ctpClient = createClient({ + const importClient = createClient({ middlewares: [authMiddleware, httpMiddleware], }); - return ctpClient; + return importClient; }; const getStoreClient = () => { @@ -66,32 +68,32 @@ const getStoreClient = () => { host: "https://auth.europe-west1.gcp.commercetools.com", projectKey, credentials: { - clientId: process.env.storeClientId, - clientSecret: process.env.storeClientSecret, + clientId: process.env.STORE_CLIENT_ID, + clientSecret: process.env.STORE_CLIENT_SECRET, }, fetch, }); const httpMiddleware = createHttpMiddleware({ - host: "https://api.europe-west1.gcp.commercetools.com", + host: process.env.STORE_API_URL, fetch, }); - const ctpClient = createClient({ + const storeClient = createClient({ middlewares: [authMiddleware, httpMiddleware], }); - return ctpClient; + return storeClient; }; const getMLClient = () => {}; const getMyAPIClient = () => { const authMiddleware = createAuthMiddlewareForPasswordFlow({ - host: "https://auth.europe-west1.gcp.commercetools.com", + host: process.env.ME_AUTH_URL, projectKey, credentials: { - clientId: process.env.myClientId, - clientSecret: process.env.myClientSecret, + clientId: process.env.ME_CLIENT_ID, + clientSecret: process.env.ME_CLIENT_SECRET, user: { username: "fafa2@example.com", password: "123", @@ -100,7 +102,7 @@ const getMyAPIClient = () => { fetch, }); const httpMiddleware = createHttpMiddleware({ - host: "https://api.europe-west1.gcp.commercetools.com", + host: process.env.ME_API_URL, fetch, }); diff --git a/handson/graphql.js b/handson/graphql.js index 63a73d4..9bb6d5b 100644 --- a/handson/graphql.js +++ b/handson/graphql.js @@ -1,29 +1,9 @@ const { apiRoot, projectKey } = require("./client.js"); -const testQuery = ` -query { - orders { - results { - customer { - email - } - lineItems { - nameAllLocales { - value - } - } - totalPrice { - centAmount - } - } - } - } - `; - -module.exports.getCustomerWithOrders = () =>apiRoot.withProjectKey({projectKey}).graphql().post({ +module.exports.getCustomerWithOrders = (query) =>apiRoot.withProjectKey({projectKey}).graphql().post({ body:{ - query:testQuery, + query, variables:{} } }).execute(); \ No newline at end of file diff --git a/handson/importService.js b/handson/importService.js index a1d4bba..e2ac4d1 100644 --- a/handson/importService.js +++ b/handson/importService.js @@ -10,6 +10,15 @@ module.exports.createImportContainer = (key) => }) .execute(); +module.exports.checkImportSummary = (importContainerKey) => + importApiRoot + .withProjectKeyValue({projectKey}) + .importContainers() + .withImportContainerKeyValue({importContainerKey}) + .importSummaries() + .get() + .execute(); + module.exports.checkImportOperationStatus = (id) => importApiRoot .withProjectKeyValue({ projectKey }) diff --git a/handson/search.js b/handson/search.js index 9baff45..b504d98 100644 --- a/handson/search.js +++ b/handson/search.js @@ -19,13 +19,12 @@ module.exports.simulateSearch = () => }) .execute(); -module.exports.simulatePagination = (perPage, page) => +module.exports.simulatePagination = async (perPage, page) => apiRoot .withProjectKey({ projectKey }) .products() .get({ - queryArgs: { - + queryArgs: { limit: perPage, offset: perPage * (page - 1), }, diff --git a/handson/store.js b/handson/store.js index 14f3769..7ea23a1 100644 --- a/handson/store.js +++ b/handson/store.js @@ -10,8 +10,26 @@ module.exports.getCustomersInStore = (storeKey) => .get() .execute(); +module.exports.createInSoreCart = (storeKey,customer) => + storeApiRoot + .withProjectKey({projectKey}) + .inStoreKeyWithStoreKeyValue({storeKey}) + .carts() + .post({ + body: { + currency: "EUR", + customerId: customer.body.id, + customerEmail: customer.body.email, + } + }) + .execute(); + //use me endpoint with another client module.exports.getMe = () => - myApiRoot.withProjectKey({ projectKey }).me().get().execute() + myApiRoot + .withProjectKey({ projectKey }) + .me() + .get() + .execute() diff --git a/package.json b/package.json index f8bc299..6a840d1 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@commercetools/sdk-middleware-http": "^6.1.0", "@commercetools/typescript-sdk": "^1.2.0", "chalk-animation": "^1.6.0", - "cli-highlight": "^2.1.4", + "cli-highlight": "^2.1.11", "csvtojson": "^2.0.10", "dotenv": "^8.2.0", "express": "^4.17.1", From 858f8e284ede798a3ef56b85fade7879e52857e9 Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Fri, 26 Nov 2021 09:18:11 -0500 Subject: [PATCH 07/18] updated paged optimized search --- Task06b_pagination.js | 16 +++++++++++----- handson/search.js | 8 +++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Task06b_pagination.js b/Task06b_pagination.js index 261c185..d1a2b87 100644 --- a/Task06b_pagination.js +++ b/Task06b_pagination.js @@ -2,17 +2,23 @@ const { simulatePagination } = require("./handson/search"); const { log } = require("./logger"); -var page = 1, perPage = 3, lastPage = false, products = null; +var perPage = 2, lastPage = false, products = null, lastId = null, where = null; const getPagedQueryResults = async _ => { while (!lastPage){ - products = await simulatePagination(perPage,page) - log("Showing results for page " + page) + where = lastId != null ? `id > "${lastId}"`: null; + products = await simulatePagination(perPage,where) + log("//////////////////") products.body.results.forEach(element => { log(element.id) }); - lastPage = (products.body.count < perPage)? true : false; - page++; + productCount = products.body.count; + if(productCount == perPage){ + lastId = products.body.results[productCount - 1].id; + } + else { + lastPage = true; + } } } diff --git a/handson/search.js b/handson/search.js index b504d98..d3f3eb6 100644 --- a/handson/search.js +++ b/handson/search.js @@ -19,14 +19,16 @@ module.exports.simulateSearch = () => }) .execute(); -module.exports.simulatePagination = async (perPage, page) => +module.exports.simulatePagination = async (perPage, where) => apiRoot .withProjectKey({ projectKey }) .products() .get({ - queryArgs: { + queryArgs: { + sort: "id asc", limit: perPage, - offset: perPage * (page - 1), + where: where, + withTotal: false }, }) .execute(); From 37a40cf5f05538c2329656c65bea4e6573d3c00e Mon Sep 17 00:00:00 2001 From: Fady Fawzy Date: Fri, 11 Feb 2022 14:05:17 +0100 Subject: [PATCH 08/18] product Selection exercise + @commercetools/sdk-client-v2 --- Task04b_checkout.js | 6 +- Task05_stores.js | 2 +- Task05b_product_selections.js | 16 +++++ handson/client.js | 55 +++++++++------- handson/order.js | 10 +-- handson/store.js | 63 ++++++++++++++++-- package.json | 27 ++++---- yarn.lock | 117 ++++++++++++++++++++++------------ 8 files changed, 205 insertions(+), 91 deletions(-) create mode 100644 Task05b_product_selections.js diff --git a/Task04b_checkout.js b/Task04b_checkout.js index d45be5d..d8de4dd 100644 --- a/Task04b_checkout.js +++ b/Task04b_checkout.js @@ -3,18 +3,18 @@ const { log } = require("./logger.js"); const cartDraftData = { currency: "EUR", - customerId: "10cb16bf-a5d8-4f47-b664-fe5cae2f75d0", + customerId: "349fdf7c-98af-47ad-bec9-58aaaeb176b6", countryCode: "DE", }; const paymentDraft = { - key:"testPayment-2", + key:"testPayment-44", amountPlanned:{ currencyCode:'EUR', centAmount:4200 }, customer:{ typeId:'customer', - id:'10cb16bf-a5d8-4f47-b664-fe5cae2f75d0' + id:'349fdf7c-98af-47ad-bec9-58aaaeb176b6' } } //checkout.createCart(cartDraftData).then(log).catch(log) diff --git a/Task05_stores.js b/Task05_stores.js index cc9fe80..337377a 100644 --- a/Task05_stores.js +++ b/Task05_stores.js @@ -1,6 +1,6 @@ const { getCustomersInStore, getMe } = require("./handson/store"); const { log } = require("./logger"); -getCustomersInStore('de-store').then(log).catch(log); +getCustomersInStore('berlin-store').then(log).catch(log); //getMe().then(log).catch(log); diff --git a/Task05b_product_selections.js b/Task05b_product_selections.js new file mode 100644 index 0000000..bd294e5 --- /dev/null +++ b/Task05b_product_selections.js @@ -0,0 +1,16 @@ +const { + getProductsInASelection, + addProductsToSelection, + getSelectionByKey, + getProductsInAStore, + getProductsInAStoreAdmin +} = require("./handson/store"); +const { log } = require("./logger"); + +//getSelectionByKey('ff-selection-1').then(log).catch(log); + +//addProductsToSelection('ff-selection-2',['garlic-press']).then(log).catch(log); + +//getProductsInASelection("ff-selection-2").then(log).catch(log); + +getProductsInAStore("berlin-store").then(log).catch(log); diff --git a/handson/client.js b/handson/client.js index 21c88de..751c34c 100644 --- a/handson/client.js +++ b/handson/client.js @@ -1,12 +1,20 @@ +// const { +// createAuthMiddlewareForClientCredentialsFlow, +// createAuthMiddlewareForPasswordFlow, +// } = require("@commercetools/sdk-middleware-auth"); +// const { createHttpMiddleware } = require("@commercetools/sdk-middleware-http"); +// const { createClient } = require("@commercetools/sdk-client"); +// const { +// createApiBuilderFromCtpClient, +// } = require("@commercetools/typescript-sdk"); + const { - createAuthMiddlewareForClientCredentialsFlow, - createAuthMiddlewareForPasswordFlow, -} = require("@commercetools/sdk-middleware-auth"); -const { createHttpMiddleware } = require("@commercetools/sdk-middleware-http"); -const { createClient } = require("@commercetools/sdk-client"); -const { - createApiBuilderFromCtpClient, -} = require("@commercetools/typescript-sdk"); + createClient, + createHttpClient, + createAuthForClientCredentialsFlow, + createAuthForPasswordFlow +} = require ('@commercetools/sdk-client-v2') +const { createApiBuilderFromCtpClient } = require('@commercetools/platform-sdk') const { createApiBuilderFromCtpClient: createApiBuilderFromCtpClientOnlyForImports, @@ -15,20 +23,20 @@ require("dotenv").config(); const fetch = require("node-fetch"); -const projectKey = "training-fady-24-7"; +const projectKey = process.env.CTP_PROJECT_KEY; const getClient = () => { - const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({ + const authMiddleware = createAuthForClientCredentialsFlow({ host: "https://auth.europe-west1.gcp.commercetools.com", projectKey, credentials: { - clientId: process.env.adminClientId, - clientSecret: process.env.adminClientSecret, + clientId: process.env.CTP_CLIENT_ID, + clientSecret: process.env.CTP_CLIENT_SECRET, }, fetch, }); - const httpMiddleware = createHttpMiddleware({ + const httpMiddleware = createHttpClient({ host: "https://api.europe-west1.gcp.commercetools.com", fetch, }); @@ -40,17 +48,17 @@ const getClient = () => { }; const getImportClient = () => { - const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({ + const authMiddleware = createAuthForClientCredentialsFlow({ host: "https://auth.europe-west1.gcp.commercetools.com", projectKey, credentials: { - clientId: process.env.importClientId, - clientSecret: process.env.importClientSecret, + clientId: process.env.CTP_CLIENT_ID, + clientSecret: process.env.CTP_CLIENT_SECRET, }, fetch, }); - const httpMiddleware = createHttpMiddleware({ + const httpMiddleware = createHttpClient({ host: "https://import.europe-west1.gcp.commercetools.com", fetch, }); @@ -62,17 +70,17 @@ const getImportClient = () => { }; const getStoreClient = () => { - const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({ + const authMiddleware = createAuthForClientCredentialsFlow({ host: "https://auth.europe-west1.gcp.commercetools.com", projectKey, credentials: { - clientId: process.env.storeClientId, - clientSecret: process.env.storeClientSecret, + clientId: process.env.CTP_STORE_ID2, + clientSecret: process.env.CTP_STORE_SECRET2, }, fetch, }); - const httpMiddleware = createHttpMiddleware({ + const httpMiddleware = createHttpClient({ host: "https://api.europe-west1.gcp.commercetools.com", fetch, }); @@ -83,10 +91,9 @@ const getStoreClient = () => { return ctpClient; }; -const getMLClient = () => {}; const getMyAPIClient = () => { - const authMiddleware = createAuthMiddlewareForPasswordFlow({ + const authMiddleware = createAuthForPasswordFlow({ host: "https://auth.europe-west1.gcp.commercetools.com", projectKey, credentials: { @@ -99,7 +106,7 @@ const getMyAPIClient = () => { }, fetch, }); - const httpMiddleware = createHttpMiddleware({ + const httpMiddleware = createHttpClient({ host: "https://api.europe-west1.gcp.commercetools.com", fetch, }); diff --git a/handson/order.js b/handson/order.js index 0b0ff40..dc8df90 100644 --- a/handson/order.js +++ b/handson/order.js @@ -32,7 +32,7 @@ module.exports.getCartById = (ID) => apiRoot.withProjectKey({ projectKey }).carts().withId({ ID }).get().execute(); module.exports.addLineItemsToCart = (arrayOfSKUs, cartId) => { - return getCartById(cartId).then((cart) => { + return this.getCartById(cartId).then((cart) => { let updateActions = []; arrayOfSKUs.forEach((sku) => { updateActions.push({ @@ -57,7 +57,7 @@ module.exports.addLineItemsToCart = (arrayOfSKUs, cartId) => { }; module.exports.addDiscountCodeToCart = (discountCode, cartId) => { - return getCartById(cartId).then((cart) => { + return this.getCartById(cartId).then((cart) => { let updateActions = [ { action: "addDiscountCode", @@ -93,7 +93,7 @@ module.exports.createOrderFromCart = (cartId) => { }; const createOrderFromCartDraft = (cartId) => { - return getCartById(cartId).then((cart) => { + return this.getCartById(cartId).then((cart) => { return { id: cart.body.id, version: cart.body.version, @@ -143,7 +143,7 @@ module.exports.createPayment = (paymentDraft) => .execute(); module.exports.setOrderState = (stateName, orderId) => { - return getOrderById(orderId).then((order) => { + return this.getOrderById(orderId).then((order) => { const updateActions = [ { action: "changeOrderState", @@ -165,7 +165,7 @@ module.exports.setOrderState = (stateName, orderId) => { }; module.exports.addPaymentToOrder = (paymentId, orderId) => { - return getOrderById(orderId).then((order) => { + return this.getOrderById(orderId).then((order) => { const updateActions = [ { action: "addPayment", diff --git a/handson/store.js b/handson/store.js index 14f3769..4e82a43 100644 --- a/handson/store.js +++ b/handson/store.js @@ -1,4 +1,4 @@ -const { storeApiRoot, myApiRoot, projectKey } = require("./client.js"); +const { apiRoot, storeApiRoot, myApiRoot, projectKey } = require("./client.js"); //TODO store and me endpoint @@ -10,8 +10,63 @@ module.exports.getCustomersInStore = (storeKey) => .get() .execute(); +module.exports.getSelectionByKey = (key) => + apiRoot + .withProjectKey({ projectKey }) + .productSelections() + .withKey({ key }) + .get() + .execute(); + +module.exports.addProductsToSelection = async ( + selectionKey, + arrayOfProductKeys +) => { + const prdoductSelection = await this.getSelectionByKey(selectionKey); + const actions = arrayOfProductKeys.map((key) => { + return { + action: "addProduct", + product: { + typeId: "product", + key, + }, + }; + }); + return apiRoot + .withProjectKey({ projectKey }) + .productSelections() + .withKey({ key: selectionKey }) + .post({ + body: { + version: prdoductSelection.body.version, + actions, + }, + }) + .execute(); +}; + +module.exports.getProductsInASelection = (selectionKey) => + apiRoot + .withProjectKey({ projectKey }) + .productSelections() + .withKey({ key: selectionKey }) + .products() + .get({ + queryArgs:{ + expand:'product' + } + }) + .execute(); + +module.exports.getProductsInAStore = (storeKey) => + storeApiRoot + .withProjectKey({ projectKey }) + .inStoreKeyWithStoreKeyValue({ storeKey }) + .productSelectionAssignments() + .get() + .execute(); + + //use me endpoint with another client module.exports.getMe = () => - myApiRoot.withProjectKey({ projectKey }).me().get().execute() - - + myApiRoot.withProjectKey({ projectKey }).me().get().execute(); diff --git a/package.json b/package.json index 6f5aeb7..38ffa6b 100644 --- a/package.json +++ b/package.json @@ -7,24 +7,21 @@ "1": "node Task01_project_setup.js", "2": "node Task02_customers.js", "3": "node Task03_import_sync_products.js", + "5": "node Task05_stores.js", + "5b": "node Task05b_product_selections.js", + "7": "node Task07_extensions.js", + "8": "node Task08_subscriptions.js", "4a": "node Task04a_states.js", "4b": "node Task04b_checkout.js", "4c": "node Task04c_merging.js", - "5": "node Task05_stores.js", "6a": "node Task06a_search.js", "6b": "node Task06b_pagination.js", - "6c": "node Task06c_graphql.js", - "7": "node Task07_extensions.js", - "8": "node Task08_subscriptions.js" + "6c": "node Task06c_graphql.js" }, "dependencies": { - "@commercetools/api-request-builder": "^5.6.3", "@commercetools/importapi-sdk": "^1.3.0", - "@commercetools/sdk-auth": "^3.0.9", - "@commercetools/sdk-client": "^2.1.2", - "@commercetools/sdk-middleware-auth": "^6.1.4", - "@commercetools/sdk-middleware-http": "^6.0.8", - "@commercetools/typescript-sdk": "^1.2.0", + "@commercetools/platform-sdk": "^2.4.1", + "@commercetools/sdk-client-v2": "^1.1.0", "chalk-animation": "^1.6.0", "cli-highlight": "^2.1.4", "csvtojson": "^2.0.10", @@ -33,10 +30,10 @@ "node-fetch": "^2.6.1" }, "resolutions": { - "csvtojson/**/lodash":"^4.17.21", - "cli-highlight/**/y18n":"^5.0.5", - "chalk-animation/**/hosted-git-info":"^2.8.9", - "chalk-animation/**/path-parse":"1.0.7", - "chalk-animation/**/trim-newlines":"4.0.1" + "csvtojson/**/lodash": "^4.17.21", + "cli-highlight/**/y18n": "^5.0.5", + "chalk-animation/**/hosted-git-info": "^2.8.9", + "chalk-animation/**/path-parse": "1.0.7", + "chalk-animation/**/trim-newlines": "4.0.1" } } diff --git a/yarn.lock b/yarn.lock index 3457f55..66d5474 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,46 +2,47 @@ # yarn lockfile v1 -"@commercetools/api-request-builder@^5.6.3": - version "5.6.3" - resolved "https://registry.yarnpkg.com/@commercetools/api-request-builder/-/api-request-builder-5.6.3.tgz#d87c4961fec95a9186dd59fcd0256ea56cd89772" - integrity sha512-Oazb2Exuc4RR+p86m1xFkruQscX/hakejCSiUrxOmeqMKY5CBeFXXVAlfpDTjxgZ0nXgkPWGWye1FHCXlSRLOw== - "@commercetools/importapi-sdk@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-1.3.0.tgz#907498892300d104569b2114da5380bfc3d17eb3" integrity sha512-IPKubLllEqtys8mEpOWZ1HyIe+vLYt5v9TFLLc0uXGdbO7tvu5ybvMU0jo+nkDH9B4RWGRvzfTdXzX96J5YyBw== -"@commercetools/sdk-auth@^3.0.9": - version "3.0.9" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-auth/-/sdk-auth-3.0.9.tgz#4cbee3e9729bc50ef42a080c1fd2a15efa7f2019" - integrity sha512-j7KYF5a2JTdfsONONE8NsHzFRqz40OTsPTS/GDyjnrDFvCT6gez665pheMS5ASRz/CjltrA+z5ucYFd4iaXxEg== +"@commercetools/platform-sdk@^2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@commercetools/platform-sdk/-/platform-sdk-2.4.1.tgz#cba87b3a9086bc11f811c6415935394c476ece7d" + integrity sha512-s6ppnIiw0fVcFyZ96yPTU2pKi4MtWG2nUWYPDKY+cjmm8rGSg5OfMsUNaY4wbO1IHWdY+XNliCon5HJTov14LQ== dependencies: - "@commercetools/sdk-middleware-http" "^6.0.8" - lodash.defaultsdeep "^4.6.0" - qss "2.0.3" + "@commercetools/sdk-client-v2" "^1.1.0" + "@commercetools/sdk-middleware-auth" "^6.0.4" + "@commercetools/sdk-middleware-http" "^6.0.4" + "@commercetools/sdk-middleware-logger" "^2.1.1" + querystring "^0.2.1" -"@commercetools/sdk-client@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-client/-/sdk-client-2.1.2.tgz#fe1e442f67a385f103470669784c0fa20d7a2314" - integrity sha512-YPpK39pkjfedjS1/BFg2d7CrvTeN7vIS5vfiqEkKOtAoUxiNkugv59gRSoh2Em8SOccxyM/skpgHyTqfmJzXug== +"@commercetools/sdk-client-v2@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-client-v2/-/sdk-client-v2-1.1.0.tgz#658e60f4a8a37465b2f29236e077af1a60887d34" + integrity sha512-5pZu/bIPKPoqPMLsUSYP2YgxBuAuY3kGB2rCWEel1HYyxfUDrFJqkOJnbIDE9PriEEIyLUa0vRJOc2ceIIvQIQ== + dependencies: + buffer "^6.0.3" + node-fetch "^2.6.1" + querystring "^0.2.1" -"@commercetools/sdk-middleware-auth@^6.1.4": - version "6.1.4" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.1.4.tgz#c5f464ae1627336715681e4590b63777e034c890" - integrity sha512-49R1DWsA+pNHH7/2K6QU5wnJSXabljKA8dvzs5HcbLwutlDp3Io0XHgIJa9qpfYhgW6k0h9dPICcLbESrQBXYw== +"@commercetools/sdk-middleware-auth@^6.0.4": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.2.1.tgz#bac3324bbedda004fc848167abe9b90abe0d6e85" + integrity sha512-JNVRVf7zssECg0i/amAG0gnFmx4Kj7rB0J9MfRlvN/54qyA6tKJOJaA5j9hYy60qKSW/NCGbVMcVlBnPJLhREQ== dependencies: - node-fetch "^2.3.0" + node-fetch "^2.6.7" -"@commercetools/sdk-middleware-http@^6.0.8": - version "6.0.8" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.0.8.tgz#15e2cc2eb9b12d2913061cb4c7f770d6d03b0166" - integrity sha512-o1y96K5sZ5zOpHqesZt8I14SZMrZchDIOAv2pc3DDJwqguxEBvQMqAE7pwBySH/CLayrC8z6pfljPNFEMQNXGQ== +"@commercetools/sdk-middleware-http@^6.0.4": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.1.1.tgz#6f8b1eee63c195062984e2037182f88f63324deb" + integrity sha512-wycP1vSoD99dtD3NVVQF5VUrfiXIxKIbuYb3sU/+EHmHzgCXIfI4NditL+45Qr7sb6qmUYVFyPWjHfZINBqfUg== -"@commercetools/typescript-sdk@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@commercetools/typescript-sdk/-/typescript-sdk-1.2.0.tgz#fb991ac37ebc1bd16613d16873bbaf784a993afd" - integrity sha512-DrnIR3JdWyJppZL4o0a9a6C3tBOG0DcW+P0SMreQo1Ir5SxmeMN1UtoNXmgtzaBB9M53IaY5DVW4aKS3PyA9qw== +"@commercetools/sdk-middleware-logger@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-logger/-/sdk-middleware-logger-2.1.1.tgz#9283fdc8c403a7e2d4d06637e6015770b864e64a" + integrity sha512-k/Jm3lsWbszPBHtPAvu0rINTq398p4ddv0zbAH8R4p6Yc1GkBEy6tNgHPzX/eFskI/qerPy9IsW1xK8pqgtHHQ== "@types/color-name@^1.1.1": version "1.1.1" @@ -101,6 +102,11 @@ arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + bluebird@^3.5.1: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -122,6 +128,14 @@ body-parser@1.19.0: raw-body "2.4.0" type-is "~1.6.17" +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + bytes@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" @@ -468,6 +482,11 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" @@ -538,11 +557,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.defaultsdeep@^4.6.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6" - integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA== - lodash@^4.17.21, lodash@^4.17.3: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -650,11 +664,18 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -node-fetch@^2.3.0, node-fetch@^2.6.1: +node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-fetch@^2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -785,10 +806,10 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== -qss@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/qss/-/qss-2.0.3.tgz#630b38b120931b52d04704f3abfb0f861604a9ec" - integrity sha512-j48ZBT5IZbSqJiSU8EX4XrN8nXiflHvmMvv2XpFc31gh7n6EpSs75bNr6+oj3FOLWyT8m09pTmqLNl34L7/uPQ== +querystring@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" + integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== quick-lru@^1.0.0: version "1.1.0" @@ -1021,6 +1042,11 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + trim-newlines@4.0.1, trim-newlines@^2.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-4.0.1.tgz#caa1a0c92e86282c9cc8485ccd3ee5a6a4fbd958" @@ -1057,6 +1083,19 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" From fdd3a9e572587a2d0919b8daef68ff5bd57afd75 Mon Sep 17 00:00:00 2001 From: Fady Fawzy Date: Fri, 11 Feb 2022 14:11:07 +0100 Subject: [PATCH 09/18] . --- yarn.lock | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7a8d797..ee7ba5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,6 @@ # yarn lockfile v1 -<<<<<<< HEAD "@commercetools/importapi-sdk@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-1.3.0.tgz#907498892300d104569b2114da5380bfc3d17eb3" @@ -14,24 +13,10 @@ integrity sha512-s6ppnIiw0fVcFyZ96yPTU2pKi4MtWG2nUWYPDKY+cjmm8rGSg5OfMsUNaY4wbO1IHWdY+XNliCon5HJTov14LQ== dependencies: "@commercetools/sdk-client-v2" "^1.1.0" -======= -"@commercetools/api-request-builder@^5.6.3": - version "5.6.3" - resolved "https://registry.yarnpkg.com/@commercetools/api-request-builder/-/api-request-builder-5.6.3.tgz#d87c4961fec95a9186dd59fcd0256ea56cd89772" - integrity sha512-Oazb2Exuc4RR+p86m1xFkruQscX/hakejCSiUrxOmeqMKY5CBeFXXVAlfpDTjxgZ0nXgkPWGWye1FHCXlSRLOw== - -"@commercetools/importapi-sdk@^1.20.0": - version "1.20.0" - resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-1.20.0.tgz#6a0f068ff655cf6a3bf25fcaa766e9616e11ae9d" - integrity sha512-vskmvv7HgoMDorQzla3Y/tRD4qHbX0r3AJo6mdaNN9QlDkIeMH8srf94nykyWtdl3+uzqs6OJkfdo2dVw+RXvw== - dependencies: - "@commercetools/sdk-client" "^2.1.1" ->>>>>>> 858f8e284ede798a3ef56b85fade7879e52857e9 "@commercetools/sdk-middleware-auth" "^6.0.4" "@commercetools/sdk-middleware-http" "^6.0.4" "@commercetools/sdk-middleware-logger" "^2.1.1" querystring "^0.2.1" -<<<<<<< HEAD "@commercetools/sdk-client-v2@^1.1.0": version "1.1.0" @@ -46,46 +31,13 @@ version "6.2.1" resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.2.1.tgz#bac3324bbedda004fc848167abe9b90abe0d6e85" integrity sha512-JNVRVf7zssECg0i/amAG0gnFmx4Kj7rB0J9MfRlvN/54qyA6tKJOJaA5j9hYy60qKSW/NCGbVMcVlBnPJLhREQ== -======= - -"@commercetools/sdk-auth@^3.0.12": - version "3.0.12" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-auth/-/sdk-auth-3.0.12.tgz#6b6930f697f2311beeb909677df08bd5c7f523b8" - integrity sha512-t7F71oNK+A23hLGzlEYnjTtqhxDUFST8f4l9YAf7mmVCA9Qeu668pDvJ/kf5gVLMQVazEQM8Vjy4JyyeQctEkQ== - dependencies: - "@commercetools/sdk-middleware-http" "^6.0.11" - lodash.defaultsdeep "^4.6.0" - qss "2.0.3" - -"@commercetools/sdk-client@^2.1.1", "@commercetools/sdk-client@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-client/-/sdk-client-2.1.2.tgz#fe1e442f67a385f103470669784c0fa20d7a2314" - integrity sha512-YPpK39pkjfedjS1/BFg2d7CrvTeN7vIS5vfiqEkKOtAoUxiNkugv59gRSoh2Em8SOccxyM/skpgHyTqfmJzXug== - -"@commercetools/sdk-middleware-auth@^6.0.4", "@commercetools/sdk-middleware-auth@^6.1.4": - version "6.1.4" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.1.4.tgz#c5f464ae1627336715681e4590b63777e034c890" - integrity sha512-49R1DWsA+pNHH7/2K6QU5wnJSXabljKA8dvzs5HcbLwutlDp3Io0XHgIJa9qpfYhgW6k0h9dPICcLbESrQBXYw== ->>>>>>> 858f8e284ede798a3ef56b85fade7879e52857e9 dependencies: node-fetch "^2.6.7" -<<<<<<< HEAD "@commercetools/sdk-middleware-http@^6.0.4": version "6.1.1" resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.1.1.tgz#6f8b1eee63c195062984e2037182f88f63324deb" integrity sha512-wycP1vSoD99dtD3NVVQF5VUrfiXIxKIbuYb3sU/+EHmHzgCXIfI4NditL+45Qr7sb6qmUYVFyPWjHfZINBqfUg== -======= -"@commercetools/sdk-middleware-http@^6.0.11", "@commercetools/sdk-middleware-http@^6.0.4", "@commercetools/sdk-middleware-http@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.1.0.tgz#e4aebc0a4865dab00cd986449d7b395dc86fe124" - integrity sha512-j/k66riaQv50Y3iK0CLJglHh56id7PfxGIDyL0PjlLSkQe2TPVGFnM//CZAQ8a6fHT9adQYLxDMYqlb1nWEDZw== - -"@commercetools/sdk-middleware-logger@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-logger/-/sdk-middleware-logger-2.1.1.tgz#9283fdc8c403a7e2d4d06637e6015770b864e64a" - integrity sha512-k/Jm3lsWbszPBHtPAvu0rINTq398p4ddv0zbAH8R4p6Yc1GkBEy6tNgHPzX/eFskI/qerPy9IsW1xK8pqgtHHQ== ->>>>>>> 858f8e284ede798a3ef56b85fade7879e52857e9 "@commercetools/sdk-middleware-logger@^2.1.1": version "2.1.1" From a7340df46d3425a0c92d0f7b5d66712dd0b5b54d Mon Sep 17 00:00:00 2001 From: Fady Fawzy Date: Fri, 11 Feb 2022 14:49:37 +0100 Subject: [PATCH 10/18] Update client.js --- handson/client.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/handson/client.js b/handson/client.js index 4b74e96..6ef40e7 100644 --- a/handson/client.js +++ b/handson/client.js @@ -1,13 +1,3 @@ -// const { -// createAuthMiddlewareForClientCredentialsFlow, -// createAuthMiddlewareForPasswordFlow, -// } = require("@commercetools/sdk-middleware-auth"); -// const { createHttpMiddleware } = require("@commercetools/sdk-middleware-http"); -// const { createClient } = require("@commercetools/sdk-client"); -// const { -// createApiBuilderFromCtpClient, -// } = require("@commercetools/typescript-sdk"); - const { createClient, createHttpClient, @@ -126,4 +116,4 @@ module.exports.importApiRoot = createApiBuilderFromCtpClientOnlyForImports( module.exports.storeApiRoot = createApiBuilderFromCtpClient(getStoreClient()); module.exports.myApiRoot = createApiBuilderFromCtpClient(getMyAPIClient()); -module.exports.projectKey = projectKey; \ No newline at end of file +module.exports.projectKey = projectKey; From bd402e513ee68cedb82e04edc87c0f660b6be182 Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Fri, 4 Mar 2022 12:34:36 -0500 Subject: [PATCH 11/18] updated product selections --- Task05_stores.js | 11 ---- Task05a_stores.js | 11 ++++ Task05b_product_selections.js | 26 ++++++---- Task05c_my.js | 8 +++ handson/client.js | 28 +++++----- handson/my.js | 17 +++++++ handson/productSelections.js | 61 ++++++++++++++++++++++ handson/store.js | 96 +++++++++++++---------------------- package.json | 3 +- 9 files changed, 166 insertions(+), 95 deletions(-) delete mode 100644 Task05_stores.js create mode 100644 Task05a_stores.js create mode 100644 Task05c_my.js create mode 100644 handson/my.js create mode 100644 handson/productSelections.js diff --git a/Task05_stores.js b/Task05_stores.js deleted file mode 100644 index f18d7a4..0000000 --- a/Task05_stores.js +++ /dev/null @@ -1,11 +0,0 @@ -const { getCustomersInStore, createInSoreCart, getMe } = require("./handson/store"); -const { getCustomerByKey } = require("./handson/customer"); -const { log } = require("./logger"); - -getCustomersInStore('berlin-store').then(log).catch(log); - -//getCustomerByKey("nage1223").then((customer) => { -// createInSoreCart("berlin-store",customer).then(log).catch(log); -//}).catch(log); - -//getMe().then(log).catch(log); diff --git a/Task05a_stores.js b/Task05a_stores.js new file mode 100644 index 0000000..585440b --- /dev/null +++ b/Task05a_stores.js @@ -0,0 +1,11 @@ +const {getStoreByKey, getCustomersInStore, createInStoreCart } = require("./handson/store"); +const { getCustomerByKey } = require("./handson/customer"); +const { log } = require("./logger"); + +getStoreByKey('berlin-store').then(log).catch(log); + +// getCustomersInStore('berlin-store').then(log).catch(log); + +// getCustomerByKey("nage1223").then((customer) => { +// createInStoreCart("berlin-store",customer).then(log).catch(log); +// }).catch(log); diff --git a/Task05b_product_selections.js b/Task05b_product_selections.js index bd294e5..ba94550 100644 --- a/Task05b_product_selections.js +++ b/Task05b_product_selections.js @@ -1,16 +1,24 @@ const { - getProductsInASelection, - addProductsToSelection, - getSelectionByKey, - getProductsInAStore, - getProductsInAStoreAdmin + getProductsInStore, + addProductSelectionToStore } = require("./handson/store"); +const { + getProductSelectionByKey, + createProductSelection, + addProductsToProductSelection, + getProductsInProductSelection +} = require("./handson/productSelections"); + const { log } = require("./logger"); -//getSelectionByKey('ff-selection-1').then(log).catch(log); +// createProductSelection("berlin-store-selection","Berlin Store Selection").then(log).catch(log); + +// getProductSelectionByKey('berlin-store-selection').then(log).catch(log); + +// addProductsToProductSelection('berlin-store-selection',['tulip-seed-product']).then(log).catch(log); -//addProductsToSelection('ff-selection-2',['garlic-press']).then(log).catch(log); +// addProductSelectionToStore("berlin-store","berlin-store-selection").then(log).catch(log); -//getProductsInASelection("ff-selection-2").then(log).catch(log); +// getProductsInProductSelection("berlin-store-selection").then(log).catch(log); -getProductsInAStore("berlin-store").then(log).catch(log); +getProductsInStore("berlin-store").then(log).catch(log); diff --git a/Task05c_my.js b/Task05c_my.js new file mode 100644 index 0000000..fff55a4 --- /dev/null +++ b/Task05c_my.js @@ -0,0 +1,8 @@ +const {getMe, getMyOrders } = require("./handson/my"); +const { log } = require("./logger"); + +// TODO: SPA api-client + +// getMe().then(log).catch(log); + +getMyOrders().then(log).catch(log); diff --git a/handson/client.js b/handson/client.js index 6ef40e7..ad30454 100644 --- a/handson/client.js +++ b/handson/client.js @@ -17,7 +17,7 @@ const projectKey = process.env.CTP_PROJECT_KEY; const getClient = () => { const authMiddleware = createAuthForClientCredentialsFlow({ - host: "https://auth.europe-west1.gcp.commercetools.com", + host: process.env.CTP_AUTH_URL, projectKey, credentials: { clientId: process.env.CTP_CLIENT_ID, @@ -27,7 +27,7 @@ const getClient = () => { }); const httpMiddleware = createHttpClient({ - host: "https://api.europe-west1.gcp.commercetools.com", + host: process.env.CTP_API_URL, fetch, }); @@ -39,17 +39,17 @@ const getClient = () => { const getImportClient = () => { const authMiddleware = createAuthForClientCredentialsFlow({ - host: "https://auth.europe-west1.gcp.commercetools.com", + host: process.env.IMPORT_AUTH_URL, projectKey, credentials: { - clientId: process.env.CTP_CLIENT_ID, - clientSecret: process.env.CTP_CLIENT_SECRET, + clientId: process.env.IMPORT_CLIENT_ID, + clientSecret: process.env.IMPORT_CLIENT_SECRET, }, fetch, }); const httpMiddleware = createHttpClient({ - host: "https://import.europe-west1.gcp.commercetools.com", + host: process.env.IMPORT_API_URL, fetch, }); @@ -61,17 +61,17 @@ const getImportClient = () => { const getStoreClient = () => { const authMiddleware = createAuthForClientCredentialsFlow({ - host: "https://auth.europe-west1.gcp.commercetools.com", + host: process.env.STORE_AUTH_URL, projectKey, credentials: { - clientId: process.env.CTP_STORE_ID2, - clientSecret: process.env.CTP_STORE_SECRET2, + clientId: process.env.STORE_CLIENT_ID, + clientSecret: process.env.STORE_CLIENT_SECRET, }, fetch, }); const httpMiddleware = createHttpClient({ - host: "https://api.europe-west1.gcp.commercetools.com", + host: process.env.STORE_API_URL, fetch, }); @@ -84,20 +84,20 @@ const getStoreClient = () => { const getMyAPIClient = () => { const authMiddleware = createAuthForPasswordFlow({ - host: "https://auth.europe-west1.gcp.commercetools.com", + host: process.env.ME_AUTH_URL, projectKey, credentials: { clientId: process.env.ME_CLIENT_ID, clientSecret: process.env.ME_CLIENT_SECRET, user: { - username: "fafa2@example.com", - password: "123", + username: "nage@test.com", + password: "password", }, }, fetch, }); const httpMiddleware = createHttpClient({ - host: "https://api.europe-west1.gcp.commercetools.com", + host: process.env.ME_API_URL, fetch, }); diff --git a/handson/my.js b/handson/my.js new file mode 100644 index 0000000..f41b296 --- /dev/null +++ b/handson/my.js @@ -0,0 +1,17 @@ +const { myApiRoot, projectKey } = require("./client.js"); + +//TODO me endpoint + + +module.exports.getMe = () => + myApiRoot.withProjectKey({ projectKey }) + .me() + .get() + .execute(); + + module.exports.getMyOrders = () => + myApiRoot.withProjectKey({ projectKey }) + .me() + .orders() + .get() + .execute(); \ No newline at end of file diff --git a/handson/productSelections.js b/handson/productSelections.js new file mode 100644 index 0000000..f484be8 --- /dev/null +++ b/handson/productSelections.js @@ -0,0 +1,61 @@ +const { apiRoot, projectKey } = require("./client.js"); + +//TODO Product Selections + +module.exports.getProductSelectionByKey = (key) => + apiRoot.withProjectKey({ projectKey }) + .productSelections() + .withKey({ key }) + .get() + .execute(); + +module.exports.createProductSelection = (key,name) => + apiRoot.withProjectKey({ projectKey }) + .productSelections() + .post({ + body: { + key: key, + name: {"en":name} + } + } + ) + .execute(); + +module.exports.addProductsToProductSelection = async ( + productSelectionKey, + arrayOfProductKeys +) => { + const prdoductSelection = await this.getProductSelectionByKey(productSelectionKey); + const actions = arrayOfProductKeys.map((key) => { + return { + action: "addProduct", + product: { + typeId: "product", + key, + }, + }; + }); + return apiRoot.withProjectKey({ projectKey }) + .productSelections() + .withKey({ key: productSelectionKey }) + .post({ + body: { + version: prdoductSelection.body.version, + actions, + }, + }) + .execute(); +}; + +module.exports.getProductsInProductSelection = (productSelectionKey) => + apiRoot.withProjectKey({ projectKey }) + .productSelections() + .withKey({ key: productSelectionKey }) + .products() + .get({ + queryArgs:{ + expand:'product' + } + }) + .execute(); + diff --git a/handson/store.js b/handson/store.js index 3fcaad9..967d1a2 100644 --- a/handson/store.js +++ b/handson/store.js @@ -1,79 +1,55 @@ -const { apiRoot, storeApiRoot, myApiRoot, projectKey } = require("./client.js"); +const { apiRoot, storeApiRoot, projectKey } = require("./client.js"); -//TODO store and me endpoint +//TODO store and productProjection endpoint -module.exports.getCustomersInStore = (storeKey) => - storeApiRoot - .withProjectKey({ projectKey }) - .inStoreKeyWithStoreKeyValue({ storeKey }) - .customers() +module.exports.getStoreByKey = (key) => + apiRoot.withProjectKey({projectKey}) + .stores() + .withKey({key}) .get() .execute(); -module.exports.getSelectionByKey = (key) => - apiRoot - .withProjectKey({ projectKey }) - .productSelections() - .withKey({ key }) +module.exports.getCustomersInStore = (storeKey) => + storeApiRoot.withProjectKey({ projectKey }) + .inStoreKeyWithStoreKeyValue({ storeKey }) + .customers() .get() .execute(); -module.exports.addProductsToSelection = async ( - selectionKey, - arrayOfProductKeys -) => { - const prdoductSelection = await this.getSelectionByKey(selectionKey); - const actions = arrayOfProductKeys.map((key) => { - return { - action: "addProduct", - product: { - typeId: "product", - key, - }, - }; - }); - return apiRoot - .withProjectKey({ projectKey }) - .productSelections() - .withKey({ key: selectionKey }) - .post({ - body: { - version: prdoductSelection.body.version, - actions, - }, - }) - .execute(); -}; +module.exports.addProductSelectionToStore = async (storeKey, productSelectionKey) => { + const store = await this.getStoreByKey(storeKey); -module.exports.getProductsInASelection = (selectionKey) => - apiRoot - .withProjectKey({ projectKey }) - .productSelections() - .withKey({ key: selectionKey }) - .products() - .get({ - queryArgs:{ - expand:'product' - } - }) + return apiRoot.withProjectKey({projectKey}) + .stores() + .withKey({key: storeKey}) + .post( + {body: { + version: store.body.version, + actions: [ + { + action: "setProductSelections", + productSelections: [ + { + productSelection: {key: productSelectionKey}, + active: true + } + ] + } + ] + }} + ) .execute(); +} -module.exports.getProductsInAStore = (storeKey) => - storeApiRoot - .withProjectKey({ projectKey }) +module.exports.getProductsInStore = (storeKey) => + apiRoot.withProjectKey({ projectKey }) .inStoreKeyWithStoreKeyValue({ storeKey }) .productSelectionAssignments() .get() .execute(); - -//use me endpoint with another client -module.exports.getMe = () => - myApiRoot.withProjectKey({ projectKey }).me().get().execute(); - -module.exports.createInStoreCart = (storeKey,customer) => - storeApiRoot - .withProjectKey({projectKey}) +module.exports.createInStoreCart = (storeKey, customer) => + storeApiRoot.withProjectKey({projectKey}) .inStoreKeyWithStoreKeyValue({storeKey}) .carts() .post({ diff --git a/package.json b/package.json index 4d0ba77..ddd83b7 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "4a": "node Task04a_states.js", "4b": "node Task04b_checkout.js", "4c": "node Task04c_merging.js", - "5": "node Task05_stores.js", + "5a": "node Task05a_stores.js", "5b": "node Task05b_product_selections.js", + "5c": "node Task05c_my.js", "6a": "node Task06a_search.js", "6b": "node Task06b_pagination.js", "6c": "node Task06c_graphql.js", From 61a8fb978a1b7ec8e4f40f8c0f57700c2a5182d7 Mon Sep 17 00:00:00 2001 From: Sevtap Fernengel <92039320+sfernengel@users.noreply.github.com> Date: Mon, 14 Mar 2022 20:38:23 +0100 Subject: [PATCH 12/18] Remove unnecessary createCustomerDraftKey --- handson/customer.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/handson/customer.js b/handson/customer.js index 6de1038..b27e56f 100644 --- a/handson/customer.js +++ b/handson/customer.js @@ -49,8 +49,6 @@ module.exports.createCustomer = (customerData) => }) .execute(); -const createCustomerDraftKey = (customerData) => {}; - module.exports.createCustomerKeyVerfiedEmail = (customerData) => apiRoot .withProjectKey({ projectKey }) @@ -58,7 +56,6 @@ module.exports.createCustomerKeyVerfiedEmail = (customerData) => .post({ body: { ...createCustomerDraft(customerData), - ...createCustomerDraftKey(customerData), isEmailVerified: true, }, }) From 952f98af6643a53610f2739f22010cfc26944c4f Mon Sep 17 00:00:00 2001 From: Sevtap Fernengel <92039320+sfernengel@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:53:45 +0100 Subject: [PATCH 13/18] Update importService.js Project uses de and en as languages CSV file column name is productDescription --- handson/importService.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/handson/importService.js b/handson/importService.js index e2ac4d1..e37465f 100644 --- a/handson/importService.js +++ b/handson/importService.js @@ -57,17 +57,17 @@ const getProductDraftsArray = () => { productDraftsArray.push({ key: participantNamePrefix + "-" + product.productName, name: { - "de-DE": product.productName, + "de": product.productName, }, productType: { typeId: "product-type", key: product.productType, }, slug: { - "de-DE": participantNamePrefix + "-" + product.productName, + "de": participantNamePrefix + "-" + product.productName, }, description: { - "de-DE": product.description, + "de": product.productDescription, }, masterVariant: { sku: product.inventoryId, From 5fc0fb2b89569b771e5db31f7ed55bef733e9f00 Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Sun, 20 Mar 2022 15:54:31 -0400 Subject: [PATCH 14/18] updated states task --- Task04a_states.js | 27 +++++++++++++++++++++++---- handson/customer.js | 2 -- handson/states.js | 12 ++++++------ 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/Task04a_states.js b/Task04a_states.js index 8088a3b..6a8f9c8 100644 --- a/Task04a_states.js +++ b/Task04a_states.js @@ -1,7 +1,17 @@ const states = require("./handson/states"); const { log } = require("./logger.js"); -const stateDraftData = { +const orderPackedStateDraft = { + key: "ff-order-packed", + type: "OrderState", + name: { + "de": "FF Order Packed ", + "en": "FF Order Packed ", + }, + initial: true, +}; + +const orderCompletedStateDraft = { key: "ff-order-completed", type: "OrderState", name: { @@ -11,8 +21,17 @@ const stateDraftData = { initial: false, }; -//states.createNewState(stateDraftData).then(log).catch(log) +const createStatesWithTransitions = async () => { + let orderPackedState = await states.createNewState(orderPackedStateDraft) + let orderCompletedState = await states.createNewState(orderCompletedStateDraft) + + orderPackedState = states.addTransition(orderPackedState.body.id, [orderCompletedState.body.id]) + + orderCompletedState = states.addTransition(orderCompletedState.body.id, []) + + return orderPackedState; +}; -//states.getStateById("67c67c4e-a3ab-4d38-ab0b-741cfd4b3d44").then(log).catch(log) +createStatesWithTransitions().then(log).catch(log) -states.addTransition("eb35b1d8-9cad-478f-a7a6-11d95cc5e79a", "a5f8b4bd-6314-4f4e-acbb-780ac3e3772e").then(log).catch(log) +//states.getStateById(orderPackedState.id).then(log).catch(log) \ No newline at end of file diff --git a/handson/customer.js b/handson/customer.js index 6de1038..c3584a0 100644 --- a/handson/customer.js +++ b/handson/customer.js @@ -49,8 +49,6 @@ module.exports.createCustomer = (customerData) => }) .execute(); -const createCustomerDraftKey = (customerData) => {}; - module.exports.createCustomerKeyVerfiedEmail = (customerData) => apiRoot .withProjectKey({ projectKey }) diff --git a/handson/states.js b/handson/states.js index c784252..28320d8 100644 --- a/handson/states.js +++ b/handson/states.js @@ -35,16 +35,16 @@ module.exports.getStateById = (ID) => .get() .execute(); -module.exports.addTransition = (stateId, transitionStateId) => { - return getStateById(stateId).then((state) => { +module.exports.addTransition = (stateId, transitionStateIds) => { + return this.getStateById(stateId).then((state) => { const updateActions = [ { action: "setTransitions", - transitions: [ - { + transitions: transitionStateIds.map((transitionStateId) => { + return { id: transitionStateId, - }, - ], + }; + }), }, ]; From d6413316f3caeb49c7161669e5b429bf47dd7d23 Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Mon, 28 Mar 2022 14:09:41 -0400 Subject: [PATCH 15/18] updated to removed hardcoded IDs --- Task02_customers.js | 23 ++-- Task03_import_sync_products.js | 15 ++- Task04b_checkout.js | 64 +++++----- Task04c_merging.js | 29 ++--- Task05a_stores.js | 10 +- Task05b_product_selections.js | 11 +- Task05c_my.js | 6 +- Task08_subscriptions.js | 2 +- handson/client.js | 2 +- handson/customer.js | 21 +++- handson/graphql.js | 5 +- handson/importService.js | 13 +- handson/order.js | 220 ++++++++++++++------------------- handson/productSelections.js | 33 +++-- handson/states.js | 38 +++--- handson/store.js | 44 +++---- 16 files changed, 258 insertions(+), 278 deletions(-) diff --git a/Task02_customers.js b/Task02_customers.js index e77011f..48a8e62 100644 --- a/Task02_customers.js +++ b/Task02_customers.js @@ -2,26 +2,31 @@ const { createCustomer, getCustomerById, getCustomerByKey, - createCustomerKeyVerfiedEmail, + createCustomerToken, + confirmCustomerEmail, assignCustomerToCustomerGroup, } = require("./handson/customer"); const { log } = require("./logger.js"); const customerDraftData = { - firstName: "test2", + firstName: "test", lastName: "test", - email: "test2@test.com", + email: "test@test.com", password: "password", - key: "test1233", + key: "test123", countryCode: "DE", }; -//createCustomer(customerDraftData).then(log).catch(log); +// createCustomer(customerDraftData).then(log).catch(log); -//getCustomerByKey('test123').then(log).catch(log); +// getCustomerByKey('test123').then(log).catch(log); -getCustomerById("10cb16bf-a5d8-4f47-b664-fe5cae2f75d0").then(log).catch(log); +// getCustomerById("a303f0e7-8535-4784-a638-e59f05208355").then(log).catch(log); -// createCustomerKeyVerfiedEmail(customerDraftData).then(log).catch(log); +// getCustomerByKey('test123') +// .then(createCustomerToken) +// .then(confirmCustomerEmail) +// .then(log) +// .catch(log); -//assignCustomerToCustomerGroup('test123','indoor-customers').then(log).catch(log); +assignCustomerToCustomerGroup('test123','indoor-customers').then(log).catch(log); diff --git a/Task03_import_sync_products.js b/Task03_import_sync_products.js index 0813fe9..6df6268 100644 --- a/Task03_import_sync_products.js +++ b/Task03_import_sync_products.js @@ -1,10 +1,10 @@ -const { createImportContainer, importProducts, checkImportSummary, checkImportOperationStatus } = require("./handson/importService"); +const { createImportContainer, importProducts, checkImportSummary, checkImportOperationsStatus, checkImportOperationStatusById } = require("./handson/importService"); const { log } = require("./logger.js"); const containerKey = "ff-ImportContainer"; // Create an import container -//createImportContainer(containerKey).then(log).catch(log); +// createImportContainer(containerKey).then(log).catch(log); // import products // importProducts(containerKey).then(log).catch(log); @@ -12,9 +12,16 @@ const containerKey = "ff-ImportContainer"; // check import summary for your container checkImportSummary(containerKey).then(log).catch(log); +// check import operations for your container +checkImportOperationsStatus(containerKey).then(operations => + operations.body.results.forEach(operation => + log(operation.id + " : " +operation.state) + ) +) + // Check the status of import operations by their Ids - checkImportOperationStatus("2e325e01-1193-4d8a-92c9-af29da1cc0fb").then(log).catch(log); - checkImportOperationStatus("cd61acae-301d-4984-8dc2-2deb0ba5035c").then(log).catch(log); +// checkImportOperationStatusById("2e325e01-1193-4d8a-92c9-af29da1cc0fb").then(log).catch(log); +// checkImportOperationStatusById("cd61acae-301d-4984-8dc2-2deb0ba5035c").then(log).catch(log); // https://github.com/commercetools/commercetools-project-sync#run // docker run \ diff --git a/Task04b_checkout.js b/Task04b_checkout.js index ae48710..0976140 100644 --- a/Task04b_checkout.js +++ b/Task04b_checkout.js @@ -1,62 +1,54 @@ const checkout = require("./handson/order"); const { log } = require("./logger.js"); -const cartDraftData = { - currency: "EUR", - customerId: "349fdf7c-98af-47ad-bec9-58aaaeb176b6", - countryCode: "DE", -}; +const customerKey = ""; +const cartId = ""; +const orderId = ""; + const paymentDraft = { - key:"testPayment-44", + key:"payment" + Math.random().toString(36).substr(2, 5), amountPlanned:{ - currencyCode:'EUR', - centAmount:4200 - }, - customer:{ - typeId:'customer', - id:'349fdf7c-98af-47ad-bec9-58aaaeb176b6' + currencyCode: 'EUR', + centAmount: 5000 } } -//checkout.createCart(cartDraftData).then(log).catch(log) -//checkout.addLineItemsToCart(['sku123','sku123'],'294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log) +// create a cart and update the catId variable +// checkout.createCart(customerKey).then(log).catch(log); + +// checkout.addLineItemsToCart(cartId,['tulip-seed-box','tulip-seed-sack']).then(log).catch(log); -// checkout.addDiscountCodeToCart("SUMMER",'294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log); -//checkout.getCartById('294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log) +// checkout.addDiscountCodeToCart(cartId, "SUMMER").then(log).catch(log); +// checkout.getCartById(cartId).then(log).catch(log); -//checkout.createOrderFromCart('294f2971-9497-43c1-8898-b7760082c842').then(log).catch(log) +// create order from cart and update the orderId +// checkout.createOrderFromCart(cartId).then(log).catch(log); -//checkout.getOrderById('abaf987f-7be6-4f55-9323-cf8921f28075').then(log).catch(log) -//checkout.createPayment(paymentDraft).then(log).catch(log) -//checkout.addPaymentToOrder('bd051b5c-9cd4-4cfc-8536-bac669f579f4','abaf987f-7be6-4f55-9323-cf8921f28075').then(log).catch(log) +//checkout.getOrderById(orderId).then(log).catch(log); -// checkout -// .updateOrderCustomState( -// "67c67c4e-a3ab-4d38-ab0b-741cfd4b3d44", -// "abaf987f-7be6-4f55-9323-cf8921f28075" -// ) -// .then(log) -// .catch(log); +// set order state to confirmed and custom workflow state to order packed +// checkout.setOrderState(orderId, 'Confirmed').then(log).catch(log); +// checkout.updateOrderCustomState(orderId,"ff-order-packed").then(log).catch(log); const checkoutProcess = async () => { - let emptyCart = await checkout.createCart(cartDraftData); + let emptyCart = await checkout.createCart(customerKey); let filledCart = await checkout.addLineItemsToCart( - ["sku123", "sku123",'sku111'], - emptyCart.body.id + emptyCart.body.id,['tulip-seed-box','tulip-seed-sack'] ); filledCart = await checkout.addDiscountCodeToCart( - "SUMMER", - emptyCart.body.id + emptyCart.body.id, 'SUMMER' ); - const payment = await checkout.createPayment(paymentDraft); + let order = await checkout.createOrderFromCart(filledCart.body.id); - order = await checkout.addPaymentToOrder(payment.body.id,order.body.id); - order = await checkout.setOrderState('Confirmed',order.body.id); + const payment = await checkout.createPayment(paymentDraft); + order = await checkout.addPaymentToOrder(order.body.id, payment.body.id); + order = await checkout.setOrderState(order.body.id, 'Confirmed'); + order = await checkout.updateOrderCustomState(order.body.id,'ff-order-packed'); if (order) { return { status: 201, - message: "order created", + message: "order created: " + order.body.id, }; } }; diff --git a/Task04c_merging.js b/Task04c_merging.js index c7b0247..23de35d 100644 --- a/Task04c_merging.js +++ b/Task04c_merging.js @@ -1,35 +1,22 @@ const checkout = require("./handson/order"); const { log } = require("./logger.js"); -const anonymousCartDraftData = { - currency: "EUR", - countryCode: "DE", -}; - -const customerCartDraftData = { - currency: "EUR", - customerId: "10cb16bf-a5d8-4f47-b664-fe5cae2f75d0", - countryCode: "DE", -}; +const customerKey = ""; const mergingProcessTest = async () => { - let anonymousCart = await checkout.createCart(anonymousCartDraftData); + let anonymousCart = await checkout.createAnonymousCart(); + + let customerCart = await checkout.createCart(customerKey); - let customerCart = await checkout.createCart(customerCartDraftData); + anonymousCart = await checkout.addLineItemsToCart( anonymousCart.body.id,['tulip-seed-box','tulip-seed-box','tulip-seed-box'] ); - anonymousCart = await checkout.addLineItemsToCart( - ["sku111", "sku123","sku123"], - anonymousCart.body.id - ); + customerCart = await checkout.addLineItemsToCart( customerCart.body.id, ['tulip-seed-box','tulip-seed-sack','tulip-seed-package'] ); - customerCart = await checkout.addLineItemsToCart( - ["sku123"], - customerCart.body.id - ); log("Anonymous Cart: " + anonymousCart.body.id); log("Customer Cart: "+ customerCart.body.id); + const customerDetails = { - email: "test2@test.com", + email: "test@test.com", password: "password", anonymousCartId: anonymousCart.body.id, anonymousCartSignInMode: "MergeWithExistingCustomerCart", // try switching to UseAsNewActiveCustomerCart diff --git a/Task05a_stores.js b/Task05a_stores.js index 585440b..9202f7a 100644 --- a/Task05a_stores.js +++ b/Task05a_stores.js @@ -2,10 +2,14 @@ const {getStoreByKey, getCustomersInStore, createInStoreCart } = require("./hand const { getCustomerByKey } = require("./handson/customer"); const { log } = require("./logger"); -getStoreByKey('berlin-store').then(log).catch(log); +// getStoreByKey('berlin-store').then(log).catch(log); -// getCustomersInStore('berlin-store').then(log).catch(log); +getCustomersInStore('berlin-store').then(customers => { + log(customers.body.count); + customers.body.results.forEach(customer => + log(customer.id) + )}).catch(log); -// getCustomerByKey("nage1223").then((customer) => { +// getCustomerByKey("test123").then((customer) => { // createInStoreCart("berlin-store",customer).then(log).catch(log); // }).catch(log); diff --git a/Task05b_product_selections.js b/Task05b_product_selections.js index ba94550..9396b6c 100644 --- a/Task05b_product_selections.js +++ b/Task05b_product_selections.js @@ -10,15 +10,16 @@ const { } = require("./handson/productSelections"); const { log } = require("./logger"); +const productSelectionKey = "ff-berlin-store-selection"; -// createProductSelection("berlin-store-selection","Berlin Store Selection").then(log).catch(log); +// createProductSelection(productSelectionKey,"Berlin Store Selection").then(log).catch(log); -// getProductSelectionByKey('berlin-store-selection').then(log).catch(log); +// getProductSelectionByKey(productSelectionKey).then(log).catch(log); -// addProductsToProductSelection('berlin-store-selection',['tulip-seed-product']).then(log).catch(log); +// addProductsToProductSelection(productSelectionKey,['tulip-seed-product']).then(log).catch(log); -// addProductSelectionToStore("berlin-store","berlin-store-selection").then(log).catch(log); +// addProductSelectionToStore("berlin-store",productSelectionKey).then(log).catch(log); -// getProductsInProductSelection("berlin-store-selection").then(log).catch(log); +// getProductsInProductSelection(productSelectionKey).then(log).catch(log); getProductsInStore("berlin-store").then(log).catch(log); diff --git a/Task05c_my.js b/Task05c_my.js index fff55a4..33abcb7 100644 --- a/Task05c_my.js +++ b/Task05c_my.js @@ -5,4 +5,8 @@ const { log } = require("./logger"); // getMe().then(log).catch(log); -getMyOrders().then(log).catch(log); +getMyOrders().then(orders => + orders.body.results.forEach(order => + log(order.id + " : " + order.totalPrice.centAmount) + ) +).catch(log); diff --git a/Task08_subscriptions.js b/Task08_subscriptions.js index 9b22768..04c5bca 100644 --- a/Task08_subscriptions.js +++ b/Task08_subscriptions.js @@ -7,7 +7,7 @@ const {log} = require('./logger'); // changes const sampleSubscriptionDraft = { - key:'subscriptionSampleForSendingConfirmationEmails', + key:'subscriptionSample', destination:{ type:'GoogleCloudPubSub', projectId:"ct-support", diff --git a/handson/client.js b/handson/client.js index ad30454..11ab447 100644 --- a/handson/client.js +++ b/handson/client.js @@ -90,7 +90,7 @@ const getMyAPIClient = () => { clientId: process.env.ME_CLIENT_ID, clientSecret: process.env.ME_CLIENT_SECRET, user: { - username: "nage@test.com", + username: "test@test.com", password: "password", }, }, diff --git a/handson/customer.js b/handson/customer.js index b27e56f..919927b 100644 --- a/handson/customer.js +++ b/handson/customer.js @@ -37,6 +37,7 @@ const createCustomerDraft = (customerData) => { }, ], defaultShippingAddress: 0, + defaultBillingAddress: 0, }; }; @@ -49,18 +50,32 @@ module.exports.createCustomer = (customerData) => }) .execute(); -module.exports.createCustomerKeyVerfiedEmail = (customerData) => +module.exports.createCustomerToken = (customer) => apiRoot .withProjectKey({ projectKey }) .customers() + .emailToken() .post({ body: { - ...createCustomerDraft(customerData), - isEmailVerified: true, + id: customer.body.id, + ttlMinutes: 60, + version: customer.body.version }, }) .execute(); +module.exports.confirmCustomerEmail = (token) => + apiRoot + .withProjectKey({ projectKey }) + .customers() + .emailConfirm() + .post({ + body: { + tokenValue: token.body.value + }, + }) + .execute(); + module.exports.assignCustomerToCustomerGroup = ( customerKey, customerGroupKey diff --git a/handson/graphql.js b/handson/graphql.js index 9bb6d5b..bd713e7 100644 --- a/handson/graphql.js +++ b/handson/graphql.js @@ -1,7 +1,10 @@ const { apiRoot, projectKey } = require("./client.js"); -module.exports.getCustomerWithOrders = (query) =>apiRoot.withProjectKey({projectKey}).graphql().post({ +module.exports.getCustomerWithOrders = (query) => +apiRoot.withProjectKey({projectKey}) +.graphql() +.post({ body:{ query, variables:{} diff --git a/handson/importService.js b/handson/importService.js index e37465f..4e482d3 100644 --- a/handson/importService.js +++ b/handson/importService.js @@ -18,8 +18,17 @@ module.exports.checkImportSummary = (importContainerKey) => .importSummaries() .get() .execute(); - -module.exports.checkImportOperationStatus = (id) => + +module.exports.checkImportOperationsStatus = (importContainerKey) => + importApiRoot + .withProjectKeyValue({ projectKey }) + .importContainers() + .withImportContainerKeyValue({importContainerKey}) + .importOperations() + .get( { queryArgs: { debug: true } } ) + .execute(); + +module.exports.checkImportOperationStatusById = (id) => importApiRoot .withProjectKeyValue({ projectKey }) .importOperations() diff --git a/handson/order.js b/handson/order.js index dc8df90..9d40eca 100644 --- a/handson/order.js +++ b/handson/order.js @@ -1,29 +1,35 @@ const { apiRoot, projectKey } = require("./client.js"); +const { getCustomerByKey } = require( "./customer.js" ); -module.exports.createCart = (cartDraftData) => - apiRoot - .withProjectKey({ projectKey }) +module.exports.createCart = (customerKey) => +getCustomerByKey(customerKey).then((customer) => + apiRoot.withProjectKey({ projectKey }) .carts() .post({ - body: createCartDraft(cartDraftData), + body: { + currency: "EUR", + country: "DE", + customerId: customer.body.id, + customerEmail: customer.body.email, + shippingAddress: customer.body.addresses.find(address => address.id == customer.body.defaultShippingAddressId) + } }) - .execute(); - -const createCartDraft = (cartDraftData) => { - const { currency, customerId, countryCode } = cartDraftData; + .execute() +) - return { - currency, - customerId, - shippingAddress: { - country: countryCode, - }, - }; -}; +module.exports.createAnonymousCart = () => + apiRoot.withProjectKey({ projectKey }) + .carts() + .post({ + body: { + currency: "EUR", + country: "DE", + } + }) + .execute() module.exports.customerSignIn = (customerDetails) => - apiRoot - .withProjectKey({ projectKey }) + apiRoot.withProjectKey({ projectKey }) .login() .post({ body: customerDetails }) .execute(); @@ -31,160 +37,124 @@ module.exports.customerSignIn = (customerDetails) => module.exports.getCartById = (ID) => apiRoot.withProjectKey({ projectKey }).carts().withId({ ID }).get().execute(); -module.exports.addLineItemsToCart = (arrayOfSKUs, cartId) => { - return this.getCartById(cartId).then((cart) => { - let updateActions = []; - arrayOfSKUs.forEach((sku) => { - updateActions.push({ - action: "addLineItem", - sku, - }); - }); - return apiRoot - .withProjectKey({ projectKey }) +module.exports.addLineItemsToCart = (cartId, arrayOfSKUs) => + this.getCartById(cartId).then((cart) => + apiRoot.withProjectKey({projectKey}) .carts() - .withId({ - ID: cart.body.id, - }) + .withId({ID: cartId}) .post({ body: { - actions: updateActions, version: cart.body.version, - }, + actions: arrayOfSKUs.map((sku) => { + return { + action: "addLineItem", + sku + }; + } + ) + } }) - .execute(); - }); -}; + .execute() + ) -module.exports.addDiscountCodeToCart = (discountCode, cartId) => { - return this.getCartById(cartId).then((cart) => { - let updateActions = [ - { - action: "addDiscountCode", - code: discountCode, - }, - ]; - return apiRoot - .withProjectKey({ projectKey }) +module.exports.addDiscountCodeToCart = (cartId, discountCode) => + this.getCartById(cartId).then((cart) => + apiRoot.withProjectKey({ projectKey }) .carts() - .withId({ - ID: cart.body.id, - }) + .withId({ ID: cartId }) .post({ body: { - actions: updateActions, + actions: [ { + action: "addDiscountCode", + code: discountCode, + } ], version: cart.body.version, }, }) - .execute(); - }); -}; + .execute() + ) -module.exports.createOrderFromCart = (cartId) => { - return createOrderFromCartDraft(cartId).then((orderFromCartDraft) => { - return apiRoot - .withProjectKey({ projectKey }) +module.exports.createOrderFromCart = (cartId) => + createOrderFromCartDraft(cartId).then((orderFromCartDraft) => + apiRoot.withProjectKey({ projectKey }) .orders() .post({ body: orderFromCartDraft, }) - .execute(); - }); -}; + .execute() + ) -const createOrderFromCartDraft = (cartId) => { - return this.getCartById(cartId).then((cart) => { +const createOrderFromCartDraft = (cartId) => + this.getCartById(cartId).then((cart) => { return { id: cart.body.id, version: cart.body.version, }; - }); -}; + }) module.exports.getOrderById = (ID) => - apiRoot - .withProjectKey({ projectKey }) + apiRoot.withProjectKey({ projectKey }) .orders() .withId({ ID }) .get() - .execute(); + .execute() -module.exports.updateOrderCustomState = (customStateId, orderId) => { - return getOrderById(orderId).then((order) => { - const updateActions = [ - { - action: "transitionState", - state: { - id: customStateId, - }, - }, - ]; - return apiRoot - .withProjectKey({ projectKey }) +module.exports.updateOrderCustomState = (orderId, customStateKey) => + this.getOrderById(orderId).then((order) => + apiRoot.withProjectKey({ projectKey }) .orders() .withId({ - ID: order.body.id, + ID: orderId, }) .post({ body: { - actions: updateActions, - version: order.body.version, - }, + actions: [ { + action: "transitionState", + state: { key: customStateKey } + } ], + version: order.body.version + } }) - .execute(); - }); -}; + .execute() + ) module.exports.createPayment = (paymentDraft) => - apiRoot - .withProjectKey({ projectKey }) + apiRoot.withProjectKey({ projectKey }) .payments() .post({ body: paymentDraft }) - .execute(); + .execute() -module.exports.setOrderState = (stateName, orderId) => { - return this.getOrderById(orderId).then((order) => { - const updateActions = [ - { - action: "changeOrderState", - orderState: stateName, - }, - ]; - return apiRoot - .withProjectKey({ projectKey }) +module.exports.setOrderState = (orderId, stateName) => + this.getOrderById(orderId).then((order) => + apiRoot.withProjectKey({ projectKey }) .orders() - .withId({ ID: order.body.id }) + .withId({ ID: orderId }) .post({ body: { version: order.body.version, - actions: updateActions, - }, + actions: [ { + action: "changeOrderState", + orderState: stateName + } ] + } }) - .execute(); - }); -}; + .execute() + ) -module.exports.addPaymentToOrder = (paymentId, orderId) => { - return this.getOrderById(orderId).then((order) => { - const updateActions = [ - { - action: "addPayment", - payment: { - typeId: "payment", - id: paymentId, - }, - }, - ]; - return apiRoot - .withProjectKey({ projectKey }) + +module.exports.addPaymentToOrder = (orderId, paymentId) => + this.getOrderById(orderId).then((order) => + apiRoot.withProjectKey({ projectKey }) .orders() - .withId({ ID: order.body.id }) + .withId({ ID: orderId }) .post({ body: { version: order.body.version, - actions: updateActions, - }, + actions: [ { + action: "addPayment", + payment: { id: paymentId } + } ] + } }) - .execute(); - }); -}; + .execute() + ) diff --git a/handson/productSelections.js b/handson/productSelections.js index f484be8..c74ccb2 100644 --- a/handson/productSelections.js +++ b/handson/productSelections.js @@ -24,29 +24,24 @@ module.exports.createProductSelection = (key,name) => module.exports.addProductsToProductSelection = async ( productSelectionKey, arrayOfProductKeys -) => { - const prdoductSelection = await this.getProductSelectionByKey(productSelectionKey); - const actions = arrayOfProductKeys.map((key) => { - return { - action: "addProduct", - product: { - typeId: "product", - key, - }, - }; - }); - return apiRoot.withProjectKey({ projectKey }) +) => + this.getProductSelectionByKey(productSelectionKey).then((productSelection) => + apiRoot.withProjectKey({projectKey}) .productSelections() - .withKey({ key: productSelectionKey }) + .withKey({key: productSelectionKey}) .post({ body: { - version: prdoductSelection.body.version, - actions, - }, + version: productSelection.body.version, + actions: arrayOfProductKeys.map((productKey) => { + return { + action: "addProduct", + product: {key: productKey} + } + }) + } }) - .execute(); -}; - + .execute() + ) module.exports.getProductsInProductSelection = (productSelectionKey) => apiRoot.withProjectKey({ projectKey }) .productSelections() diff --git a/handson/states.js b/handson/states.js index 28320d8..5d7d1fb 100644 --- a/handson/states.js +++ b/handson/states.js @@ -35,31 +35,23 @@ module.exports.getStateById = (ID) => .get() .execute(); -module.exports.addTransition = (stateId, transitionStateIds) => { - return this.getStateById(stateId).then((state) => { - const updateActions = [ - { - action: "setTransitions", - transitions: transitionStateIds.map((transitionStateId) => { - return { - id: transitionStateId, - }; - }), - }, - ]; - - return apiRoot - .withProjectKey({ projectKey }) +module.exports.addTransition = (stateId, transitionStateIds) => + this.getStateById(stateId).then((state) => + apiRoot.withProjectKey({projectKey}) .states() - .withId({ - ID: state.body.id, - }) + .withId({ID: state.body.id}) .post({ body: { - actions: updateActions, version: state.body.version, - }, + actions: [ + { + action:"setTransitions", + transitions: transitionStateIds.map((transitionStateId) => { + return {id: transitionStateId}; + }) + } + ] + } }) - .execute(); - }); -}; + .execute() + ) diff --git a/handson/store.js b/handson/store.js index 967d1a2..8c0523c 100644 --- a/handson/store.js +++ b/handson/store.js @@ -16,30 +16,25 @@ module.exports.getCustomersInStore = (storeKey) => .get() .execute(); -module.exports.addProductSelectionToStore = async (storeKey, productSelectionKey) => { - const store = await this.getStoreByKey(storeKey); - - return apiRoot.withProjectKey({projectKey}) - .stores() - .withKey({key: storeKey}) - .post( - {body: { - version: store.body.version, - actions: [ - { - action: "setProductSelections", - productSelections: [ - { - productSelection: {key: productSelectionKey}, - active: true - } - ] - } - ] - }} - ) - .execute(); -} +module.exports.addProductSelectionToStore = async (storeKey, productSelectionKey) => + this.getStoreByKey(storeKey).then((store) => + apiRoot.withProjectKey({projectKey}) + .stores() + .withKey({key: storeKey}) + .post({ + body: { + version: store.body.version, + actions: [ + { + action: "addProductSelection", + productSelection: { key: productSelectionKey}, + active: true + } + ] + } + }) + .execute() + ) module.exports.getProductsInStore = (storeKey) => apiRoot.withProjectKey({ projectKey }) @@ -57,6 +52,7 @@ module.exports.createInStoreCart = (storeKey, customer) => currency: "EUR", customerId: customer.body.id, customerEmail: customer.body.email, + store: {key: storeKey} } }) .execute(); From 6b9ef9cca1dd2b9d3101f7ad54540cdebc902e26 Mon Sep 17 00:00:00 2001 From: Nagesh Dixit Date: Sun, 10 Apr 2022 12:40:11 -0400 Subject: [PATCH 16/18] updated sdk version --- README.md | 3 + Task01_project_setup.js | 28 +- Task06c_graphql.js | 15 +- Task07a_custom_types.js | 19 +- Task07b_custom_objects.js | 22 +- Task07c_extensions.js | 12 +- Task08_subscriptions.js | 11 +- handson/customObjects.js | 31 - handson/customTypes.js | 20 - handson/extensions.js | 17 - handson/graphql.js | 12 - handson/project.js | 4 - handson/shippingMethods.js | 9 - handson/store.js | 7 +- handson/subscriptions.js | 9 - handson/taxCategory.js | 9 - package.json | 6 +- yarn-error.log | 1166 ------------------------------------ yarn.lock | 205 +++---- 19 files changed, 166 insertions(+), 1439 deletions(-) delete mode 100644 handson/customObjects.js delete mode 100644 handson/customTypes.js delete mode 100644 handson/extensions.js delete mode 100644 handson/graphql.js delete mode 100644 handson/project.js delete mode 100644 handson/shippingMethods.js delete mode 100644 handson/subscriptions.js delete mode 100644 handson/taxCategory.js delete mode 100644 yarn-error.log diff --git a/README.md b/README.md index 9095621..5e4a1b7 100644 --- a/README.md +++ b/README.md @@ -19,5 +19,8 @@ example - yarn 4c - yarn 6b +The following (or later) must be installed before the TypeScript SDK can be used: +- Node v12.22.7 +- npm v6 OR yarn v1.22.17 for questions email training@commercetools.com \ No newline at end of file diff --git a/Task01_project_setup.js b/Task01_project_setup.js index f0f2526..ef1731a 100644 --- a/Task01_project_setup.js +++ b/Task01_project_setup.js @@ -1,17 +1,29 @@ -const { getProject } = require("./handson/project.js"); -const { getShippingMethodById } = require("./handson/shippingMethods"); -const { getTaxCategoryByKey } = require("./handson/taxCategory.js"); +const { apiRoot, projectKey } = require("./handson/client.js"); const { log } = require("./logger.js"); // TODO 1: Complete the functions in // ./handson/client.js -// ./handson/project.js -// ./handson/taxCategory.js // So this code displays the project configuration // https://docs.commercetools.com/http-api-projects-project.html#get-project -getProject().then(log).catch(log); +apiRoot + .withProjectKey({ projectKey }) + .get() + .execute() +.then(log).catch(log); -//getShippingMethodById("fb9d70f3-c59a-4507-b1ad-73ad5acfac94").then(log).catch(log); +apiRoot + .withProjectKey({ projectKey }) + .shippingMethods() + .withId({ ID: "d24e8501-65c0-4125-994d-7e9ba80724a5" }) + .get() + .execute() +.then(log).catch(log); -// getTaxCategoryByKey("standard-tax-category").then(log).catch(log); +apiRoot + .withProjectKey({ projectKey }) + .taxCategories() + .withKey({ key: "standard-tax-category" }) + .get() + .execute() +.then(log).catch(log); diff --git a/Task06c_graphql.js b/Task06c_graphql.js index 263809b..17e3774 100644 --- a/Task06c_graphql.js +++ b/Task06c_graphql.js @@ -1,8 +1,8 @@ -const {getCustomerWithOrders} = require ('./handson/graphql'); +const { apiRoot, projectKey } = require("./handson/client.js"); const { log } = require("./logger"); -const testQuery = ` +const query = ` query { orders { results { @@ -21,4 +21,13 @@ query { } } `; -getCustomerWithOrders(testQuery).then(log).catch(log) \ No newline at end of file + +apiRoot.withProjectKey({projectKey}) + .graphql() + .post({ + body:{ + query, + variables:{} + } + }).execute() +.then(log).catch(log) \ No newline at end of file diff --git a/Task07a_custom_types.js b/Task07a_custom_types.js index acb811e..49f91de 100644 --- a/Task07a_custom_types.js +++ b/Task07a_custom_types.js @@ -1,16 +1,16 @@ -const {createCustomType} = require('./handson/customTypes'); +const { apiRoot, projectKey } = require("./handson/client.js"); const {log} = require('./logger'); -const sampleTypeDraftData = { +const typeDraft = { key:'ff-allowed-to-place-orders', name:{ - "de":'ff-allowed-to-place-orders', - "en":'ff-allowed-to-place-orders' + "de":'ff allowed to place orders', + "en":'ff allowed to place orders' }, description:{ - "de":'allowed-to-place-orders', - "en":'allowed-to-place-orders' + "de":'allow a customer to place orders', + "en":'allow a customer to place orders' }, resourceTypeIds:['customer'], fieldDefinitions:[{ @@ -26,4 +26,9 @@ const sampleTypeDraftData = { }] } -createCustomType(sampleTypeDraftData).then(log).catch(log); +apiRoot + .withProjectKey({ projectKey }) + .types() + .post({ body: typeDraft }) + .execute() +.then(log).catch(log); diff --git a/Task07b_custom_objects.js b/Task07b_custom_objects.js index ef5d6a9..60f401c 100644 --- a/Task07b_custom_objects.js +++ b/Task07b_custom_objects.js @@ -1,9 +1,9 @@ -const {createCustomObject, getCustomObjectByContainerAndKey} = require('./handson/customObjects'); +const { apiRoot, projectKey } = require("./handson/client.js"); const {log} = require('./logger'); -const sampleCustomObjectDraftData = { +const customObjectDraft = { container: "compatibility-info", key:'tulip-seed-product', value: { @@ -18,6 +18,20 @@ const sampleCustomObjectDraftData = { } -createCustomObject(sampleCustomObjectDraftData).then(log).catch(log); +apiRoot + .withProjectKey({ projectKey }) + .customObjects() + .post({ body: customObjectDraft }) + .execute() +.then(log).catch(log); -// getCustomObjectByContainerAndKey("compatibility-info","tulip-seed-product").then(log).catch(log); \ No newline at end of file +// apiRoot +// .withProjectKey({ projectKey }) +// .customObjects() +// .withContainerAndKey({ +// container: "compatibility-info", +// key: "tulip-seed-product" +// }) +// .get() +// .execute() +// .then(log).catch(log); \ No newline at end of file diff --git a/Task07c_extensions.js b/Task07c_extensions.js index 18c15a5..1ea9794 100644 --- a/Task07c_extensions.js +++ b/Task07c_extensions.js @@ -1,9 +1,9 @@ -const {createExtension} = require('./handson/extensions'); +const { apiRoot, projectKey } = require("./handson/client.js"); const {log} = require('./logger'); -const sampleExtensionDraft = { +const extensionDraft = { key:'orderChecker', destination:{ type:'HTTP', @@ -15,4 +15,10 @@ const sampleExtensionDraft = { }] } -createExtension(sampleExtensionDraft).then(log).catch(log); +apiRoot + .withProjectKey({ projectKey }) + .extensions() + .post({ body: extensionDraft }) + .execute() +.then(log).catch(log) + diff --git a/Task08_subscriptions.js b/Task08_subscriptions.js index 04c5bca..c2f3c47 100644 --- a/Task08_subscriptions.js +++ b/Task08_subscriptions.js @@ -1,4 +1,4 @@ -const {createSubscription} = require('./handson/subscriptions'); +const { apiRoot, projectKey } = require("./handson/client.js"); const {log} = require('./logger'); // key - String - Optional - User-specific unique identifier for the subscription @@ -6,7 +6,7 @@ const {log} = require('./logger'); // messages - Array of MessageSubscription - Optional - The messages to be subscribed to. // changes -const sampleSubscriptionDraft = { +const subscriptionDraft = { key:'subscriptionSample', destination:{ type:'GoogleCloudPubSub', @@ -20,4 +20,9 @@ const sampleSubscriptionDraft = { } -createSubscription(sampleSubscriptionDraft).then(log).catch(log); +apiRoot + .withProjectKey({ projectKey }) + .subscriptions() + .post({ body: subscriptionDraft }) + .execute() +.then(log).catch(log); diff --git a/handson/customObjects.js b/handson/customObjects.js deleted file mode 100644 index d1f429c..0000000 --- a/handson/customObjects.js +++ /dev/null @@ -1,31 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - - -module.exports.getCustomObjectByContainerAndKey = (container, key) => - apiRoot - .withProjectKey({ projectKey }) - .customObjects() - .withContainerAndKey({ - container, - key - }) - .get() - .execute(); - - -module.exports.createCustomObject = (customObjectDraftData) => - apiRoot - .withProjectKey({ projectKey }) - .customObjects() - .post({ body: createCustomObjectDraft(customObjectDraftData) }) - .execute(); - - -const createCustomObjectDraft = (customObjectDraftData) => { - const {container, key, value}=customObjectDraftData - return { - container, - key, - value - } -} diff --git a/handson/customTypes.js b/handson/customTypes.js deleted file mode 100644 index 4d0c392..0000000 --- a/handson/customTypes.js +++ /dev/null @@ -1,20 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.createCustomType = (typeDraftData) => - apiRoot - .withProjectKey({ projectKey }) - .types() - .post({ body: createTypeDraft(typeDraftData) }) - .execute(); - - -const createTypeDraft = (typeDraftData) => { - const {key, name, description, resourceTypeIds, fieldDefinitions}=typeDraftData - return { - key, - name, - description, - resourceTypeIds, - fieldDefinitions - } -} diff --git a/handson/extensions.js b/handson/extensions.js deleted file mode 100644 index 7d24b9f..0000000 --- a/handson/extensions.js +++ /dev/null @@ -1,17 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.createExtension = (extensionDraftData) => - apiRoot - .withProjectKey({ projectKey }) - .extensions() - .post({ body: createExtensionDraft(extensionDraftData) }) - .execute(); - -const createExtensionDraft = (extensionDraftData) => { - const { key, destination, triggers } = extensionDraftData; - return { - key, - destination, - triggers, - }; -}; diff --git a/handson/graphql.js b/handson/graphql.js deleted file mode 100644 index bd713e7..0000000 --- a/handson/graphql.js +++ /dev/null @@ -1,12 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - - -module.exports.getCustomerWithOrders = (query) => -apiRoot.withProjectKey({projectKey}) -.graphql() -.post({ - body:{ - query, - variables:{} - } -}).execute(); \ No newline at end of file diff --git a/handson/project.js b/handson/project.js deleted file mode 100644 index 5161a83..0000000 --- a/handson/project.js +++ /dev/null @@ -1,4 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.getProject = () => - apiRoot.withProjectKey({ projectKey }).get().execute(); diff --git a/handson/shippingMethods.js b/handson/shippingMethods.js deleted file mode 100644 index ad94678..0000000 --- a/handson/shippingMethods.js +++ /dev/null @@ -1,9 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.getShippingMethodById = (ID) => - apiRoot - .withProjectKey({ projectKey }) - .shippingMethods() - .withId({ ID }) - .get() - .execute(); diff --git a/handson/store.js b/handson/store.js index 8c0523c..1b57142 100644 --- a/handson/store.js +++ b/handson/store.js @@ -40,7 +40,12 @@ module.exports.getProductsInStore = (storeKey) => apiRoot.withProjectKey({ projectKey }) .inStoreKeyWithStoreKeyValue({ storeKey }) .productSelectionAssignments() - .get() + .get({ + queryArgs: { + expand: "product", + expand: "productSelection" + } + }) .execute(); module.exports.createInStoreCart = (storeKey, customer) => diff --git a/handson/subscriptions.js b/handson/subscriptions.js deleted file mode 100644 index 7c8af03..0000000 --- a/handson/subscriptions.js +++ /dev/null @@ -1,9 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.createSubscription = (subscriptionsDraftData) => - apiRoot - .withProjectKey({ projectKey }) - .subscriptions() - .post({ body: subscriptionsDraftData }) - .execute(); - diff --git a/handson/taxCategory.js b/handson/taxCategory.js deleted file mode 100644 index f3a9dd6..0000000 --- a/handson/taxCategory.js +++ /dev/null @@ -1,9 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.getTaxCategoryByKey = (key) => - apiRoot - .withProjectKey({ projectKey }) - .taxCategories() - .withKey({ key }) - .get() - .execute(); diff --git a/package.json b/package.json index ddd83b7..8cb4a79 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,9 @@ "8": "node Task08_subscriptions.js" }, "dependencies": { - "@commercetools/importapi-sdk": "^1.3.0", - "@commercetools/platform-sdk": "^2.4.1", - "@commercetools/sdk-client-v2": "^1.1.0", + "@commercetools/importapi-sdk": "^2.4.0", + "@commercetools/platform-sdk": "^2.6.0", + "@commercetools/sdk-client-v2": "^1.3.0", "chalk-animation": "^1.6.0", "cli-highlight": "^2.1.11", "csvtojson": "^2.0.10", diff --git a/yarn-error.log b/yarn-error.log deleted file mode 100644 index 4915e76..0000000 --- a/yarn-error.log +++ /dev/null @@ -1,1166 +0,0 @@ -Arguments: - /usr/local/bin/node /usr/local/Cellar/yarn/1.22.4/libexec/bin/yarn.js 1 - -PATH: - /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin - -Yarn version: - 1.22.4 - -Node version: - 12.16.0 - -Platform: - darwin x64 - -Trace: - SyntaxError: /Users/ffawzy/Desktop/Projects/github official repos/js-sdk-v2-training/package.json: Unexpected token } in JSON at position 599 - at JSON.parse () - at /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:1625:59 - at Generator.next () - at step (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:310:30) - at /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:321:13 - -npm manifest: - { - "name": "commercetools-js-sdk-training-solutions", - "version": "1.0.0", - "main": "index.js", - "license": "MIT", - "scripts": { - "1": "node Task01_project_setup.js", - "2": "node Task02_customers.js", - "3": "node Task03_import_sync_products.js", - "4a": "node Task04a_states.js", - "4b": "node Task04b_checkout.js", - "4c": "node Task04c_merging.js", - "5": "node Task05_stores.js", - "6a": "node Task06a_search.js", - "6b": "node Task06b_pagination.js", - "6c": "node Task06c_graphql.js", - "7": "node Task07_extensions.js", - "8": "node Task08_subscriptions.js", - }, - "dependencies": { - "@commercetools/api-request-builder": "^5.6.3", - "@commercetools/importapi-sdk": "^1.3.0", - "@commercetools/sdk-auth": "^3.0.9", - "@commercetools/sdk-client": "^2.1.2", - "@commercetools/sdk-middleware-auth": "^6.1.4", - "@commercetools/sdk-middleware-http": "^6.0.8", - "@commercetools/typescript-sdk": "^1.2.0", - "chalk-animation": "^1.6.0", - "cli-highlight": "^2.1.4", - "csvtojson": "^2.0.10", - "dotenv": "^8.2.0", - "express": "^4.17.1", - "node-fetch": "^2.6.1" - } - } - -yarn manifest: - No manifest - -Lockfile: - # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - # yarn lockfile v1 - - - "@commercetools/api-request-builder@^5.6.3": - version "5.6.3" - resolved "https://registry.yarnpkg.com/@commercetools/api-request-builder/-/api-request-builder-5.6.3.tgz#d87c4961fec95a9186dd59fcd0256ea56cd89772" - integrity sha512-Oazb2Exuc4RR+p86m1xFkruQscX/hakejCSiUrxOmeqMKY5CBeFXXVAlfpDTjxgZ0nXgkPWGWye1FHCXlSRLOw== - - "@commercetools/importapi-sdk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-1.3.0.tgz#907498892300d104569b2114da5380bfc3d17eb3" - integrity sha512-IPKubLllEqtys8mEpOWZ1HyIe+vLYt5v9TFLLc0uXGdbO7tvu5ybvMU0jo+nkDH9B4RWGRvzfTdXzX96J5YyBw== - - "@commercetools/sdk-auth@^3.0.9": - version "3.0.9" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-auth/-/sdk-auth-3.0.9.tgz#4cbee3e9729bc50ef42a080c1fd2a15efa7f2019" - integrity sha512-j7KYF5a2JTdfsONONE8NsHzFRqz40OTsPTS/GDyjnrDFvCT6gez665pheMS5ASRz/CjltrA+z5ucYFd4iaXxEg== - dependencies: - "@commercetools/sdk-middleware-http" "^6.0.8" - lodash.defaultsdeep "^4.6.0" - qss "2.0.3" - - "@commercetools/sdk-client@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-client/-/sdk-client-2.1.2.tgz#fe1e442f67a385f103470669784c0fa20d7a2314" - integrity sha512-YPpK39pkjfedjS1/BFg2d7CrvTeN7vIS5vfiqEkKOtAoUxiNkugv59gRSoh2Em8SOccxyM/skpgHyTqfmJzXug== - - "@commercetools/sdk-middleware-auth@^6.1.4": - version "6.1.4" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.1.4.tgz#c5f464ae1627336715681e4590b63777e034c890" - integrity sha512-49R1DWsA+pNHH7/2K6QU5wnJSXabljKA8dvzs5HcbLwutlDp3Io0XHgIJa9qpfYhgW6k0h9dPICcLbESrQBXYw== - dependencies: - node-fetch "^2.3.0" - - "@commercetools/sdk-middleware-http@^6.0.8": - version "6.0.8" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.0.8.tgz#15e2cc2eb9b12d2913061cb4c7f770d6d03b0166" - integrity sha512-o1y96K5sZ5zOpHqesZt8I14SZMrZchDIOAv2pc3DDJwqguxEBvQMqAE7pwBySH/CLayrC8z6pfljPNFEMQNXGQ== - - "@commercetools/typescript-sdk@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@commercetools/typescript-sdk/-/typescript-sdk-1.2.0.tgz#fb991ac37ebc1bd16613d16873bbaf784a993afd" - integrity sha512-DrnIR3JdWyJppZL4o0a9a6C3tBOG0DcW+P0SMreQo1Ir5SxmeMN1UtoNXmgtzaBB9M53IaY5DVW4aKS3PyA9qw== - - "@types/color-name@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== - - "@types/tinycolor2@^1.4.0": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@types/tinycolor2/-/tinycolor2-1.4.2.tgz#721ca5c5d1a2988b4a886e35c2ffc5735b6afbdf" - integrity sha512-PeHg/AtdW6aaIO2a+98Xj7rWY4KC1E6yOy7AFknJQ7VXUGNrMlyxDFxJo7HqLtjQms/ZhhQX52mLVW/EX3JGOw== - - accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - - ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - - ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - - ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" - integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== - dependencies: - "@types/color-name" "^1.1.1" - color-convert "^2.0.1" - - any-promise@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - - array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= - - array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - - arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - - bluebird@^3.5.1: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - - body-parser@1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - - bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - - camelcase-keys@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" - integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= - dependencies: - camelcase "^4.1.0" - map-obj "^2.0.0" - quick-lru "^1.0.0" - - camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - - camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - - chalk-animation@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/chalk-animation/-/chalk-animation-1.6.0.tgz#df7fa91c55a9ed2939d4d287a23ad0374479fad0" - integrity sha512-Q8vVq6eD5IOhWI0s9WdUawDzMRjNrR4rOCiu409eZRTIHID5OjoTTEkpGZngL/BPQnL7yYmBhlXXpPJ9SYuARw== - dependencies: - chalk "^2.3.2" - gradient-string "^1.1.0" - meow "^4.0.0" - - chalk@^2.3.2, chalk@^2.4.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - - chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - - cli-highlight@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.4.tgz#098cb642cf17f42adc1c1145e07f960ec4d7522b" - integrity sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ== - dependencies: - chalk "^3.0.0" - highlight.js "^9.6.0" - mz "^2.4.0" - parse5 "^5.1.1" - parse5-htmlparser2-tree-adapter "^5.1.1" - yargs "^15.0.0" - - cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - - color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - - color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - - color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - - color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - - content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - - content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - - cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - - cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - - csvtojson@^2.0.10: - version "2.0.10" - resolved "https://registry.yarnpkg.com/csvtojson/-/csvtojson-2.0.10.tgz#11e7242cc630da54efce7958a45f443210357574" - integrity sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ== - dependencies: - bluebird "^3.5.1" - lodash "^4.17.3" - strip-bom "^2.0.0" - - currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= - dependencies: - array-find-index "^1.0.1" - - debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - - decamelize-keys@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - - decamelize@^1.1.0, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - - depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - - destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - - dotenv@^8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" - integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== - - ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - - emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - - encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - - error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - - escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - - escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - - etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - - express@^4.17.1: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - - finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - - find-up@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - - find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - - forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - - fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - - get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - - graceful-fs@^4.1.2: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - - gradient-string@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/gradient-string/-/gradient-string-1.2.0.tgz#93f39f2c7c8dcb095608c2ccf0aac24aa315fbac" - integrity sha512-Lxog7IDMMWNjwo4O0KbdBvSewk4vW6kQe5XaLuuPCyCE65AGQ1P8YqKJa5dq8TYf/Ge31F+KjWzPR5mAJvjlAg== - dependencies: - chalk "^2.4.1" - tinygradient "^0.4.1" - - has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - - has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - - highlight.js@^9.6.0: - version "9.18.3" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.3.tgz#a1a0a2028d5e3149e2380f8a865ee8516703d634" - integrity sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ== - - hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== - - http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - - http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - - iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - - indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= - - inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - - inherits@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - - ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - - is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - - is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - - is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - - is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - - json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - - load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - - locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - - locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - - lodash.defaultsdeep@^4.6.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6" - integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA== - - lodash@^4.17.3: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - - loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - - map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= - - map-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" - integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= - - media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - - meow@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.1.tgz#d48598f6f4b1472f35bf6317a95945ace347f975" - integrity sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A== - dependencies: - camelcase-keys "^4.0.0" - decamelize-keys "^1.0.0" - loud-rejection "^1.0.0" - minimist "^1.1.3" - minimist-options "^3.0.1" - normalize-package-data "^2.3.4" - read-pkg-up "^3.0.0" - redent "^2.0.0" - trim-newlines "^2.0.0" - - merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - - methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - - mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - - mime-types@~2.1.24: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - - mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - - minimist-options@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" - integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - - minimist@^1.1.3: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - - ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - - ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - - mz@^2.4.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== - dependencies: - any-promise "^1.0.0" - object-assign "^4.0.1" - thenify-all "^1.0.0" - - negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - - node-fetch@^2.3.0, node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - - object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - - on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - - p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - - p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - - p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - - p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - - p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - - p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - - parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - - parse5-htmlparser2-tree-adapter@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz#e8c743d4e92194d5293ecde2b08be31e67461cbc" - integrity sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw== - dependencies: - parse5 "^5.1.1" - - parse5@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" - integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== - - parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - - path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - - path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - - path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - - path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - - path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - - pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - - proxy-addr@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" - integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.1" - - qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - - qss@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/qss/-/qss-2.0.3.tgz#630b38b120931b52d04704f3abfb0f861604a9ec" - integrity sha512-j48ZBT5IZbSqJiSU8EX4XrN8nXiflHvmMvv2XpFc31gh7n6EpSs75bNr6+oj3FOLWyT8m09pTmqLNl34L7/uPQ== - - quick-lru@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" - integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= - - range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - - raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - - read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - - read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - - redent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" - integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= - dependencies: - indent-string "^3.0.0" - strip-indent "^2.0.0" - - require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - - require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - - resolve@^1.10.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - - safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - - "safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - - "semver@2 || 3 || 4 || 5": - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - - send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - - serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - - set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - - setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - - signal-exit@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - - spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - - spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - - spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - - spdx-license-ids@^3.0.0: - version "3.0.6" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz#c80757383c28abf7296744998cbc106ae8b854ce" - integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== - - "statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - - string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - - strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - - strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= - dependencies: - is-utf8 "^0.2.0" - - strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - - strip-indent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" - integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= - - supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - - supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - - thenify-all@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" - integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= - dependencies: - thenify ">= 3.1.0 < 4" - - "thenify@>= 3.1.0 < 4": - version "3.3.1" - resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" - integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== - dependencies: - any-promise "^1.0.0" - - tinycolor2@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" - integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g= - - tinygradient@^0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tinygradient/-/tinygradient-0.4.3.tgz#0a8dfde56f8865deec4c435a51bd5b0c0dec59fa" - integrity sha512-tBPYQSs6eWukzzAITBSmqcOwZCKACvRa/XjPPh1mj4mnx4G3Drm51HxyCTU/TKnY8kG4hmTe5QlOh9O82aNtJQ== - dependencies: - "@types/tinycolor2" "^1.4.0" - tinycolor2 "^1.0.0" - - toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - - trim-newlines@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" - integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= - - type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - - unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - - utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - - validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - - vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - - which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - - wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - - y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== - - yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - - yargs@^15.0.0: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" diff --git a/yarn.lock b/yarn.lock index ee7ba5e..b758356 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,26 +2,32 @@ # yarn lockfile v1 -"@commercetools/importapi-sdk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-1.3.0.tgz#907498892300d104569b2114da5380bfc3d17eb3" - integrity sha512-IPKubLllEqtys8mEpOWZ1HyIe+vLYt5v9TFLLc0uXGdbO7tvu5ybvMU0jo+nkDH9B4RWGRvzfTdXzX96J5YyBw== +"@commercetools/importapi-sdk@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-2.4.0.tgz#77ac436aa15d2e59ff499e4021c0adcdb1bead44" + integrity sha512-kysXwOy5SpY7UxTRgEwJeKAzel4/4HAEVO/b9MLQvJcz3fgfbUs2Lh1fBnLpUV4DnSDRV9q85tqDYnBHU+iuLA== + dependencies: + "@commercetools/sdk-client-v2" "^1.3.0" + "@commercetools/sdk-middleware-auth" "^6.0.4" + "@commercetools/sdk-middleware-http" "^6.0.4" + "@commercetools/sdk-middleware-logger" "^2.1.1" + querystring "^0.2.1" -"@commercetools/platform-sdk@^2.4.1": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@commercetools/platform-sdk/-/platform-sdk-2.4.1.tgz#cba87b3a9086bc11f811c6415935394c476ece7d" - integrity sha512-s6ppnIiw0fVcFyZ96yPTU2pKi4MtWG2nUWYPDKY+cjmm8rGSg5OfMsUNaY4wbO1IHWdY+XNliCon5HJTov14LQ== +"@commercetools/platform-sdk@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@commercetools/platform-sdk/-/platform-sdk-2.6.0.tgz#027d14bcf1a45517dc0c0c513b30e80727cc7d85" + integrity sha512-ru/A5IpbchqaPwTaKuhx8i0Wkukb1/pJ1YcR9tr6LFGa63oesb8jagUNgYZqo2UGVEcOAGvdogNUWLRTdHFYpQ== dependencies: - "@commercetools/sdk-client-v2" "^1.1.0" + "@commercetools/sdk-client-v2" "^1.3.0" "@commercetools/sdk-middleware-auth" "^6.0.4" "@commercetools/sdk-middleware-http" "^6.0.4" "@commercetools/sdk-middleware-logger" "^2.1.1" querystring "^0.2.1" -"@commercetools/sdk-client-v2@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-client-v2/-/sdk-client-v2-1.1.0.tgz#658e60f4a8a37465b2f29236e077af1a60887d34" - integrity sha512-5pZu/bIPKPoqPMLsUSYP2YgxBuAuY3kGB2rCWEel1HYyxfUDrFJqkOJnbIDE9PriEEIyLUa0vRJOc2ceIIvQIQ== +"@commercetools/sdk-client-v2@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@commercetools/sdk-client-v2/-/sdk-client-v2-1.3.0.tgz#3eccfd6d8601e5dc67f0e7c962f79672c69cd465" + integrity sha512-V1tvNzxXp8Cuevark5fTYCsQRYvUJsWQDRjqDjLCjdAXfkhyoUhmnsfYDkQucbNhmaBTCMQ93gr4/gAaKwnocw== dependencies: buffer "^6.0.3" node-fetch "^2.6.1" @@ -155,11 +161,6 @@ camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - chalk-animation@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/chalk-animation/-/chalk-animation-1.6.0.tgz#df7fa91c55a9ed2939d4d287a23ad0374479fad0" @@ -178,34 +179,34 @@ chalk@^2.3.2, chalk@^2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" -cli-highlight@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.4.tgz#098cb642cf17f42adc1c1145e07f960ec4d7522b" - integrity sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ== +cli-highlight@^2.1.11: + version "2.1.11" + resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.11.tgz#49736fa452f0aaf4fae580e30acb26828d2dc1bf" + integrity sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg== dependencies: - chalk "^3.0.0" - highlight.js "^9.6.0" + chalk "^4.0.0" + highlight.js "^10.7.1" mz "^2.4.0" parse5 "^5.1.1" - parse5-htmlparser2-tree-adapter "^5.1.1" - yargs "^15.0.0" + parse5-htmlparser2-tree-adapter "^6.0.0" + yargs "^16.0.0" -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" + wrap-ansi "^7.0.0" color-convert@^1.9.0: version "1.9.3" @@ -284,7 +285,7 @@ decamelize-keys@^1.0.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.1.0, decamelize@^1.2.0: +decamelize@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -326,6 +327,11 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -397,14 +403,6 @@ find-up@^2.0.0: dependencies: locate-path "^2.0.0" -find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" @@ -415,7 +413,7 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= -get-caller-file@^2.0.1: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -443,10 +441,10 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -highlight.js@^9.6.0: - version "9.18.3" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.3.tgz#a1a0a2028d5e3149e2380f8a865ee8516703d634" - integrity sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ== +highlight.js@^10.7.1: + version "10.7.3" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" + integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== hosted-git-info@^2.1.4, hosted-git-info@^2.8.9: version "2.8.9" @@ -550,13 +548,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - lodash@^4.17.21, lodash@^4.17.3: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -705,13 +696,6 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" @@ -719,23 +703,11 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -744,18 +716,23 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" -parse5-htmlparser2-tree-adapter@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz#e8c743d4e92194d5293ecde2b08be31e67461cbc" - integrity sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw== +parse5-htmlparser2-tree-adapter@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" + integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA== dependencies: - parse5 "^5.1.1" + parse5 "^6.0.1" parse5@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== +parse5@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -766,11 +743,6 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - path-parse@1.0.7, path-parse@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" @@ -811,11 +783,6 @@ querystring@^0.2.1: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== -querystring@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" - integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== - quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" @@ -866,11 +833,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - resolve@^1.10.0: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" @@ -922,11 +884,6 @@ serve-static@1.14.1: parseurl "~1.3.3" send "0.17.1" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - setprototypeof@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" @@ -1101,46 +1058,34 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" strip-ansi "^6.0.0" -y18n@^4.0.0, y18n@^5.0.5: +y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs@^15.0.0: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== +yargs@^16.0.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" + y18n "^5.0.5" + yargs-parser "^20.2.2" From 1bc524a41a21c7d8e79cb6844944866169b6c9a4 Mon Sep 17 00:00:00 2001 From: Sevtap Fernengel <92039320+sfernengel@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:33:32 +0200 Subject: [PATCH 17/18] Convert to TypeScript --- .env.sample | 13 - README.md | 14 +- ...roject_setup.js => Task01_project_setup.ts | 16 +- Task02_customers.js => Task02_customers.ts | 15 +- Task03_import_sync_products.js | 34 - Task03_import_sync_products.ts | 43 + Task04a_states.js => Task04a_states.ts | 18 +- Task04b_checkout.js | 56 - Task04b_checkout.ts | 70 + Task04c_merging.js | 33 - Task04c_merging.ts | 39 + Task05a_stores.js | 15 - Task05a_stores.ts | 56 + Task05b_product_selections.js | 25 - Task05b_product_selections.ts | 23 + Task05c_my.js | 12 - Task05c_my.ts | 40 + Task06a_search.js | 6 - Task06a_search.ts | 6 + Task06b_pagination.js | 25 - Task06b_pagination.ts | 33 + Task06c_graphql.js => Task06c_graphql.ts | 19 +- Task07a_custom_types.js | 34 - Task07a_custom_types.ts | 34 + ...om_objects.js => Task07b_custom_objects.ts | 19 +- Task07c_extensions.js | 24 - Task07c_extensions.ts | 21 + Task08_subscriptions.js | 28 - Task08_subscriptions.ts | 27 + env.sample | 45 + handson/client.js | 119 - handson/client.ts | 205 ++ handson/{customer.js => customer.ts} | 49 +- handson/importService.js | 104 - handson/importService.ts | 142 + handson/my.js | 17 - handson/my.ts | 71 + handson/order.js | 160 -- handson/order.ts | 231 ++ handson/payment.ts | 71 + handson/productSelections.js | 56 - handson/productSelections.ts | 59 + handson/search.js | 34 - handson/search.ts | 32 + handson/states.js | 57 - handson/states.ts | 65 + handson/store.js | 66 - handson/store.ts | 68 + package-lock.json | 2391 +++++++++++++++++ package.json | 55 +- tsconfig.json | 101 + types/global.d.ts | 7 + utils/config.ts | 24 + logger.js => utils/logger.ts | 9 +- yarn.lock | 1091 -------- 55 files changed, 4013 insertions(+), 2114 deletions(-) delete mode 100644 .env.sample rename Task01_project_setup.js => Task01_project_setup.ts (61%) rename Task02_customers.js => Task02_customers.ts (62%) delete mode 100644 Task03_import_sync_products.js create mode 100644 Task03_import_sync_products.ts rename Task04a_states.js => Task04a_states.ts (56%) delete mode 100644 Task04b_checkout.js create mode 100644 Task04b_checkout.ts delete mode 100644 Task04c_merging.js create mode 100644 Task04c_merging.ts delete mode 100644 Task05a_stores.js create mode 100644 Task05a_stores.ts delete mode 100644 Task05b_product_selections.js create mode 100644 Task05b_product_selections.ts delete mode 100644 Task05c_my.js create mode 100644 Task05c_my.ts delete mode 100644 Task06a_search.js create mode 100644 Task06a_search.ts delete mode 100644 Task06b_pagination.js create mode 100644 Task06b_pagination.ts rename Task06c_graphql.js => Task06c_graphql.ts (57%) delete mode 100644 Task07a_custom_types.js create mode 100644 Task07a_custom_types.ts rename Task07b_custom_objects.js => Task07b_custom_objects.ts (65%) delete mode 100644 Task07c_extensions.js create mode 100644 Task07c_extensions.ts delete mode 100644 Task08_subscriptions.js create mode 100644 Task08_subscriptions.ts create mode 100644 env.sample delete mode 100644 handson/client.js create mode 100644 handson/client.ts rename handson/{customer.js => customer.ts} (53%) delete mode 100644 handson/importService.js create mode 100644 handson/importService.ts delete mode 100644 handson/my.js create mode 100644 handson/my.ts delete mode 100644 handson/order.js create mode 100644 handson/order.ts create mode 100644 handson/payment.ts delete mode 100644 handson/productSelections.js create mode 100644 handson/productSelections.ts delete mode 100644 handson/search.js create mode 100644 handson/search.ts delete mode 100644 handson/states.js create mode 100644 handson/states.ts delete mode 100644 handson/store.js create mode 100644 handson/store.ts create mode 100644 package-lock.json create mode 100644 tsconfig.json create mode 100644 types/global.d.ts create mode 100644 utils/config.ts rename logger.js => utils/logger.ts (75%) delete mode 100644 yarn.lock diff --git a/.env.sample b/.env.sample deleted file mode 100644 index a6689a2..0000000 --- a/.env.sample +++ /dev/null @@ -1,13 +0,0 @@ -# admin api client -CTP_PROJECT_KEY= -CTP_CLIENT_SECRET= -CTP_CLIENT_ID= -CTP_AUTH_URL= -CTP_API_URL= -CTP_SCOPES= - -# admin api client - -# store api client - -# my api client \ No newline at end of file diff --git a/README.md b/README.md index 5e4a1b7..14618e7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ commercetools-js-sdk-v2-training https://ok.commercetools.com/training-offering-calendar -NEW JAVASCRIPT COURSE USING THE NEW COMMERCETOOLS JS SDK +NEW JAVASCRIPT COURSE USING THE NEW COMMERCETOOLS TypeScript SDK https://github.com/commercetools/commercetools-sdk-typescript#sdk Usage @@ -11,16 +11,16 @@ Usage Add API Client Credentials in .env.sample then remove the ".sample" file name should be only ".env" then follow your trainer instructions to solve the exercises. -Use the command `yarn` to install dependencies +Use the command `npm install` to install dependencies then you should be able to run any file using `yarn [fileNumber]` example -- yarn 1 -- yarn 4c -- yarn 6b +- npm run 1 +- npm run 4c +- npm run 6b The following (or later) must be installed before the TypeScript SDK can be used: -- Node v12.22.7 -- npm v6 OR yarn v1.22.17 +- Node v16 +- npm v8 for questions email training@commercetools.com \ No newline at end of file diff --git a/Task01_project_setup.js b/Task01_project_setup.ts similarity index 61% rename from Task01_project_setup.js rename to Task01_project_setup.ts index ef1731a..4075604 100644 --- a/Task01_project_setup.js +++ b/Task01_project_setup.ts @@ -1,5 +1,5 @@ -const { apiRoot, projectKey } = require("./handson/client.js"); -const { log } = require("./logger.js"); +import { log } from "./utils/logger"; +import { apiRoot } from "./handson/client"; // TODO 1: Complete the functions in // ./handson/client.js @@ -7,23 +7,23 @@ const { log } = require("./logger.js"); // https://docs.commercetools.com/http-api-projects-project.html#get-project apiRoot - .withProjectKey({ projectKey }) .get() .execute() -.then(log).catch(log); + .then(log) + .catch(log); apiRoot - .withProjectKey({ projectKey }) .shippingMethods() .withId({ ID: "d24e8501-65c0-4125-994d-7e9ba80724a5" }) .get() .execute() -.then(log).catch(log); + .then(log) + .catch(log); apiRoot - .withProjectKey({ projectKey }) .taxCategories() .withKey({ key: "standard-tax-category" }) .get() .execute() -.then(log).catch(log); + .then(log) + .catch(log); diff --git a/Task02_customers.js b/Task02_customers.ts similarity index 62% rename from Task02_customers.js rename to Task02_customers.ts index 48a8e62..2a2d4a5 100644 --- a/Task02_customers.js +++ b/Task02_customers.ts @@ -1,14 +1,15 @@ -const { +import { createCustomer, getCustomerById, getCustomerByKey, createCustomerToken, confirmCustomerEmail, assignCustomerToCustomerGroup, -} = require("./handson/customer"); -const { log } = require("./logger.js"); + CustomerDraftData, +} from "./handson/customer"; +import { log } from "./utils/logger"; -const customerDraftData = { +const customerDraftData: CustomerDraftData = { firstName: "test", lastName: "test", email: "test@test.com", @@ -19,14 +20,14 @@ const customerDraftData = { // createCustomer(customerDraftData).then(log).catch(log); -// getCustomerByKey('test123').then(log).catch(log); +// getCustomerByKey("test123").then(log).catch(log); // getCustomerById("a303f0e7-8535-4784-a638-e59f05208355").then(log).catch(log); -// getCustomerByKey('test123') +// getCustomerByKey("test123") // .then(createCustomerToken) // .then(confirmCustomerEmail) // .then(log) // .catch(log); -assignCustomerToCustomerGroup('test123','indoor-customers').then(log).catch(log); +// assignCustomerToCustomerGroup("test123", "indoor-customers").then(log).catch(log); diff --git a/Task03_import_sync_products.js b/Task03_import_sync_products.js deleted file mode 100644 index 6df6268..0000000 --- a/Task03_import_sync_products.js +++ /dev/null @@ -1,34 +0,0 @@ -const { createImportContainer, importProducts, checkImportSummary, checkImportOperationsStatus, checkImportOperationStatusById } = require("./handson/importService"); -const { log } = require("./logger.js"); - -const containerKey = "ff-ImportContainer"; - -// Create an import container -// createImportContainer(containerKey).then(log).catch(log); - -// import products -// importProducts(containerKey).then(log).catch(log); - -// check import summary for your container -checkImportSummary(containerKey).then(log).catch(log); - -// check import operations for your container -checkImportOperationsStatus(containerKey).then(operations => - operations.body.results.forEach(operation => - log(operation.id + " : " +operation.state) - ) -) - -// Check the status of import operations by their Ids -// checkImportOperationStatusById("2e325e01-1193-4d8a-92c9-af29da1cc0fb").then(log).catch(log); -// checkImportOperationStatusById("cd61acae-301d-4984-8dc2-2deb0ba5035c").then(log).catch(log); - -// https://github.com/commercetools/commercetools-project-sync#run -// docker run \ -// -e SOURCE_PROJECT_KEY=xxx \ -// -e SOURCE_CLIENT_ID=xxx \ -// -e SOURCE_CLIENT_SECRET=xxx \ -// -e TARGET_PROJECT_KEY=xxx \ -// -e TARGET_CLIENT_ID=xxx \ -// -e TARGET_CLIENT_SECRET=xxx \ -// commercetools/commercetools-project-sync:5.0.0 -s all diff --git a/Task03_import_sync_products.ts b/Task03_import_sync_products.ts new file mode 100644 index 0000000..e24fff1 --- /dev/null +++ b/Task03_import_sync_products.ts @@ -0,0 +1,43 @@ +import { + checkImportOperationStatusById, + checkImportSummary, + createImportContainer, + importProducts, + importPrices +} from "./handson/importService"; +import { log } from "./utils/logger"; + +const containerKey = "ff-ImportContainer"; + +// Create an import container +// createImportContainer(containerKey).then(log).catch(log); + +// import products +// importProducts(containerKey).then(log).catch(log); + +// Import prices +// importPrices(containerKey).then(log).catch(log); + +// check import summary for your container +// checkImportSummary(containerKey).then(log).catch(log); + +// check import operations for your container +// checkImportOperationsStatus(containerKey).then(operations => +// operations.body.results.forEach(operation => +// log(operation.id + " : " + operation.state) +// ) +// ) + +// Check the status of import operations by their Ids +checkImportOperationStatusById("9eee411c-a698-4e13-b1fd-0996180df437").then(log).catch(log); +checkImportOperationStatusById("340ec151-ebd3-422a-97a8-e7625e85633a").then(log).catch(log); + +// https://github.com/commercetools/commercetools-project-sync#run +// docker run \ +// -e SOURCE_PROJECT_KEY=xxx \ +// -e SOURCE_CLIENT_ID=xxx \ +// -e SOURCE_CLIENT_SECRET=xxx \ +// -e TARGET_PROJECT_KEY=xxx \ +// -e TARGET_CLIENT_ID=xxx \ +// -e TARGET_CLIENT_SECRET=xxx \ +// commercetools/commercetools-project-sync:5.0.0 -s all diff --git a/Task04a_states.js b/Task04a_states.ts similarity index 56% rename from Task04a_states.js rename to Task04a_states.ts index 6a8f9c8..6986c4c 100644 --- a/Task04a_states.js +++ b/Task04a_states.ts @@ -1,7 +1,7 @@ -const states = require("./handson/states"); -const { log } = require("./logger.js"); +import * as states from "./handson/states"; +import { log } from "./utils/logger"; -const orderPackedStateDraft = { +const orderPackedStateDraft: states.StateDraftData = { key: "ff-order-packed", type: "OrderState", name: { @@ -11,7 +11,7 @@ const orderPackedStateDraft = { initial: true, }; -const orderCompletedStateDraft = { +const orderCompletedStateDraft: states.StateDraftData = { key: "ff-order-completed", type: "OrderState", name: { @@ -24,14 +24,14 @@ const orderCompletedStateDraft = { const createStatesWithTransitions = async () => { let orderPackedState = await states.createNewState(orderPackedStateDraft) let orderCompletedState = await states.createNewState(orderCompletedStateDraft) - - orderPackedState = states.addTransition(orderPackedState.body.id, [orderCompletedState.body.id]) - - orderCompletedState = states.addTransition(orderCompletedState.body.id, []) + + orderPackedState = await states.addTransition(orderPackedState.body.id, [orderCompletedState.body.id]) + + orderCompletedState = await states.addTransition(orderCompletedState.body.id, []) return orderPackedState; }; createStatesWithTransitions().then(log).catch(log) -//states.getStateById(orderPackedState.id).then(log).catch(log) \ No newline at end of file +// states.getStateByKey(orderPackedStateDraft.key).then(log).catch(log) \ No newline at end of file diff --git a/Task04b_checkout.js b/Task04b_checkout.js deleted file mode 100644 index 0976140..0000000 --- a/Task04b_checkout.js +++ /dev/null @@ -1,56 +0,0 @@ -const checkout = require("./handson/order"); -const { log } = require("./logger.js"); - -const customerKey = ""; -const cartId = ""; -const orderId = ""; - -const paymentDraft = { - key:"payment" + Math.random().toString(36).substr(2, 5), - amountPlanned:{ - currencyCode: 'EUR', - centAmount: 5000 - } -} - -// create a cart and update the catId variable -// checkout.createCart(customerKey).then(log).catch(log); - -// checkout.addLineItemsToCart(cartId,['tulip-seed-box','tulip-seed-sack']).then(log).catch(log); - -// checkout.addDiscountCodeToCart(cartId, "SUMMER").then(log).catch(log); -// checkout.getCartById(cartId).then(log).catch(log); - -// create order from cart and update the orderId -// checkout.createOrderFromCart(cartId).then(log).catch(log); - -//checkout.getOrderById(orderId).then(log).catch(log); - -// set order state to confirmed and custom workflow state to order packed -// checkout.setOrderState(orderId, 'Confirmed').then(log).catch(log); -// checkout.updateOrderCustomState(orderId,"ff-order-packed").then(log).catch(log); - -const checkoutProcess = async () => { - let emptyCart = await checkout.createCart(customerKey); - - let filledCart = await checkout.addLineItemsToCart( - emptyCart.body.id,['tulip-seed-box','tulip-seed-sack'] - ); - filledCart = await checkout.addDiscountCodeToCart( - emptyCart.body.id, 'SUMMER' - ); - - let order = await checkout.createOrderFromCart(filledCart.body.id); - const payment = await checkout.createPayment(paymentDraft); - order = await checkout.addPaymentToOrder(order.body.id, payment.body.id); - order = await checkout.setOrderState(order.body.id, 'Confirmed'); - order = await checkout.updateOrderCustomState(order.body.id,'ff-order-packed'); - if (order) { - return { - status: 201, - message: "order created: " + order.body.id, - }; - } -}; - -checkoutProcess().then(log).catch(log); diff --git a/Task04b_checkout.ts b/Task04b_checkout.ts new file mode 100644 index 0000000..d766123 --- /dev/null +++ b/Task04b_checkout.ts @@ -0,0 +1,70 @@ +import * as checkout from "./handson/order"; +import { createPayment, PaymentDraftData } from "./handson/payment"; +import { log } from "./utils/logger"; + +const customerKey = "test123"; +const cartId = "5b92fd9f-bb9b-4cc8-9e41-4644fa419fae"; +const orderId = "57335b75-214d-4e49-9c2a-0d8eb6363875"; + +const paymentDraftData: PaymentDraftData = { + key: "payment" + Math.random().toString(36).substring(2, 7), + amountPlanned: { + currencyCode: "EUR", + centAmount: 5000 + }, + pspName: "We_Do_Payments", + pspMethod: "CREDIT_CARD", + interfaceId: "we_pay_73636" + Math.random(), // Must be unique. + interactionId: "pay82626" + Math.random() +} + +// create a cart and update the catId variable +// checkout.createCart(customerKey).then(log).catch(log); + +// checkout.addLineItemsToCart(cartId, "berlin-warehouse", ["tulip-seed-box", "tulip-seed-sack"]).then(log).catch(log); + +// checkout.addDiscountCodeToCart(cartId, "SUMMER").then(log).catch(log); +// checkout.recalculate(cartId).then(log).catch(log); +// checkout.setShippingMethod(cartId).then(log).catch(log); +// checkout.getCartById(cartId).then(log).catch(log); + +// create order from cart and update the orderId +// checkout.createOrderFromCart(cartId).then(log).catch(log); + +// checkout.getOrderById(orderId).then(log).catch(log); + +// set order state to confirmed and custom workflow state to order packed +// checkout.setOrderState(orderId, "Confirmed").then(log).catch(log); +// checkout.updateOrderCustomState(orderId, "ff-order-packed").then(log).catch(log); + +const checkoutProcess = async () => { + let emptyCart = await checkout.createCart(customerKey); + + let filledCart = await checkout.addLineItemsToCart( + emptyCart.body.id, "berlin-warehouse", ["tulip-seed-box", "tulip-seed-sack"] + ); + + + filledCart = await checkout.addDiscountCodeToCart( + filledCart.body.id, "SUMMER" + ); + + + filledCart = await checkout.recalculate(filledCart.body.id); + filledCart = await checkout.setShippingMethod(filledCart.body.id); + + const payment = await createPayment(paymentDraftData); + filledCart = await checkout.addPaymentToCart(filledCart.body.id, payment.body.id); + + let order = await checkout.createOrderFromCart(filledCart.body.id); + order = await checkout.setOrderState(order.body.id, "Confirmed"); + order = await checkout.updateOrderCustomState(order.body.id, "ff-order-packed"); + if (order) { + return { + status: 201, + message: "order created: " + order.body.id, + }; + } +}; + +checkoutProcess().then(log).catch(log); diff --git a/Task04c_merging.js b/Task04c_merging.js deleted file mode 100644 index 23de35d..0000000 --- a/Task04c_merging.js +++ /dev/null @@ -1,33 +0,0 @@ -const checkout = require("./handson/order"); -const { log } = require("./logger.js"); - -const customerKey = ""; - -const mergingProcessTest = async () => { - let anonymousCart = await checkout.createAnonymousCart(); - - let customerCart = await checkout.createCart(customerKey); - - anonymousCart = await checkout.addLineItemsToCart( anonymousCart.body.id,['tulip-seed-box','tulip-seed-box','tulip-seed-box'] ); - - customerCart = await checkout.addLineItemsToCart( customerCart.body.id, ['tulip-seed-box','tulip-seed-sack','tulip-seed-package'] ); - - log("Anonymous Cart: " + anonymousCart.body.id); - log("Customer Cart: "+ customerCart.body.id); - - const customerDetails = { - email: "test@test.com", - password: "password", - anonymousCartId: anonymousCart.body.id, - anonymousCartSignInMode: "MergeWithExistingCustomerCart", // try switching to UseAsNewActiveCustomerCart - }; - let result = await checkout.customerSignIn(customerDetails); - return result.body.cart; -}; -mergingProcessTest().then((cart) => { - log("Active cart: " + cart.id); - cart.lineItems.forEach(item => { - log(item.variant.sku+ " :" + item.quantity); - }); -}) -.catch(log); diff --git a/Task04c_merging.ts b/Task04c_merging.ts new file mode 100644 index 0000000..303f6ce --- /dev/null +++ b/Task04c_merging.ts @@ -0,0 +1,39 @@ +import { CustomerSignin } from "@commercetools/platform-sdk"; +import * as checkout from "./handson/order"; +import { log } from "./utils/logger"; + +const customerKey = "test123"; + +const mergingProcessTest = async () => { + let anonymousCart = await checkout.createAnonymousCart(); + + let customerCart = await checkout.createCart(customerKey); + + anonymousCart = await checkout.addLineItemsToCart(anonymousCart.body.id, "berlin-warehouse", + ['tulip-seed-box', 'tulip-seed-box', 'tulip-seed-box']); + + customerCart = await checkout.addLineItemsToCart(customerCart.body.id, "berlin-warehouse", + ['tulip-seed-box', 'tulip-seed-sack', 'tulip-seed-package']); + + log("Anonymous Cart: " + anonymousCart.body.id); + log("Customer Cart: " + customerCart.body.id); + + const customerDetails = { + email: "test@test.com", + password: "xxx", + anonymousCartId: anonymousCart.body.id, + anonymousCartSignInMode: "MergeWithExistingCustomerCart", // try switching to UseAsNewActiveCustomerCart + } as CustomerSignin; + + let result = await checkout.customerSignIn(customerDetails); + return result.body.cart; +}; + +mergingProcessTest() + .then((cart) => { + log("Active cart: " + cart!.id); + cart!.lineItems.forEach(item => { + log(item.variant.sku + " :" + item.quantity); + }); + }) + .catch(log); diff --git a/Task05a_stores.js b/Task05a_stores.js deleted file mode 100644 index 9202f7a..0000000 --- a/Task05a_stores.js +++ /dev/null @@ -1,15 +0,0 @@ -const {getStoreByKey, getCustomersInStore, createInStoreCart } = require("./handson/store"); -const { getCustomerByKey } = require("./handson/customer"); -const { log } = require("./logger"); - -// getStoreByKey('berlin-store').then(log).catch(log); - -getCustomersInStore('berlin-store').then(customers => { - log(customers.body.count); - customers.body.results.forEach(customer => - log(customer.id) - )}).catch(log); - -// getCustomerByKey("test123").then((customer) => { -// createInStoreCart("berlin-store",customer).then(log).catch(log); -// }).catch(log); diff --git a/Task05a_stores.ts b/Task05a_stores.ts new file mode 100644 index 0000000..23eeb69 --- /dev/null +++ b/Task05a_stores.ts @@ -0,0 +1,56 @@ +import { apiRoot, storeApiRoot } from "./handson/client"; +import { getStoreByKey, getCustomersInStore, createInStoreCart } from "./handson/store"; +import { getCustomerByKey } from "./handson/customer"; +import { log } from "./utils/logger"; + +const storeKey = "berlin-store"; +getStoreByKey("berlin-store").then(log).catch(log); + +getCustomersInStore("berlin-store").then(customers => { + log(customers.body.count); + customers.body.results.forEach(customer => + log(customer.id) + ) +}).catch(log); + +// getCustomerByKey("test123").then((customer) => { +// createInStoreCart("berlin-store", customer).then(log).catch(log); +// }).catch(log); + +// TODO: Create in-store cart with global API client +// Provide an API client with global permissions +// Provide a customer who is restricted to a store +// Note: A global cart creation should fail but an in-store cart should work + +// apiRoot +// .inStoreKeyWithStoreKeyValue({ storeKey }) +// .carts() +// .post({ +// body: { +// currency: "EUR", +// customerEmail: "test@test.com", +// customerId: "13d0071f-cf18-4d24-bfc1-508196acbe81", +// } +// }) +// .execute() +// .then(log) +// .catch(log); + +// TODO: Create in-store Cart with in-store API client +// Provide an API client with scope limited to a store +// Provide a global customer +// Try creating a global cart with a global customer and check the error message + +// storeApiRoot +// .inStoreKeyWithStoreKeyValue({ storeKey }) +// .carts() +// .post({ +// body: { +// currency: "EUR", +// customerEmail: "test.berlin@test.com", +// customerId: "13d0071f-cf18-4d24-bfc1-508196acbe81", +// } +// }) +// .execute() +// .then(log) +// .catch(log); \ No newline at end of file diff --git a/Task05b_product_selections.js b/Task05b_product_selections.js deleted file mode 100644 index 9396b6c..0000000 --- a/Task05b_product_selections.js +++ /dev/null @@ -1,25 +0,0 @@ -const { - getProductsInStore, - addProductSelectionToStore -} = require("./handson/store"); -const { - getProductSelectionByKey, - createProductSelection, - addProductsToProductSelection, - getProductsInProductSelection -} = require("./handson/productSelections"); - -const { log } = require("./logger"); -const productSelectionKey = "ff-berlin-store-selection"; - -// createProductSelection(productSelectionKey,"Berlin Store Selection").then(log).catch(log); - -// getProductSelectionByKey(productSelectionKey).then(log).catch(log); - -// addProductsToProductSelection(productSelectionKey,['tulip-seed-product']).then(log).catch(log); - -// addProductSelectionToStore("berlin-store",productSelectionKey).then(log).catch(log); - -// getProductsInProductSelection(productSelectionKey).then(log).catch(log); - -getProductsInStore("berlin-store").then(log).catch(log); diff --git a/Task05b_product_selections.ts b/Task05b_product_selections.ts new file mode 100644 index 0000000..e80b678 --- /dev/null +++ b/Task05b_product_selections.ts @@ -0,0 +1,23 @@ +import { getProductsInStore, addProductSelectionToStore } from "./handson/store"; +import { + getProductSelectionByKey, + createProductSelection, + addProductsToProductSelection, + getProductsInProductSelection +} from "./handson/productSelections"; + +import { log } from "./utils/logger"; + +const productSelectionKey = "ff-berlin-store-selection"; + +createProductSelection(productSelectionKey, "Berlin Store Selection").then(log).catch(log); + +// getProductSelectionByKey(productSelectionKey).then(log).catch(log); + +// addProductsToProductSelection(productSelectionKey, ['tulip-seed-product']).then(log).catch(log); + +// getProductsInProductSelection(productSelectionKey).then(log).catch(log); + +// addProductSelectionToStore("berlin-store", productSelectionKey).then(log).catch(log); + +// getProductsInStore("berlin-store").then(log).catch(log); \ No newline at end of file diff --git a/Task05c_my.js b/Task05c_my.js deleted file mode 100644 index 33abcb7..0000000 --- a/Task05c_my.js +++ /dev/null @@ -1,12 +0,0 @@ -const {getMe, getMyOrders } = require("./handson/my"); -const { log } = require("./logger"); - -// TODO: SPA api-client - -// getMe().then(log).catch(log); - -getMyOrders().then(orders => - orders.body.results.forEach(order => - log(order.id + " : " + order.totalPrice.centAmount) - ) -).catch(log); diff --git a/Task05c_my.ts b/Task05c_my.ts new file mode 100644 index 0000000..5ef32ff --- /dev/null +++ b/Task05c_my.ts @@ -0,0 +1,40 @@ +import { + getMe, + getMyOrders, + createMyCart, + getMyActiveCart, + // getStoreMe, + getStoreMyOrders, + createInStoreMyCart, + getStoreMyActiveCart, +} from "./handson/my"; +import { log } from "./utils/logger"; + +const customerEmail = "test@test.com"; +const storeCustomerEmail = "test.berlin@test.com"; + +// TODO: SPA api-client + +getMe().then(log).catch(log); + +getMyOrders() + .then(orders => + orders.body.results.forEach(order => + log(order.id + " : " + order.totalPrice.centAmount) + ) + ).catch(log); + +createMyCart(customerEmail).then(log).catch(log); + +getMyActiveCart().then(log).catch(log); + +// BUG: once SDK works with in-store client, enable these + +// getStoreMe().then(log).catch(log); + +// getStoreMyOrders().then(log).catch(log); + +// createInStoreMyCart(storeCustomerEmail).then(log).catch(log); + +// getStoreMyActiveCart().then(log).catch(log); + diff --git a/Task06a_search.js b/Task06a_search.js deleted file mode 100644 index 4f06b31..0000000 --- a/Task06a_search.js +++ /dev/null @@ -1,6 +0,0 @@ -const { getAllProducts, simulateSearch } = require("./handson/search"); -const { log } = require("./logger"); - -//getAllProducts().then(log).catch(log) - -simulateSearch().then(log).catch(log); diff --git a/Task06a_search.ts b/Task06a_search.ts new file mode 100644 index 0000000..40298f2 --- /dev/null +++ b/Task06a_search.ts @@ -0,0 +1,6 @@ +import { getAllProducts, simulateSearch } from "./handson/search"; +import { log } from "./utils/logger"; + +getAllProducts().then(log).catch(log) + +simulateSearch().then(log).catch(log); diff --git a/Task06b_pagination.js b/Task06b_pagination.js deleted file mode 100644 index d1a2b87..0000000 --- a/Task06b_pagination.js +++ /dev/null @@ -1,25 +0,0 @@ -const { simulatePagination } = require("./handson/search"); -const { log } = require("./logger"); - - -var perPage = 2, lastPage = false, products = null, lastId = null, where = null; - -const getPagedQueryResults = async _ => { - while (!lastPage){ - where = lastId != null ? `id > "${lastId}"`: null; - products = await simulatePagination(perPage,where) - log("//////////////////") - products.body.results.forEach(element => { - log(element.id) - }); - productCount = products.body.count; - if(productCount == perPage){ - lastId = products.body.results[productCount - 1].id; - } - else { - lastPage = true; - } - } -} - -getPagedQueryResults().catch(log); diff --git a/Task06b_pagination.ts b/Task06b_pagination.ts new file mode 100644 index 0000000..828dd65 --- /dev/null +++ b/Task06b_pagination.ts @@ -0,0 +1,33 @@ +import { ClientResponse, ProductPagedQueryResponse } from "@commercetools/platform-sdk"; +import { simulatePagination } from "./handson/search"; +import { log } from "./utils/logger"; + +let lastPage = false, + lastId: string | undefined, + products: ClientResponse, + productsCount = 0, + pageNumber = 0, + perPage = 2, + where: string | undefined; + +const getPagedQueryResults = async () => { + while (!lastPage) { + where = lastId !== undefined ? `id > "${lastId}"` : undefined; + products = await simulatePagination(perPage, where); + log(`==== Page number ${++pageNumber} ====`); + log(""); + products.body.results.forEach(element => { + log(element.id); + }); + log(""); + productsCount = products.body.count; + if (productsCount == perPage) { + lastId = products.body.results[productsCount - 1].id; + } + else { + lastPage = true; + } + } +} + +getPagedQueryResults().catch(log); diff --git a/Task06c_graphql.js b/Task06c_graphql.ts similarity index 57% rename from Task06c_graphql.js rename to Task06c_graphql.ts index 17e3774..148c519 100644 --- a/Task06c_graphql.js +++ b/Task06c_graphql.ts @@ -1,6 +1,5 @@ -const { apiRoot, projectKey } = require("./handson/client.js"); -const { log } = require("./logger"); - +import { apiRoot } from "./handson/client"; +import { log } from "./utils/logger"; const query = ` query { @@ -21,13 +20,13 @@ query { } } `; - -apiRoot.withProjectKey({projectKey}) + +apiRoot .graphql() .post({ - body:{ - query, - variables:{} - } + body: { + query, + variables: {} + } }).execute() -.then(log).catch(log) \ No newline at end of file + .then(log).catch(log) \ No newline at end of file diff --git a/Task07a_custom_types.js b/Task07a_custom_types.js deleted file mode 100644 index 49f91de..0000000 --- a/Task07a_custom_types.js +++ /dev/null @@ -1,34 +0,0 @@ -const { apiRoot, projectKey } = require("./handson/client.js"); -const {log} = require('./logger'); - - -const typeDraft = { - key:'ff-allowed-to-place-orders', - name:{ - "de":'ff allowed to place orders', - "en":'ff allowed to place orders' - }, - description:{ - "de":'allow a customer to place orders', - "en":'allow a customer to place orders' - }, - resourceTypeIds:['customer'], - fieldDefinitions:[{ - type:{ - name:'Boolean' - }, - name:'allowed-to-place-orders', - label:{ - "de":'Allowed to place orders', - "en":'Allowed to place orders' - }, - required:false, - }] -} - -apiRoot - .withProjectKey({ projectKey }) - .types() - .post({ body: typeDraft }) - .execute() -.then(log).catch(log); diff --git a/Task07a_custom_types.ts b/Task07a_custom_types.ts new file mode 100644 index 0000000..a9fd005 --- /dev/null +++ b/Task07a_custom_types.ts @@ -0,0 +1,34 @@ +import { TypeDraft } from "@commercetools/platform-sdk"; +import { apiRoot } from "./handson/client"; +import { log } from "./utils/logger"; + + +const typeDraft: TypeDraft = { + key: 'ff-allowed-to-place-orders', + name: { + "de": 'ff allowed to place orders', + "en": 'ff allowed to place orders' + }, + description: { + "de": 'allow a customer to place orders', + "en": 'allow a customer to place orders' + }, + resourceTypeIds: ['customer'], + fieldDefinitions: [{ + type: { + name: 'Boolean' + }, + name: 'allowed-to-place-orders', + label: { + "de": 'Allowed to place orders', + "en": 'Allowed to place orders' + }, + required: false, + }] +} + +apiRoot + .types() + .post({ body: typeDraft }) + .execute() + .then(log).catch(log); diff --git a/Task07b_custom_objects.js b/Task07b_custom_objects.ts similarity index 65% rename from Task07b_custom_objects.js rename to Task07b_custom_objects.ts index 60f401c..71c7129 100644 --- a/Task07b_custom_objects.js +++ b/Task07b_custom_objects.ts @@ -1,11 +1,10 @@ -const { apiRoot, projectKey } = require("./handson/client.js"); -const {log} = require('./logger'); +import { CustomObjectDraft } from "@commercetools/platform-sdk"; +import { apiRoot } from "./handson/client"; +import { log } from "./utils/logger"; - - -const customObjectDraft = { +const customObjectDraft: CustomObjectDraft = { container: "compatibility-info", - key:'tulip-seed-product', + key: "tulip-seed-product", value: { IncompatibleSKUs: "basil-seed-product", LeafletID: "leaflet_1234", @@ -19,14 +18,13 @@ const customObjectDraft = { } apiRoot - .withProjectKey({ projectKey }) .customObjects() .post({ body: customObjectDraft }) .execute() -.then(log).catch(log); + .then(log) + .catch(log); // apiRoot -// .withProjectKey({ projectKey }) // .customObjects() // .withContainerAndKey({ // container: "compatibility-info", @@ -34,4 +32,5 @@ apiRoot // }) // .get() // .execute() -// .then(log).catch(log); \ No newline at end of file +// .then(log) +// .catch(log); \ No newline at end of file diff --git a/Task07c_extensions.js b/Task07c_extensions.js deleted file mode 100644 index 1ea9794..0000000 --- a/Task07c_extensions.js +++ /dev/null @@ -1,24 +0,0 @@ -const { apiRoot, projectKey } = require("./handson/client.js"); -const {log} = require('./logger'); - - - -const extensionDraft = { - key:'orderChecker', - destination:{ - type:'HTTP', - url:'https://europe-west3-ct-support.cloudfunctions.net/training-extensions-sample' - }, - triggers:[{ - resourceTypeId:'order', - actions:['Create'] - }] -} - -apiRoot - .withProjectKey({ projectKey }) - .extensions() - .post({ body: extensionDraft }) - .execute() -.then(log).catch(log) - diff --git a/Task07c_extensions.ts b/Task07c_extensions.ts new file mode 100644 index 0000000..3754593 --- /dev/null +++ b/Task07c_extensions.ts @@ -0,0 +1,21 @@ +import { ExtensionDraft } from "@commercetools/platform-sdk"; +import { apiRoot } from "./handson/client"; +import { log } from "./utils/logger"; + +const extensionDraft: ExtensionDraft = { + key: "orderChecker", + destination: { + type: "HTTP", + url: "https://europe-west3-ct-support.cloudfunctions.net/training-extensions-sample" + }, + triggers: [{ + resourceTypeId: "order", + actions: ["Create"] + }] +} + +apiRoot + .extensions() + .post({ body: extensionDraft }) + .execute() + .then(log).catch(log) diff --git a/Task08_subscriptions.js b/Task08_subscriptions.js deleted file mode 100644 index c2f3c47..0000000 --- a/Task08_subscriptions.js +++ /dev/null @@ -1,28 +0,0 @@ -const { apiRoot, projectKey } = require("./handson/client.js"); -const {log} = require('./logger'); - -// key - String - Optional - User-specific unique identifier for the subscription -// destination - Destination - The Message Queue into which the notifications are to be sent -// messages - Array of MessageSubscription - Optional - The messages to be subscribed to. -// changes - -const subscriptionDraft = { - key:'subscriptionSample', - destination:{ - type:'GoogleCloudPubSub', - projectId:"ct-support", - topic:'training-subscription-sample' - }, - messages:[{ - resourceTypeId:'order', - type:'OrderCreated' - }], - -} - -apiRoot - .withProjectKey({ projectKey }) - .subscriptions() - .post({ body: subscriptionDraft }) - .execute() -.then(log).catch(log); diff --git a/Task08_subscriptions.ts b/Task08_subscriptions.ts new file mode 100644 index 0000000..949c144 --- /dev/null +++ b/Task08_subscriptions.ts @@ -0,0 +1,27 @@ +import { SubscriptionDraft } from "@commercetools/platform-sdk"; +import { apiRoot } from "./handson/client"; +import { log } from "./utils/logger"; + +// key - String - Optional - User-specific unique identifier for the subscription +// destination - Destination - The Message Queue into which the notifications are to be sent +// messages - Array of MessageSubscription - Optional - The messages to be subscribed to. +// changes + +const subscriptionDraft: SubscriptionDraft = { + key: "subscriptionSample", + destination: { + type: "GoogleCloudPubSub", + projectId: "ct-support", + topic: "training-subscription-sample" + }, + messages: [{ + resourceTypeId: "order", + types: ["OrderCreated"] + }] +} + +apiRoot + .subscriptions() + .post({ body: subscriptionDraft }) + .execute() + .then(log).catch(log); diff --git a/env.sample b/env.sample new file mode 100644 index 0000000..da4bb01 --- /dev/null +++ b/env.sample @@ -0,0 +1,45 @@ +# admin api client +DEV_PROJECT_KEY= +DEV_CLIENT_SECRET= +DEV_CLIENT_ID= +DEV_AUTH_URL= +DEV_API_URL= +DEV_SCOPES= + +# import api client +IMPORT_PROJECT_KEY= +IMPORT_CLIENT_SECRET= +IMPORT_CLIENT_ID= +IMPORT_AUTH_URL= +IMPORT_API_URL= +IMPORT_SCOPES= + +# store api client +BERLIN_PROJECT_KEY= +BERLIN_CLIENT_SECRET= +BERLIN_CLIENT_ID= +BERLIN_AUTH_URL= +BERLIN_API_URL= +BERLIN_SCOPES= +BERLIN_STORE_KEY= + +# my api client +ME_PROJECT_KEY= +ME_CLIENT_SECRET= +ME_CLIENT_ID= +ME_AUTH_URL= +ME_API_URL= +ME_SCOPES= +ME_CUSTOMER_EMAIL= +ME_CUSTOMER_PASSWORD= + +# in-store my api client +BERLIN_ME_PROJECT_KEY= +BERLIN_ME_CLIENT_SECRET= +BERLIN_ME_CLIENT_ID= +BERLIN_ME_AUTH_URL= +BERLIN_ME_API_URL= +BERLIN_ME_SCOPES= +BERLIN_ME_STORE_KEY= +BERLIN_ME_CUSTOMER_EMAIL= +BERLIN_ME_CUSTOMER_PASSWORD= \ No newline at end of file diff --git a/handson/client.js b/handson/client.js deleted file mode 100644 index 11ab447..0000000 --- a/handson/client.js +++ /dev/null @@ -1,119 +0,0 @@ -const { - createClient, - createHttpClient, - createAuthForClientCredentialsFlow, - createAuthForPasswordFlow -} = require ('@commercetools/sdk-client-v2') -const { createApiBuilderFromCtpClient } = require('@commercetools/platform-sdk') - -const { - createApiBuilderFromCtpClient: createApiBuilderFromCtpClientOnlyForImports, -} = require("@commercetools/importapi-sdk"); -require("dotenv").config(); - -const fetch = require("node-fetch"); - -const projectKey = process.env.CTP_PROJECT_KEY; - -const getClient = () => { - const authMiddleware = createAuthForClientCredentialsFlow({ - host: process.env.CTP_AUTH_URL, - projectKey, - credentials: { - clientId: process.env.CTP_CLIENT_ID, - clientSecret: process.env.CTP_CLIENT_SECRET, - }, - fetch, - }); - - const httpMiddleware = createHttpClient({ - host: process.env.CTP_API_URL, - fetch, - }); - - const ctpClient = createClient({ - middlewares: [authMiddleware, httpMiddleware], - }); - return ctpClient; -}; - -const getImportClient = () => { - const authMiddleware = createAuthForClientCredentialsFlow({ - host: process.env.IMPORT_AUTH_URL, - projectKey, - credentials: { - clientId: process.env.IMPORT_CLIENT_ID, - clientSecret: process.env.IMPORT_CLIENT_SECRET, - }, - fetch, - }); - - const httpMiddleware = createHttpClient({ - host: process.env.IMPORT_API_URL, - fetch, - }); - - const importClient = createClient({ - middlewares: [authMiddleware, httpMiddleware], - }); - return importClient; -}; - -const getStoreClient = () => { - const authMiddleware = createAuthForClientCredentialsFlow({ - host: process.env.STORE_AUTH_URL, - projectKey, - credentials: { - clientId: process.env.STORE_CLIENT_ID, - clientSecret: process.env.STORE_CLIENT_SECRET, - }, - fetch, - }); - - const httpMiddleware = createHttpClient({ - host: process.env.STORE_API_URL, - fetch, - }); - - const storeClient = createClient({ - middlewares: [authMiddleware, httpMiddleware], - }); - return storeClient; -}; - - -const getMyAPIClient = () => { - const authMiddleware = createAuthForPasswordFlow({ - host: process.env.ME_AUTH_URL, - projectKey, - credentials: { - clientId: process.env.ME_CLIENT_ID, - clientSecret: process.env.ME_CLIENT_SECRET, - user: { - username: "test@test.com", - password: "password", - }, - }, - fetch, - }); - const httpMiddleware = createHttpClient({ - host: process.env.ME_API_URL, - fetch, - }); - - const ctpClient = createClient({ - middlewares: [authMiddleware, httpMiddleware], - }); - return ctpClient; -}; - -module.exports.apiRoot = createApiBuilderFromCtpClient(getClient()); - -module.exports.importApiRoot = createApiBuilderFromCtpClientOnlyForImports( - getImportClient() -); - -module.exports.storeApiRoot = createApiBuilderFromCtpClient(getStoreClient()); - -module.exports.myApiRoot = createApiBuilderFromCtpClient(getMyAPIClient()); -module.exports.projectKey = projectKey; diff --git a/handson/client.ts b/handson/client.ts new file mode 100644 index 0000000..35dae3a --- /dev/null +++ b/handson/client.ts @@ -0,0 +1,205 @@ +import { AuthMiddlewareOptions, ClientBuilder, HttpMiddlewareOptions, PasswordAuthMiddlewareOptions } from "@commercetools/sdk-client-v2"; +import { createApiBuilderFromCtpClient } from "@commercetools/platform-sdk"; +import { createApiBuilderFromCtpClient as createImportApiBuilderFromCtpClient } from "@commercetools/importapi-sdk"; +import fetch from "node-fetch"; +import { Prefix, readConfig } from "../utils/config"; + + +const createApiClient = (prefix: Prefix) => { + const { + clientId, + clientSecret, + projectKey, + oauthHost, + host, + } = readConfig(prefix); + + const authMiddlewareOptions: AuthMiddlewareOptions = { + host: oauthHost, + projectKey, + credentials: { + clientId, + clientSecret + }, + fetch + }; + + const httpMiddlewareOptions: HttpMiddlewareOptions = { + host: host, + fetch + }; + + const client = new ClientBuilder() + .withClientCredentialsFlow(authMiddlewareOptions) + .withHttpMiddleware(httpMiddlewareOptions) + .build(); + + const apiRoot = createApiBuilderFromCtpClient(client) + .withProjectKey({ projectKey }); + + return apiRoot; + +} + +const createImportApiClient = (prefix: Prefix) => { + const { + clientId, + clientSecret, + projectKey, + oauthHost, + host, + } = readConfig(prefix); + + const authMiddlewareOptions: AuthMiddlewareOptions = { + host: oauthHost, + projectKey, + credentials: { + clientId, + clientSecret + }, + fetch + }; + + const httpMiddlewareOptions: HttpMiddlewareOptions = { + host: host, + fetch + }; + + const client = new ClientBuilder() + .withClientCredentialsFlow(authMiddlewareOptions) + .withHttpMiddleware(httpMiddlewareOptions) + .build(); + + const importApiRoot = createImportApiBuilderFromCtpClient(client) + .withProjectKeyValue({ projectKey }); + + return importApiRoot; +} + +const createStoreApiClient = (prefix: Prefix) => { + const { + clientId, + clientSecret, + projectKey, + oauthHost, + host, + storeKey + } = readConfig(prefix); + + const authMiddlewareOptions: AuthMiddlewareOptions = { + host: oauthHost, + projectKey, + credentials: { + clientId, + clientSecret + }, + fetch + }; + + const httpMiddlewareOptions: HttpMiddlewareOptions = { + host: host, + fetch + }; + + const client = new ClientBuilder() + .withClientCredentialsFlow(authMiddlewareOptions) + .withHttpMiddleware(httpMiddlewareOptions) + .build(); + + const storeApiRoot = createApiBuilderFromCtpClient(client) + .withProjectKey({ projectKey }); + // .inStoreKeyWithStoreKeyValue({ storeKey }); + + return storeApiRoot; +} + +const createMyApiClient = (prefix: Prefix) => { + const { + clientId, + clientSecret, + projectKey, + oauthHost, + host, + username, + password + } = readConfig(prefix); + + const passwordAuthMiddlewareOptions: PasswordAuthMiddlewareOptions = { + host: oauthHost, + projectKey, + credentials: { + clientId, + clientSecret, + user: { + username, + password + } + }, + fetch + }; + + const httpMiddlewareOptions: HttpMiddlewareOptions = { + host: host, + fetch + }; + + const client = new ClientBuilder() + .withPasswordFlow(passwordAuthMiddlewareOptions) + .withHttpMiddleware(httpMiddlewareOptions) + .build(); + + const myApiRoot = createApiBuilderFromCtpClient(client) + .withProjectKey({ projectKey }); + + return myApiRoot; +} + +const createStoreMyApiClient = (prefix: Prefix) => { + const { + clientId, + clientSecret, + projectKey, + oauthHost, + host, + storeKey, + username, + password + } = readConfig(prefix); + + const passwordAuthMiddlewareOptions: PasswordAuthMiddlewareOptions = { + host: oauthHost, + projectKey, + // oauthUri: `/oauth/in-store/key=berlin-store/customers/token`, + credentials: { + clientId, + clientSecret, + user: { + username, + password + } + }, + fetch + }; + + const httpMiddlewareOptions: HttpMiddlewareOptions = { + host: host, + fetch + }; + + const client = new ClientBuilder() + .withPasswordFlow(passwordAuthMiddlewareOptions) + .withHttpMiddleware(httpMiddlewareOptions) + .build(); + + const storeMyApiRoot = createApiBuilderFromCtpClient(client) + .withProjectKey({ projectKey }) + .inStoreKeyWithStoreKeyValue({ storeKey }); + + return storeMyApiRoot; +} + +export const apiRoot = createApiClient(Prefix.DEV); +export const importApiRoot = createImportApiClient(Prefix.IMPORT); +export const storeApiRoot = createStoreApiClient(Prefix.STORE); +export const myApiRoot = createMyApiClient(Prefix.ME); +export const storeMyApiRoot = createStoreMyApiClient(Prefix.STORE_ME); \ No newline at end of file diff --git a/handson/customer.js b/handson/customer.ts similarity index 53% rename from handson/customer.js rename to handson/customer.ts index 919927b..51e45c5 100644 --- a/handson/customer.js +++ b/handson/customer.ts @@ -1,22 +1,30 @@ -const { apiRoot, projectKey } = require("./client.js"); +import { apiRoot } from "./client"; +import { ClientResponse, Customer, CustomerDraft, CustomerToken, CustomerUpdateAction } from "@commercetools/platform-sdk"; -module.exports.getCustomerById = (ID) => +export const getCustomerById = (ID: string) => apiRoot - .withProjectKey({ projectKey }) .customers() .withId({ ID }) .get() .execute(); - -module.exports.getCustomerByKey = (key) => + +export const getCustomerByKey = (key: string) => apiRoot - .withProjectKey({ projectKey }) .customers() .withKey({ key }) .get() .execute(); -const createCustomerDraft = (customerData) => { +export interface CustomerDraftData { + firstName?: string; + lastName?: string; + email: string; + password: string; + key: string; + countryCode: string; +}; + +const createCustomerDraft = (customerDraftData: CustomerDraftData): CustomerDraft => { const { email, password, @@ -24,7 +32,7 @@ const createCustomerDraft = (customerData) => { lastName, countryCode, key, - } = customerData; + } = customerDraftData; return { email, password, @@ -41,18 +49,16 @@ const createCustomerDraft = (customerData) => { }; }; -module.exports.createCustomer = (customerData) => +export const createCustomer = (customerDraftData: CustomerDraftData) => apiRoot - .withProjectKey({ projectKey }) .customers() .post({ - body: createCustomerDraft(customerData), + body: createCustomerDraft(customerDraftData), }) .execute(); -module.exports.createCustomerToken = (customer) => +export const createCustomerToken = (customer: ClientResponse) => apiRoot - .withProjectKey({ projectKey }) .customers() .emailToken() .post({ @@ -64,9 +70,8 @@ module.exports.createCustomerToken = (customer) => }) .execute(); -module.exports.confirmCustomerEmail = (token) => +export const confirmCustomerEmail = (token: ClientResponse) => apiRoot - .withProjectKey({ projectKey }) .customers() .emailConfirm() .post({ @@ -75,22 +80,22 @@ module.exports.confirmCustomerEmail = (token) => }, }) .execute(); - -module.exports.assignCustomerToCustomerGroup = ( - customerKey, - customerGroupKey + +export const assignCustomerToCustomerGroup = ( + customerKey: string, + customerGroupKey: string ) => { - return getCustomerByKey(customerKey).then((customer) => { - const updateActions = [ + return getCustomerByKey(customerKey).then((customer: ClientResponse) => { + const updateActions: [CustomerUpdateAction] = [ { action: "setCustomerGroup", customerGroup: { + typeId: "customer-group", key: customerGroupKey, }, }, ]; return apiRoot - .withProjectKey({ projectKey }) .customers() .withId({ ID: customer.body.id }) .post({ diff --git a/handson/importService.js b/handson/importService.js deleted file mode 100644 index 4e482d3..0000000 --- a/handson/importService.js +++ /dev/null @@ -1,104 +0,0 @@ -const { importApiRoot, projectKey } = require("./client.js"); -const csvtojsonV2 = require("csvtojson"); - -module.exports.createImportContainer = (key) => - importApiRoot - .withProjectKeyValue({ projectKey }) - .importContainers() - .post({ - body: {key}, - }) - .execute(); - -module.exports.checkImportSummary = (importContainerKey) => - importApiRoot - .withProjectKeyValue({projectKey}) - .importContainers() - .withImportContainerKeyValue({importContainerKey}) - .importSummaries() - .get() - .execute(); - -module.exports.checkImportOperationsStatus = (importContainerKey) => - importApiRoot - .withProjectKeyValue({ projectKey }) - .importContainers() - .withImportContainerKeyValue({importContainerKey}) - .importOperations() - .get( { queryArgs: { debug: true } } ) - .execute(); - -module.exports.checkImportOperationStatusById = (id) => - importApiRoot - .withProjectKeyValue({ projectKey }) - .importOperations() - .withIdValue({id}) - .get() - .execute(); - -module.exports.importProducts = async (importContainerKey) => - importApiRoot - .withProjectKeyValue({ projectKey }) - .productDrafts() - .importContainers() - .withImportContainerKeyValue({importContainerKey}) - .post({ - body: await createImportProductsDraft(), - }) - .execute(); - -const createImportProductsDraft = async () => { - return { - type: "product-draft", - resources: await getProductDraftsArray(), - }; -}; - -const getProductDraftsArray = () => { - // get data from csv - // create product drafts array and send it back - let productDraftsArray = []; - let participantNamePrefix = "ff"; - return csvtojsonV2() - .fromFile("./products.csv") - .then((products) => { - products.forEach((product) => { - productDraftsArray.push({ - key: participantNamePrefix + "-" + product.productName, - name: { - "de": product.productName, - }, - productType: { - typeId: "product-type", - key: product.productType, - }, - slug: { - "de": participantNamePrefix + "-" + product.productName, - }, - description: { - "de": product.productDescription, - }, - masterVariant: { - sku: product.inventoryId, - key: participantNamePrefix + "-" + product.productName, - prices: [ - { - value: { - type: "centPrecision", - currencyCode: product.currencyCode, - centAmount: parseInt(product.basePrice), - }, - }, - ], - images: [ - { - url: product.imageUrl, - dimensions: { w: 177, h: 237 }, - }, - ], - }, - }); - }); - return productDraftsArray; - }); -}; diff --git a/handson/importService.ts b/handson/importService.ts new file mode 100644 index 0000000..fe188bf --- /dev/null +++ b/handson/importService.ts @@ -0,0 +1,142 @@ +import { ProductDraftImport, ProductDraftImportRequest, PriceImportRequest } from "@commercetools/importapi-sdk"; +import csvtojsonV2 from "csvtojson"; +import { importApiRoot } from "./client"; + +export const createImportContainer = (key: string) => + importApiRoot + .importContainers() + .post({ + body: { key }, + }) + .execute(); + +export const checkImportSummary = (importContainerKey: string) => + importApiRoot + .importContainers() + .withImportContainerKeyValue({ importContainerKey }) + .importSummaries() + .get() + .execute(); + +export const checkImportOperationsStatus = (importContainerKey: string) => + importApiRoot + .importContainers() + .withImportContainerKeyValue({ importContainerKey }) + .importOperations() + .get({ queryArgs: { debug: true } }) + .execute(); + +export const checkImportOperationStatusById = (id: string) => + importApiRoot + .importOperations() + .withIdValue({ id }) + .get() + .execute(); + +export const importProducts = async (importContainerKey: string) => + importApiRoot + .productDrafts() + .importContainers() + .withImportContainerKeyValue({ importContainerKey }) + .post({ + body: await createProductDraftImportRequest(), + }) + .execute(); + +const createProductDraftImportRequest = async (): Promise => { + return { + type: "product-draft", + resources: await getProductDraftImportArray(), + }; +}; + + +const getProductDraftImportArray = async (): Promise> => { + + const participantNamePrefix = "ff"; + + // Get products data from csv + const products = await csvtojsonV2() + .fromFile("./products.csv"); + + interface ProductDraftData { + [key: string]: string + } + + const productToProductDraftImport = (product: ProductDraftData): ProductDraftImport => { + return { + key: participantNamePrefix + "-" + product.productName, + name: { + "en": product.productName, + "de": product.productName + }, + productType: { + typeId: "product-type", + key: product.productType + }, + slug: { + "en": participantNamePrefix + "-" + product.productName, + "de": participantNamePrefix + "-" + product.productName + }, + description: { + "en": product.description, + "de": product.description + }, + masterVariant: { + sku: participantNamePrefix + "-" + product.inventoryId, + key: participantNamePrefix + "-" + product.productName, + prices: [ + { + value: { + type: "centPrecision", + currencyCode: product.currencyCode, + centAmount: parseInt(product.basePrice, 10) + } + } + ], + images: [ + { + url: product.imageUrl, + dimensions: { w: 177, h: 237 } + } + ] + } + }; + } + + return products.map(productToProductDraftImport); +} + +export const importPrices = async (importContainerKey: string) => + importApiRoot + .prices() + .importContainers() + .withImportContainerKeyValue({ importContainerKey }) + .post({ + body: createPriceImportRequest() + }) + .execute(); + +const createPriceImportRequest = (): PriceImportRequest => { + return { + type: "price", + resources: [ + { + key: "sf-price-import-redWine-key", + product: { + typeId: "product", + key: "sfs-RedWine" + }, + "productVariant": { + typeId: "product-variant", + key: "sfs-RedWine" + }, + value: { + "type": "centPrecision", + "currencyCode": "EUR", + "centAmount": 3000 + }, + } + ] + }; +} \ No newline at end of file diff --git a/handson/my.js b/handson/my.js deleted file mode 100644 index f41b296..0000000 --- a/handson/my.js +++ /dev/null @@ -1,17 +0,0 @@ -const { myApiRoot, projectKey } = require("./client.js"); - -//TODO me endpoint - - -module.exports.getMe = () => - myApiRoot.withProjectKey({ projectKey }) - .me() - .get() - .execute(); - - module.exports.getMyOrders = () => - myApiRoot.withProjectKey({ projectKey }) - .me() - .orders() - .get() - .execute(); \ No newline at end of file diff --git a/handson/my.ts b/handson/my.ts new file mode 100644 index 0000000..59b0b3f --- /dev/null +++ b/handson/my.ts @@ -0,0 +1,71 @@ +import { myApiRoot, storeMyApiRoot } from "./client"; + +//TODO me endpoint + +export const getMe = () => + myApiRoot + .me() + .get() + .execute(); + +export const getMyOrders = () => + myApiRoot + .me() + .orders() + .get() + .execute(); + +export const createMyCart = (customerEmail: string) => + myApiRoot + .me() + .carts() + .post({ + body: { + currency: "EUR", + customerEmail + } + }) + .execute(); + +export const getMyActiveCart = () => + myApiRoot + .me() + .activeCart() + .get() + .execute(); + +// TODO in-store me endpoint + +// BUG: currently get method not existant, once SDK is fixed enable this +// export const getStoreMe = () => +// storeMyApiRoot +// .me() +// .get() +// .execute(); + +// BUG: until sdk-client is fixed don't run the code pieces below this point +export const getStoreMyOrders = () => + storeMyApiRoot + .me() + .orders() + .get() + .execute(); + +export const createInStoreMyCart = (customerEmail: string) => + storeMyApiRoot + .me() + .carts() + .post({ + body: { + currency: "EUR", + customerEmail + } + }) + .execute(); + +export const getStoreMyActiveCart = () => + storeMyApiRoot + .me() + .activeCart() + .get() + .execute(); \ No newline at end of file diff --git a/handson/order.js b/handson/order.js deleted file mode 100644 index 9d40eca..0000000 --- a/handson/order.js +++ /dev/null @@ -1,160 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); -const { getCustomerByKey } = require( "./customer.js" ); - -module.exports.createCart = (customerKey) => -getCustomerByKey(customerKey).then((customer) => - apiRoot.withProjectKey({ projectKey }) - .carts() - .post({ - body: { - currency: "EUR", - country: "DE", - customerId: customer.body.id, - customerEmail: customer.body.email, - shippingAddress: customer.body.addresses.find(address => address.id == customer.body.defaultShippingAddressId) - } - }) - .execute() -) - -module.exports.createAnonymousCart = () => - apiRoot.withProjectKey({ projectKey }) - .carts() - .post({ - body: { - currency: "EUR", - country: "DE", - } - }) - .execute() - -module.exports.customerSignIn = (customerDetails) => - apiRoot.withProjectKey({ projectKey }) - .login() - .post({ body: customerDetails }) - .execute(); - -module.exports.getCartById = (ID) => - apiRoot.withProjectKey({ projectKey }).carts().withId({ ID }).get().execute(); - -module.exports.addLineItemsToCart = (cartId, arrayOfSKUs) => - this.getCartById(cartId).then((cart) => - apiRoot.withProjectKey({projectKey}) - .carts() - .withId({ID: cartId}) - .post({ - body: { - version: cart.body.version, - actions: arrayOfSKUs.map((sku) => { - return { - action: "addLineItem", - sku - }; - } - ) - } - }) - .execute() - ) - -module.exports.addDiscountCodeToCart = (cartId, discountCode) => - this.getCartById(cartId).then((cart) => - apiRoot.withProjectKey({ projectKey }) - .carts() - .withId({ ID: cartId }) - .post({ - body: { - actions: [ { - action: "addDiscountCode", - code: discountCode, - } ], - version: cart.body.version, - }, - }) - .execute() - ) - -module.exports.createOrderFromCart = (cartId) => - createOrderFromCartDraft(cartId).then((orderFromCartDraft) => - apiRoot.withProjectKey({ projectKey }) - .orders() - .post({ - body: orderFromCartDraft, - }) - .execute() - ) - -const createOrderFromCartDraft = (cartId) => - this.getCartById(cartId).then((cart) => { - return { - id: cart.body.id, - version: cart.body.version, - }; - }) - -module.exports.getOrderById = (ID) => - apiRoot.withProjectKey({ projectKey }) - .orders() - .withId({ ID }) - .get() - .execute() - -module.exports.updateOrderCustomState = (orderId, customStateKey) => - this.getOrderById(orderId).then((order) => - apiRoot.withProjectKey({ projectKey }) - .orders() - .withId({ - ID: orderId, - }) - .post({ - body: { - actions: [ { - action: "transitionState", - state: { key: customStateKey } - } ], - version: order.body.version - } - }) - .execute() - ) - -module.exports.createPayment = (paymentDraft) => - apiRoot.withProjectKey({ projectKey }) - .payments() - .post({ body: paymentDraft }) - .execute() - -module.exports.setOrderState = (orderId, stateName) => - this.getOrderById(orderId).then((order) => - apiRoot.withProjectKey({ projectKey }) - .orders() - .withId({ ID: orderId }) - .post({ - body: { - version: order.body.version, - actions: [ { - action: "changeOrderState", - orderState: stateName - } ] - } - }) - .execute() - ) - - -module.exports.addPaymentToOrder = (orderId, paymentId) => - this.getOrderById(orderId).then((order) => - apiRoot.withProjectKey({ projectKey }) - .orders() - .withId({ ID: orderId }) - .post({ - body: { - version: order.body.version, - actions: [ { - action: "addPayment", - payment: { id: paymentId } - } ] - } - }) - .execute() - ) diff --git a/handson/order.ts b/handson/order.ts new file mode 100644 index 0000000..4990abf --- /dev/null +++ b/handson/order.ts @@ -0,0 +1,231 @@ +import { CartUpdateAction, CustomerSignin, OrderState } from "@commercetools/platform-sdk"; +import { apiRoot } from "./client"; +import { getCustomerByKey } from "./customer"; + +export const createCart = (customerKey: string) => + getCustomerByKey(customerKey).then((customer) => + apiRoot + .carts() + .post({ + body: { + currency: "EUR", + country: "DE", + customerId: customer.body.id, + customerEmail: customer.body.email, + shippingAddress: customer.body.addresses.find(address => address.id == customer.body.defaultShippingAddressId), + inventoryMode: "ReserveOnOrder", + deleteDaysAfterLastModification: 90 + } + }) + .execute() + ); + +export const createAnonymousCart = () => + apiRoot + .carts() + .post({ + body: { + currency: "EUR", + country: "DE", + } + }) + .execute(); + +export const customerSignIn = (customerDetails: CustomerSignin) => + apiRoot + .login() + .post({ body: customerDetails }) + .execute(); + +export const getCartById = (ID: string) => + apiRoot + .carts() + .withId({ ID }) + .get() + .execute(); + +export const addLineItemsToCart = (cartId: string, channelKey: string, arrayOfSKUs: Array) => + getCartById(cartId) + .then((cart) => + apiRoot + .carts() + .withId({ ID: cartId }) + .post({ + body: { + version: cart.body.version, + actions: arrayOfSKUs.map((sku) => { + return { + action: "addLineItem", + sku, + supplyChannel: { + typeId: "channel", + key: channelKey + }, + }; + }) + } + }) + .execute() + ); + +export const addDiscountCodeToCart = (cartId: string, discountCode: string) => + getCartById(cartId) + .then((cart) => + apiRoot + .carts() + .withId({ ID: cartId }) + .post({ + body: { + actions: [{ + action: "addDiscountCode", + code: discountCode, + }], + version: cart.body.version, + }, + }) + .execute() + ); + +export const recalculate = (cartId: string) => + getCartById(cartId) + .then((cart) => + apiRoot + .carts() + .withId({ ID: cartId }) + .post({ + body: { + actions: [{ + action: "recalculate", + }], + version: cart.body.version, + }, + }) + .execute() + ); + +export const setShippingMethod = async (cartId: string) => { + const matchingShippingMethod = await apiRoot + .shippingMethods() + .matchingCart() + .get({ + queryArgs: { + cartId + } + }) + .execute() + .then(response => response.body.results[0]); + + return getCartById(cartId) + .then(cart => + apiRoot + .carts() + .withId({ ID: cartId }) + .post({ + body: { + actions: [{ + action: "setShippingMethod", + shippingMethod: { + typeId: "shipping-method", + id: matchingShippingMethod.id + } + }], + version: cart.body.version + } + }) + .execute() + ); + +} + + +export const createOrderFromCart = (cartId: string) => + createOrderFromCartDraft(cartId) + .then((orderFromCartDraft) => + apiRoot + .orders() + .post({ + body: orderFromCartDraft, + }) + .execute() + ); + +const createOrderFromCartDraft = (cartId: string) => + getCartById(cartId) + .then((cart) => { + return { + id: cart.body.id, + version: cart.body.version, + }; + }); + +export const getOrderById = (ID: string) => + apiRoot + .orders() + .withId({ ID }) + .get() + .execute(); + +export const updateOrderCustomState = (orderId: string, customStateKey: string) => + getOrderById(orderId) + .then((order) => + apiRoot + .orders() + .withId({ + ID: orderId, + }) + .post({ + body: { + actions: [{ + action: "transitionState", + state: { + typeId: "state", + key: customStateKey + } + }], + version: order.body.version + } + }) + .execute() + ); + + + +export const setOrderState = (orderId: string, stateName: OrderState) => + getOrderById(orderId) + .then((order) => + apiRoot + .orders() + .withId({ ID: orderId }) + .post({ + body: { + version: order.body.version, + actions: [{ + action: "changeOrderState", + orderState: stateName + }] + } + }) + .execute() + ); + + +export const addPaymentToCart = (cartId: string, paymentId: string) => + getCartById(cartId) + .then((cart) => + apiRoot + .carts() + .withId({ ID: cartId }) + .post({ + body: { + version: cart.body.version, + actions: [{ + action: "addPayment", + payment: { + typeId: "payment", + id: paymentId + } + }] + } + }) + .execute() + ); diff --git a/handson/payment.ts b/handson/payment.ts new file mode 100644 index 0000000..c9459d0 --- /dev/null +++ b/handson/payment.ts @@ -0,0 +1,71 @@ +import { Money, PaymentDraft, TransactionDraft } from "@commercetools/platform-sdk"; +import { apiRoot } from "./client"; + +export interface PaymentDraftData { + key: string; + amountPlanned: Money; + pspName: string + pspMethod: string + interfaceId: string; + interactionId: string; +} + +export const createPayment = async (paymentDraftData: PaymentDraftData) => + apiRoot + .payments() + .post({ body: createPaymentDraft(paymentDraftData) }) + .execute() + .then(payment => + apiRoot + .payments() + .withId({ ID: payment.body.id }) + .post({ + body: { + actions: [ + { + action: "addTransaction", + transaction: createTransactionDraft(paymentDraftData) + }, + { + action: "setStatusInterfaceCode", + interfaceCode: "SUCCES" + }, + { + action: "setStatusInterfaceText", + interfaceText: "We got the money" + } + ], + version: payment.body.version + } + }) + .execute() + ); + +const createPaymentDraft = (paymentDraftData: PaymentDraftData): PaymentDraft => { + const { + key, + amountPlanned, + pspName, + pspMethod, + interfaceId, + } = paymentDraftData; + return { + key, + amountPlanned, + paymentMethodInfo: { + paymentInterface: pspName, + method: pspMethod, + }, + interfaceId + }; +}; + +const createTransactionDraft = (paymentDraftData: PaymentDraftData): TransactionDraft => { + return { + type: "Charge", + amount: paymentDraftData.amountPlanned, + interactionId: paymentDraftData.interactionId, + state: "Initial", + timestamp: new Date().toISOString() + } +}; \ No newline at end of file diff --git a/handson/productSelections.js b/handson/productSelections.js deleted file mode 100644 index c74ccb2..0000000 --- a/handson/productSelections.js +++ /dev/null @@ -1,56 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -//TODO Product Selections - -module.exports.getProductSelectionByKey = (key) => - apiRoot.withProjectKey({ projectKey }) - .productSelections() - .withKey({ key }) - .get() - .execute(); - -module.exports.createProductSelection = (key,name) => - apiRoot.withProjectKey({ projectKey }) - .productSelections() - .post({ - body: { - key: key, - name: {"en":name} - } - } - ) - .execute(); - -module.exports.addProductsToProductSelection = async ( - productSelectionKey, - arrayOfProductKeys -) => - this.getProductSelectionByKey(productSelectionKey).then((productSelection) => - apiRoot.withProjectKey({projectKey}) - .productSelections() - .withKey({key: productSelectionKey}) - .post({ - body: { - version: productSelection.body.version, - actions: arrayOfProductKeys.map((productKey) => { - return { - action: "addProduct", - product: {key: productKey} - } - }) - } - }) - .execute() - ) -module.exports.getProductsInProductSelection = (productSelectionKey) => - apiRoot.withProjectKey({ projectKey }) - .productSelections() - .withKey({ key: productSelectionKey }) - .products() - .get({ - queryArgs:{ - expand:'product' - } - }) - .execute(); - diff --git a/handson/productSelections.ts b/handson/productSelections.ts new file mode 100644 index 0000000..4863bb9 --- /dev/null +++ b/handson/productSelections.ts @@ -0,0 +1,59 @@ +import { apiRoot } from "./client"; + +//TODO Product Selections + +export const getProductSelectionByKey = (key: string) => + apiRoot + .productSelections() + .withKey({ key }) + .get() + .execute(); + +export const createProductSelection = (key: string, name: string) => + apiRoot + .productSelections() + .post({ + body: { + key: key, + name: { "en": name } + } + } + ) + .execute(); + +export const addProductsToProductSelection = async ( + productSelectionKey: string, + arrayOfProductKeys: Array +) => + getProductSelectionByKey(productSelectionKey).then((productSelection) => + apiRoot + .productSelections() + .withKey({ key: productSelectionKey }) + .post({ + body: { + version: productSelection.body.version, + actions: arrayOfProductKeys.map((productKey) => { + return { + action: "addProduct", + product: { + typeId: "product", + key: productKey + } + } + }) + } + }) + .execute() + ) +export const getProductsInProductSelection = (productSelectionKey: string) => + apiRoot + .productSelections() + .withKey({ key: productSelectionKey }) + .products() + .get({ + queryArgs: { + expand: "product" + } + }) + .execute(); + diff --git a/handson/search.js b/handson/search.js deleted file mode 100644 index d3f3eb6..0000000 --- a/handson/search.js +++ /dev/null @@ -1,34 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.getAllProducts = () => - apiRoot.withProjectKey({ projectKey }).products().get().execute(); - -// filter query recalculates everything -// filter facet recalculates others only -module.exports.simulateSearch = () => - apiRoot - .withProjectKey({ projectKey }) - .productProjections() - .search() - .get({ - queryArgs: { - filter: 'categories.id:"67c7ec58-0ea8-4e23-84ea-93b02e33184d"', - facet: ["variants.attributes.size", "variants.attributes.color"], - "filter.query": "variants.attributes.size:256", - }, - }) - .execute(); - -module.exports.simulatePagination = async (perPage, where) => - apiRoot - .withProjectKey({ projectKey }) - .products() - .get({ - queryArgs: { - sort: "id asc", - limit: perPage, - where: where, - withTotal: false - }, - }) - .execute(); diff --git a/handson/search.ts b/handson/search.ts new file mode 100644 index 0000000..a014d41 --- /dev/null +++ b/handson/search.ts @@ -0,0 +1,32 @@ +import { apiRoot } from "./client"; + +export const getAllProducts = () => + apiRoot.products().get().execute(); + +// filter query recalculates everything +// filter facet recalculates others only +export const simulateSearch = () => + apiRoot + .productProjections() + .search() + .get({ + queryArgs: { + filter: "categories.id:\"19052d26-a074-4073-8f5f-55eddf721168\"", + facet: ["variants.attributes.size", "variants.attributes.weight_in_kg"], + "filter.query": "variants.attributes.size:\"box\"", + }, + }) + .execute(); + +export const simulatePagination = async (perPage: number, where: string | undefined) => + apiRoot + .products() + .get({ + queryArgs: { + sort: "id asc", + limit: perPage, + where: where, + withTotal: false + }, + }) + .execute(); diff --git a/handson/states.js b/handson/states.js deleted file mode 100644 index 5d7d1fb..0000000 --- a/handson/states.js +++ /dev/null @@ -1,57 +0,0 @@ -const { apiRoot, projectKey } = require("./client.js"); - -module.exports.createNewState = (stateDraftData) => - apiRoot - .withProjectKey({ projectKey }) - .states() - .post({ - body: createStateDraft(stateDraftData), - }) - .execute(); - -const createStateDraft = (stateDraftData) => { - const { key, type, name, initial } = stateDraftData; - return { - key, - type, - name, - initial, - }; -}; - -module.exports.getStateByKey = (key) => - apiRoot - .withProjectKey({ projectKey }) - .states() - .withKey({ key }) - .get() - .execute(); - -module.exports.getStateById = (ID) => - apiRoot - .withProjectKey({ projectKey }) - .states() - .withId({ ID }) - .get() - .execute(); - -module.exports.addTransition = (stateId, transitionStateIds) => - this.getStateById(stateId).then((state) => - apiRoot.withProjectKey({projectKey}) - .states() - .withId({ID: state.body.id}) - .post({ - body: { - version: state.body.version, - actions: [ - { - action:"setTransitions", - transitions: transitionStateIds.map((transitionStateId) => { - return {id: transitionStateId}; - }) - } - ] - } - }) - .execute() - ) diff --git a/handson/states.ts b/handson/states.ts new file mode 100644 index 0000000..7f463ec --- /dev/null +++ b/handson/states.ts @@ -0,0 +1,65 @@ +import { LocalizedString, StateDraft, StateTypeEnum, StateUpdate } from "@commercetools/platform-sdk"; +import { apiRoot } from "./client"; + +export interface StateDraftData { + key: string; + type: StateTypeEnum; + name: LocalizedString; + initial: boolean +} + +export const createNewState = (stateDraftData: StateDraftData) => + apiRoot + .states() + .post({ + body: createStateDraft(stateDraftData), + }) + .execute(); + +const createStateDraft = (stateDraftData: StateDraftData): StateDraft => { + const { key, type, name, initial } = stateDraftData; + return { + key, + type, + name, + initial, + }; +}; + +export const getStateByKey = (key: string) => + apiRoot + .states() + .withKey({ key }) + .get() + .execute(); + +export const getStateById = (ID: string) => + apiRoot + .states() + .withId({ ID }) + .get() + .execute(); + +export const addTransition = (stateId: string, transitionStateIds: Array) => + getStateById(stateId).then((state) => + apiRoot + .states() + .withId({ ID: state.body.id }) + .post({ + body: { + version: state.body.version, + actions: [ + { + action: "setTransitions", + transitions: transitionStateIds.map((transitionStateId) => { + return { + typeId: "state", + id: transitionStateId + }; + }) + } + ] + } + }) + .execute() + ) diff --git a/handson/store.js b/handson/store.js deleted file mode 100644 index 1b57142..0000000 --- a/handson/store.js +++ /dev/null @@ -1,66 +0,0 @@ -const { apiRoot, storeApiRoot, projectKey } = require("./client.js"); - -//TODO store and productProjection endpoint - -module.exports.getStoreByKey = (key) => - apiRoot.withProjectKey({projectKey}) - .stores() - .withKey({key}) - .get() - .execute(); - -module.exports.getCustomersInStore = (storeKey) => - storeApiRoot.withProjectKey({ projectKey }) - .inStoreKeyWithStoreKeyValue({ storeKey }) - .customers() - .get() - .execute(); - -module.exports.addProductSelectionToStore = async (storeKey, productSelectionKey) => - this.getStoreByKey(storeKey).then((store) => - apiRoot.withProjectKey({projectKey}) - .stores() - .withKey({key: storeKey}) - .post({ - body: { - version: store.body.version, - actions: [ - { - action: "addProductSelection", - productSelection: { key: productSelectionKey}, - active: true - } - ] - } - }) - .execute() - ) - -module.exports.getProductsInStore = (storeKey) => - apiRoot.withProjectKey({ projectKey }) - .inStoreKeyWithStoreKeyValue({ storeKey }) - .productSelectionAssignments() - .get({ - queryArgs: { - expand: "product", - expand: "productSelection" - } - }) - .execute(); - -module.exports.createInStoreCart = (storeKey, customer) => - storeApiRoot.withProjectKey({projectKey}) - .inStoreKeyWithStoreKeyValue({storeKey}) - .carts() - .post({ - body: { - currency: "EUR", - customerId: customer.body.id, - customerEmail: customer.body.email, - store: {key: storeKey} - } - }) - .execute(); - - - diff --git a/handson/store.ts b/handson/store.ts new file mode 100644 index 0000000..a714a6f --- /dev/null +++ b/handson/store.ts @@ -0,0 +1,68 @@ +import { ClientResponse, Customer } from "@commercetools/platform-sdk"; +import { apiRoot, storeApiRoot } from "./client"; + +//TODO store and productSelection endpoint + +export const getStoreByKey = (key: string) => + apiRoot + .stores() + .withKey({ key }) + .get() + .execute(); + +export const getCustomersInStore = (storeKey: string) => + storeApiRoot + .inStoreKeyWithStoreKeyValue({ storeKey }) + .customers() + .get() + .execute(); + +export const addProductSelectionToStore = (storeKey: string, productSelectionKey: string) => + getStoreByKey(storeKey).then((store) => + apiRoot + .stores() + .withKey({ key: storeKey }) + .post({ + body: { + version: store.body.version, + actions: [ + { + action: "addProductSelection", + productSelection: { + typeId: "product-selection", + key: productSelectionKey + }, + active: true + } as any + ] + } + }) + .execute() + ) + +export const getProductsInStore = (storeKey: string) => + apiRoot + .inStoreKeyWithStoreKeyValue({ storeKey }) + .productSelectionAssignments() + .get({ + queryArgs: { + expand: ["product", "productSelection"] + } + }) + .execute(); + +export const createInStoreCart = (storeKey: string, customer: ClientResponse) => + storeApiRoot + .inStoreKeyWithStoreKeyValue({ storeKey }) + .carts() + .post({ + body: { + currency: "EUR", + customerId: customer.body.id, + customerEmail: customer.body.email, + } + }) + .execute(); + + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..fe309c6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2391 @@ +{ + "name": "commercetools-js-sdk-training-solutions", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "commercetools-js-sdk-training-solutions", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@commercetools/importapi-sdk": "^2.4.0", + "@commercetools/platform-sdk": "^2.6.0", + "@commercetools/sdk-client-v2": "^1.3.0", + "@types/node-fetch": "^2.6.1", + "chalk-animation": "^1.6.0", + "cli-highlight": "^2.1.11", + "csvtojson": "^2.0.10", + "dotenv": "^16.0.0", + "node-fetch": "^2.6.7", + "ts-node": "^10.7.0", + "typescript": "^4.6.3" + }, + "devDependencies": { + "@types/chalk-animation": "^1.6.1" + } + }, + "node_modules/@commercetools/importapi-sdk": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@commercetools/importapi-sdk/-/importapi-sdk-2.4.0.tgz", + "integrity": "sha512-kysXwOy5SpY7UxTRgEwJeKAzel4/4HAEVO/b9MLQvJcz3fgfbUs2Lh1fBnLpUV4DnSDRV9q85tqDYnBHU+iuLA==", + "dependencies": { + "@commercetools/sdk-client-v2": "^1.3.0", + "@commercetools/sdk-middleware-auth": "^6.0.4", + "@commercetools/sdk-middleware-http": "^6.0.4", + "@commercetools/sdk-middleware-logger": "^2.1.1", + "querystring": "^0.2.1" + } + }, + "node_modules/@commercetools/platform-sdk": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@commercetools/platform-sdk/-/platform-sdk-2.6.0.tgz", + "integrity": "sha512-ru/A5IpbchqaPwTaKuhx8i0Wkukb1/pJ1YcR9tr6LFGa63oesb8jagUNgYZqo2UGVEcOAGvdogNUWLRTdHFYpQ==", + "dependencies": { + "@commercetools/sdk-client-v2": "^1.3.0", + "@commercetools/sdk-middleware-auth": "^6.0.4", + "@commercetools/sdk-middleware-http": "^6.0.4", + "@commercetools/sdk-middleware-logger": "^2.1.1", + "querystring": "^0.2.1" + } + }, + "node_modules/@commercetools/sdk-client-v2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-client-v2/-/sdk-client-v2-1.3.0.tgz", + "integrity": "sha512-V1tvNzxXp8Cuevark5fTYCsQRYvUJsWQDRjqDjLCjdAXfkhyoUhmnsfYDkQucbNhmaBTCMQ93gr4/gAaKwnocw==", + "dependencies": { + "buffer": "^6.0.3", + "node-fetch": "^2.6.1", + "querystring": "^0.2.1" + } + }, + "node_modules/@commercetools/sdk-middleware-auth": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.2.1.tgz", + "integrity": "sha512-JNVRVf7zssECg0i/amAG0gnFmx4Kj7rB0J9MfRlvN/54qyA6tKJOJaA5j9hYy60qKSW/NCGbVMcVlBnPJLhREQ==", + "dependencies": { + "node-fetch": "^2.6.7" + } + }, + "node_modules/@commercetools/sdk-middleware-http": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.2.0.tgz", + "integrity": "sha512-3E1nV+awhP0eeFuyChxgbaPF5CWWH0PvGZO9FtNl/mirlYjGbXAHO4Ql5tG4/G+CywlXI9XVA9wKSwxG0kgwgA==" + }, + "node_modules/@commercetools/sdk-middleware-logger": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-middleware-logger/-/sdk-middleware-logger-2.1.1.tgz", + "integrity": "sha512-k/Jm3lsWbszPBHtPAvu0rINTq398p4ddv0zbAH8R4p6Yc1GkBEy6tNgHPzX/eFskI/qerPy9IsW1xK8pqgtHHQ==" + }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==" + }, + "node_modules/@types/chalk-animation": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/chalk-animation/-/chalk-animation-1.6.1.tgz", + "integrity": "sha512-MSuZqFkBeKcik4oMzd/BjaTRYkLpNftRSYkI/oszmckHAZOTSKslWR1CRdURwsxXBgYHPRlb5JM6Cx+tkyXUAg==", + "dev": true + }, + "node_modules/@types/node": { + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", + "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" + }, + "node_modules/@types/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "node_modules/@types/tinycolor2": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.3.tgz", + "integrity": "sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==" + }, + "node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, + "node_modules/array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "engines": { + "node": ">=4" + } + }, + "node_modules/camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dependencies": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk-animation": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/chalk-animation/-/chalk-animation-1.6.0.tgz", + "integrity": "sha512-Q8vVq6eD5IOhWI0s9WdUawDzMRjNrR4rOCiu409eZRTIHID5OjoTTEkpGZngL/BPQnL7yYmBhlXXpPJ9SYuARw==", + "dependencies": { + "chalk": "^2.3.2", + "gradient-string": "^1.1.0", + "meow": "^4.0.0" + }, + "bin": { + "chalk-animation": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk-animation/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk-animation/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk-animation/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/chalk-animation/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "node_modules/chalk-animation/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk-animation/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "dependencies": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, + "node_modules/csvtojson": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.10.tgz", + "integrity": "sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ==", + "dependencies": { + "bluebird": "^3.5.1", + "lodash": "^4.17.3", + "strip-bom": "^2.0.0" + }, + "bin": { + "csvtojson": "bin/csvtojson" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dependencies": { + "array-find-index": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dotenv": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", + "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", + "engines": { + "node": ">=12" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "node_modules/gradient-string": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gradient-string/-/gradient-string-1.2.0.tgz", + "integrity": "sha512-Lxog7IDMMWNjwo4O0KbdBvSewk4vW6kQe5XaLuuPCyCE65AGQ1P8YqKJa5dq8TYf/Ge31F+KjWzPR5mAJvjlAg==", + "dependencies": { + "chalk": "^2.4.1", + "tinygradient": "^0.4.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gradient-string/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gradient-string/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/gradient-string/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/gradient-string/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "node_modules/gradient-string/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } + }, + "node_modules/gradient-string/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "engines": { + "node": "*" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "engines": { + "node": ">=4" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "node_modules/is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dependencies": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, + "node_modules/map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "engines": { + "node": ">=4" + } + }, + "node_modules/meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dependencies": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "node_modules/minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "engines": { + "node": ">=4" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "engines": { + "node": ">=4" + } + }, + "node_modules/querystring": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.1.tgz", + "integrity": "sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dependencies": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dependencies": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dependencies": { + "is-utf8": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tinycolor2": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", + "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==", + "engines": { + "node": "*" + } + }, + "node_modules/tinygradient": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tinygradient/-/tinygradient-0.4.3.tgz", + "integrity": "sha512-tBPYQSs6eWukzzAITBSmqcOwZCKACvRa/XjPPh1mj4mnx4G3Drm51HxyCTU/TKnY8kG4hmTe5QlOh9O82aNtJQ==", + "dependencies": { + "@types/tinycolor2": "^1.4.0", + "tinycolor2": "^1.0.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "engines": { + "node": ">=4" + } + }, + "node_modules/ts-node": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "engines": { + "node": ">=6" + } + } + }, + "dependencies": { + "@commercetools/importapi-sdk": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@commercetools/importapi-sdk/-/importapi-sdk-2.4.0.tgz", + "integrity": "sha512-kysXwOy5SpY7UxTRgEwJeKAzel4/4HAEVO/b9MLQvJcz3fgfbUs2Lh1fBnLpUV4DnSDRV9q85tqDYnBHU+iuLA==", + "requires": { + "@commercetools/sdk-client-v2": "^1.3.0", + "@commercetools/sdk-middleware-auth": "^6.0.4", + "@commercetools/sdk-middleware-http": "^6.0.4", + "@commercetools/sdk-middleware-logger": "^2.1.1", + "querystring": "^0.2.1" + } + }, + "@commercetools/platform-sdk": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@commercetools/platform-sdk/-/platform-sdk-2.6.0.tgz", + "integrity": "sha512-ru/A5IpbchqaPwTaKuhx8i0Wkukb1/pJ1YcR9tr6LFGa63oesb8jagUNgYZqo2UGVEcOAGvdogNUWLRTdHFYpQ==", + "requires": { + "@commercetools/sdk-client-v2": "^1.3.0", + "@commercetools/sdk-middleware-auth": "^6.0.4", + "@commercetools/sdk-middleware-http": "^6.0.4", + "@commercetools/sdk-middleware-logger": "^2.1.1", + "querystring": "^0.2.1" + } + }, + "@commercetools/sdk-client-v2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-client-v2/-/sdk-client-v2-1.3.0.tgz", + "integrity": "sha512-V1tvNzxXp8Cuevark5fTYCsQRYvUJsWQDRjqDjLCjdAXfkhyoUhmnsfYDkQucbNhmaBTCMQ93gr4/gAaKwnocw==", + "requires": { + "buffer": "^6.0.3", + "node-fetch": "^2.6.1", + "querystring": "^0.2.1" + } + }, + "@commercetools/sdk-middleware-auth": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.2.1.tgz", + "integrity": "sha512-JNVRVf7zssECg0i/amAG0gnFmx4Kj7rB0J9MfRlvN/54qyA6tKJOJaA5j9hYy60qKSW/NCGbVMcVlBnPJLhREQ==", + "requires": { + "node-fetch": "^2.6.7" + } + }, + "@commercetools/sdk-middleware-http": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.2.0.tgz", + "integrity": "sha512-3E1nV+awhP0eeFuyChxgbaPF5CWWH0PvGZO9FtNl/mirlYjGbXAHO4Ql5tG4/G+CywlXI9XVA9wKSwxG0kgwgA==" + }, + "@commercetools/sdk-middleware-logger": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@commercetools/sdk-middleware-logger/-/sdk-middleware-logger-2.1.1.tgz", + "integrity": "sha512-k/Jm3lsWbszPBHtPAvu0rINTq398p4ddv0zbAH8R4p6Yc1GkBEy6tNgHPzX/eFskI/qerPy9IsW1xK8pqgtHHQ==" + }, + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==" + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==" + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==" + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==" + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==" + }, + "@types/chalk-animation": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/chalk-animation/-/chalk-animation-1.6.1.tgz", + "integrity": "sha512-MSuZqFkBeKcik4oMzd/BjaTRYkLpNftRSYkI/oszmckHAZOTSKslWR1CRdURwsxXBgYHPRlb5JM6Cx+tkyXUAg==", + "dev": true + }, + "@types/node": { + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", + "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" + }, + "@types/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "requires": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "@types/tinycolor2": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.3.tgz", + "integrity": "sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==" + }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==" + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chalk-animation": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/chalk-animation/-/chalk-animation-1.6.0.tgz", + "integrity": "sha512-Q8vVq6eD5IOhWI0s9WdUawDzMRjNrR4rOCiu409eZRTIHID5OjoTTEkpGZngL/BPQnL7yYmBhlXXpPJ9SYuARw==", + "requires": { + "chalk": "^2.3.2", + "gradient-string": "^1.1.0", + "meow": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "requires": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, + "csvtojson": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.10.tgz", + "integrity": "sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ==", + "requires": { + "bluebird": "^3.5.1", + "lodash": "^4.17.3", + "strip-bom": "^2.0.0" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "requires": { + "array-find-index": "^1.0.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" + }, + "dotenv": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", + "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "gradient-string": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gradient-string/-/gradient-string-1.2.0.tgz", + "integrity": "sha512-Lxog7IDMMWNjwo4O0KbdBvSewk4vW6kQe5XaLuuPCyCE65AGQ1P8YqKJa5dq8TYf/Ge31F+KjWzPR5mAJvjlAg==", + "requires": { + "chalk": "^2.4.1", + "tinygradient": "^0.4.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "requires": { + "has": "^1.0.3" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=" + }, + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, + "parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "requires": { + "parse5": "^6.0.1" + }, + "dependencies": { + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + } + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "querystring": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.1.tgz", + "integrity": "sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==" + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=" + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "tinycolor2": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", + "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==" + }, + "tinygradient": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tinygradient/-/tinygradient-0.4.3.tgz", + "integrity": "sha512-tBPYQSs6eWukzzAITBSmqcOwZCKACvRa/XjPPh1mj4mnx4G3Drm51HxyCTU/TKnY8kG4hmTe5QlOh9O82aNtJQ==", + "requires": { + "@types/tinycolor2": "^1.4.0", + "tinycolor2": "^1.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=" + }, + "ts-node": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", + "yn": "3.1.1" + } + }, + "typescript": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==" + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==" + } + } +} diff --git a/package.json b/package.json index 8cb4a79..a52df62 100644 --- a/package.json +++ b/package.json @@ -1,42 +1,43 @@ { "name": "commercetools-js-sdk-training-solutions", "version": "1.0.0", + "description": "", "main": "index.js", - "license": "MIT", "scripts": { - "1": "node Task01_project_setup.js", - "2": "node Task02_customers.js", - "3": "node Task03_import_sync_products.js", - "4a": "node Task04a_states.js", - "4b": "node Task04b_checkout.js", - "4c": "node Task04c_merging.js", - "5a": "node Task05a_stores.js", - "5b": "node Task05b_product_selections.js", - "5c": "node Task05c_my.js", - "6a": "node Task06a_search.js", - "6b": "node Task06b_pagination.js", - "6c": "node Task06c_graphql.js", - "7a": "node Task07a_custom_types.js", - "7b": "node Task07b_custom_objects.js", - "7c": "node Task07c_extensions.js", - "8": "node Task08_subscriptions.js" + "1": "ts-node Task01_project_setup.ts", + "2": "ts-node Task02_customers.ts", + "3": "ts-node Task03_import_sync_products.ts", + "4a": "ts-node Task04a_states.ts", + "4b": "ts-node Task04b_checkout.ts", + "4c": "ts-node Task04c_merging.ts", + "5a": "ts-node Task05a_stores.ts", + "5b": "ts-node Task05b_product_selections.ts", + "5c": "ts-node Task05c_my.ts", + "6a": "ts-node Task06a_search.ts", + "6b": "ts-node Task06b_pagination.ts", + "6c": "ts-node Task06c_graphql.ts", + "7a": "ts-node Task07a_custom_types.ts", + "7b": "ts-node Task07b_custom_objects.ts", + "7c": "ts-node Task07c_extensions.ts", + "8": "ts-node Task08_subscriptions.ts" }, + "keywords": [], + "author": "", + "license": "MIT", "dependencies": { "@commercetools/importapi-sdk": "^2.4.0", "@commercetools/platform-sdk": "^2.6.0", "@commercetools/sdk-client-v2": "^1.3.0", + "@types/node-fetch": "^2.6.1", "chalk-animation": "^1.6.0", "cli-highlight": "^2.1.11", "csvtojson": "^2.0.10", - "dotenv": "^8.2.0", - "express": "^4.17.1", - "node-fetch": "^2.6.1" + "dotenv": "^16.0.0", + "node-fetch": "^2.6.7", + "ts-node": "^10.7.0", + "typescript": "^4.6.3" }, - "resolutions": { - "csvtojson/**/lodash": "^4.17.21", - "cli-highlight/**/y18n": "^5.0.5", - "chalk-animation/**/hosted-git-info": "^2.8.9", - "chalk-animation/**/path-parse": "1.0.7", - "chalk-animation/**/trim-newlines": "4.0.1" + "devDependencies": { + "@types/chalk-animation": "^1.6.1" } -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..0249ede --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,101 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Projects */ + // "incremental": true, /* Enable incremental compilation */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "lib": ["es2020"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ + // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "resolveJsonModule": true, /* Enable importing .json files */ + // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ + // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ + // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/types/global.d.ts b/types/global.d.ts new file mode 100644 index 0000000..e9e7c38 --- /dev/null +++ b/types/global.d.ts @@ -0,0 +1,7 @@ +import type { default as FetchFunc } from 'node-fetch'; + +declare global { + const fetch: typeof FetchFunc; +} + +declare module "chalk-animation" diff --git a/utils/config.ts b/utils/config.ts new file mode 100644 index 0000000..42fa9e9 --- /dev/null +++ b/utils/config.ts @@ -0,0 +1,24 @@ +import { config } from "dotenv"; + +config(); + +export const enum Prefix { + DEV = "DEV", + IMPORT = "IMPORT", + STORE = "BERLIN", + ME = "ME", + STORE_ME = "BERLIN_ME" +}; + +export const readConfig = (prefix: string) => { + return { + clientId: process.env[prefix + "_CLIENT_ID"] || "", + clientSecret: process.env[prefix + "_CLIENT_SECRET"] || "", + projectKey: process.env[prefix + "_PROJECT_KEY"] || "", + oauthHost: process.env[prefix + "_AUTH_URL"] || "", + host: process.env[prefix + "_API_URL"] || "", + username: process.env[prefix + "_CUSTOMER_EMAIL"] || "", + password: process.env[prefix + "_CUSTOMER_PASSWORD"] || "", + storeKey: process.env[prefix + "_STORE_KEY"] || "" + }; +} \ No newline at end of file diff --git a/logger.js b/utils/logger.ts similarity index 75% rename from logger.js rename to utils/logger.ts index 9505ae5..832cd03 100644 --- a/logger.js +++ b/utils/logger.ts @@ -1,7 +1,7 @@ -const highlight = require('cli-highlight').highlight -const chalkAnimation = require('chalk-animation'); +import { highlight } from "cli-highlight"; +import * as chalkAnimation from "chalk-animation"; -const codeLog = function (o, lang) { +const codeLog = function (o: any, lang: string = "json") { console.log(highlight( JSON.stringify(o, null, 4), { @@ -11,8 +11,7 @@ const codeLog = function (o, lang) { )); } -module.exports.log = function (o, lang) { - lang = lang ? lang : 'json'; +export const log = function (o: any) { if (o.hasOwnProperty('stack')) { console.error(o.stack) codeLog(o) diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index b758356..0000000 --- a/yarn.lock +++ /dev/null @@ -1,1091 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@commercetools/importapi-sdk@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@commercetools/importapi-sdk/-/importapi-sdk-2.4.0.tgz#77ac436aa15d2e59ff499e4021c0adcdb1bead44" - integrity sha512-kysXwOy5SpY7UxTRgEwJeKAzel4/4HAEVO/b9MLQvJcz3fgfbUs2Lh1fBnLpUV4DnSDRV9q85tqDYnBHU+iuLA== - dependencies: - "@commercetools/sdk-client-v2" "^1.3.0" - "@commercetools/sdk-middleware-auth" "^6.0.4" - "@commercetools/sdk-middleware-http" "^6.0.4" - "@commercetools/sdk-middleware-logger" "^2.1.1" - querystring "^0.2.1" - -"@commercetools/platform-sdk@^2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@commercetools/platform-sdk/-/platform-sdk-2.6.0.tgz#027d14bcf1a45517dc0c0c513b30e80727cc7d85" - integrity sha512-ru/A5IpbchqaPwTaKuhx8i0Wkukb1/pJ1YcR9tr6LFGa63oesb8jagUNgYZqo2UGVEcOAGvdogNUWLRTdHFYpQ== - dependencies: - "@commercetools/sdk-client-v2" "^1.3.0" - "@commercetools/sdk-middleware-auth" "^6.0.4" - "@commercetools/sdk-middleware-http" "^6.0.4" - "@commercetools/sdk-middleware-logger" "^2.1.1" - querystring "^0.2.1" - -"@commercetools/sdk-client-v2@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-client-v2/-/sdk-client-v2-1.3.0.tgz#3eccfd6d8601e5dc67f0e7c962f79672c69cd465" - integrity sha512-V1tvNzxXp8Cuevark5fTYCsQRYvUJsWQDRjqDjLCjdAXfkhyoUhmnsfYDkQucbNhmaBTCMQ93gr4/gAaKwnocw== - dependencies: - buffer "^6.0.3" - node-fetch "^2.6.1" - querystring "^0.2.1" - -"@commercetools/sdk-middleware-auth@^6.0.4": - version "6.2.1" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-auth/-/sdk-middleware-auth-6.2.1.tgz#bac3324bbedda004fc848167abe9b90abe0d6e85" - integrity sha512-JNVRVf7zssECg0i/amAG0gnFmx4Kj7rB0J9MfRlvN/54qyA6tKJOJaA5j9hYy60qKSW/NCGbVMcVlBnPJLhREQ== - dependencies: - node-fetch "^2.6.7" - -"@commercetools/sdk-middleware-http@^6.0.4": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-http/-/sdk-middleware-http-6.1.1.tgz#6f8b1eee63c195062984e2037182f88f63324deb" - integrity sha512-wycP1vSoD99dtD3NVVQF5VUrfiXIxKIbuYb3sU/+EHmHzgCXIfI4NditL+45Qr7sb6qmUYVFyPWjHfZINBqfUg== - -"@commercetools/sdk-middleware-logger@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@commercetools/sdk-middleware-logger/-/sdk-middleware-logger-2.1.1.tgz#9283fdc8c403a7e2d4d06637e6015770b864e64a" - integrity sha512-k/Jm3lsWbszPBHtPAvu0rINTq398p4ddv0zbAH8R4p6Yc1GkBEy6tNgHPzX/eFskI/qerPy9IsW1xK8pqgtHHQ== - -"@types/color-name@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== - -"@types/tinycolor2@^1.4.0": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@types/tinycolor2/-/tinycolor2-1.4.2.tgz#721ca5c5d1a2988b4a886e35c2ffc5735b6afbdf" - integrity sha512-PeHg/AtdW6aaIO2a+98Xj7rWY4KC1E6yOy7AFknJQ7VXUGNrMlyxDFxJo7HqLtjQms/ZhhQX52mLVW/EX3JGOw== - -accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" - integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== - dependencies: - "@types/color-name" "^1.1.1" - color-convert "^2.0.1" - -any-promise@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bluebird@^3.5.1: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - -body-parser@1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - -buffer@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - -camelcase-keys@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" - integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= - dependencies: - camelcase "^4.1.0" - map-obj "^2.0.0" - quick-lru "^1.0.0" - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -chalk-animation@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/chalk-animation/-/chalk-animation-1.6.0.tgz#df7fa91c55a9ed2939d4d287a23ad0374479fad0" - integrity sha512-Q8vVq6eD5IOhWI0s9WdUawDzMRjNrR4rOCiu409eZRTIHID5OjoTTEkpGZngL/BPQnL7yYmBhlXXpPJ9SYuARw== - dependencies: - chalk "^2.3.2" - gradient-string "^1.1.0" - meow "^4.0.0" - -chalk@^2.3.2, chalk@^2.4.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -cli-highlight@^2.1.11: - version "2.1.11" - resolved "https://registry.yarnpkg.com/cli-highlight/-/cli-highlight-2.1.11.tgz#49736fa452f0aaf4fae580e30acb26828d2dc1bf" - integrity sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg== - dependencies: - chalk "^4.0.0" - highlight.js "^10.7.1" - mz "^2.4.0" - parse5 "^5.1.1" - parse5-htmlparser2-tree-adapter "^6.0.0" - yargs "^16.0.0" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -csvtojson@^2.0.10: - version "2.0.10" - resolved "https://registry.yarnpkg.com/csvtojson/-/csvtojson-2.0.10.tgz#11e7242cc630da54efce7958a45f443210357574" - integrity sha512-lUWFxGKyhraKCW8Qghz6Z0f2l/PqB1W3AO0HKJzGIQ5JRSlR651ekJDiGJbBT4sRNNv5ddnSGVEnsxP9XRCVpQ== - dependencies: - bluebird "^3.5.1" - lodash "^4.17.3" - strip-bom "^2.0.0" - -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= - dependencies: - array-find-index "^1.0.1" - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -decamelize-keys@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - -decamelize@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -dotenv@^8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" - integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -express@^4.17.1: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - -find-up@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -graceful-fs@^4.1.2: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -gradient-string@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/gradient-string/-/gradient-string-1.2.0.tgz#93f39f2c7c8dcb095608c2ccf0aac24aa315fbac" - integrity sha512-Lxog7IDMMWNjwo4O0KbdBvSewk4vW6kQe5XaLuuPCyCE65AGQ1P8YqKJa5dq8TYf/Ge31F+KjWzPR5mAJvjlAg== - dependencies: - chalk "^2.4.1" - tinygradient "^0.4.1" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -highlight.js@^10.7.1: - version "10.7.3" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" - integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== - -hosted-git-info@^2.1.4, hosted-git-info@^2.8.9: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -inherits@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -lodash@^4.17.21, lodash@^4.17.3: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - -map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= - -map-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" - integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -meow@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.1.tgz#d48598f6f4b1472f35bf6317a95945ace347f975" - integrity sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A== - dependencies: - camelcase-keys "^4.0.0" - decamelize-keys "^1.0.0" - loud-rejection "^1.0.0" - minimist "^1.1.3" - minimist-options "^3.0.1" - normalize-package-data "^2.3.4" - read-pkg-up "^3.0.0" - redent "^2.0.0" - trim-newlines "^2.0.0" - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@~2.1.24: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -minimist-options@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" - integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - -minimist@^1.1.3: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -mz@^2.4.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== - dependencies: - any-promise "^1.0.0" - object-assign "^4.0.1" - thenify-all "^1.0.0" - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse5-htmlparser2-tree-adapter@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" - integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA== - dependencies: - parse5 "^6.0.1" - -parse5@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" - integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== - -parse5@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-parse@1.0.7, path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -proxy-addr@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" - integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.1" - -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -querystring@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" - integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== - -quick-lru@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" - integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -redent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" - integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= - dependencies: - indent-string "^3.0.0" - strip-indent "^2.0.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -resolve@^1.10.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -"semver@2 || 3 || 4 || 5": - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -signal-exit@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.6" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz#c80757383c28abf7296744998cbc106ae8b854ce" - integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== - -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= - dependencies: - is-utf8 "^0.2.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-indent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" - integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -thenify-all@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" - integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= - dependencies: - thenify ">= 3.1.0 < 4" - -"thenify@>= 3.1.0 < 4": - version "3.3.1" - resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" - integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== - dependencies: - any-promise "^1.0.0" - -tinycolor2@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" - integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g= - -tinygradient@^0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tinygradient/-/tinygradient-0.4.3.tgz#0a8dfde56f8865deec4c435a51bd5b0c0dec59fa" - integrity sha512-tBPYQSs6eWukzzAITBSmqcOwZCKACvRa/XjPPh1mj4mnx4G3Drm51HxyCTU/TKnY8kG4hmTe5QlOh9O82aNtJQ== - dependencies: - "@types/tinycolor2" "^1.4.0" - tinycolor2 "^1.0.0" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -trim-newlines@4.0.1, trim-newlines@^2.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-4.0.1.tgz#caa1a0c92e86282c9cc8485ccd3ee5a6a4fbd958" - integrity sha512-5n5GIW0uEbjCB2PO6OoaG11rscJmLOLw12ZG9e0vBKNMToDJ2n1+AkUhJpGO2bLj3jXKa/gYTGVmilX5CCxqmA== - -type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs@^16.0.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" From b23f945ae3c98dc8aa456f1882c8006e132e5e58 Mon Sep 17 00:00:00 2001 From: Sevtap Fernengel <92039320+sfernengel@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:27:05 +0200 Subject: [PATCH 18/18] Add missing types --- handson/client.ts | 35 +++++++++++++++++++---------------- types/global.d.ts | 4 ++++ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/handson/client.ts b/handson/client.ts index 35dae3a..bcc1677 100644 --- a/handson/client.ts +++ b/handson/client.ts @@ -3,16 +3,17 @@ import { createApiBuilderFromCtpClient } from "@commercetools/platform-sdk"; import { createApiBuilderFromCtpClient as createImportApiBuilderFromCtpClient } from "@commercetools/importapi-sdk"; import fetch from "node-fetch"; import { Prefix, readConfig } from "../utils/config"; +import { ApiRoot, ImportApiRoot, StoreMyApiRoot } from "../types/global"; -const createApiClient = (prefix: Prefix) => { +const createApiClient = () => { const { clientId, clientSecret, projectKey, oauthHost, host, - } = readConfig(prefix); + } = readConfig(Prefix.DEV); const authMiddlewareOptions: AuthMiddlewareOptions = { host: oauthHost, @@ -41,14 +42,14 @@ const createApiClient = (prefix: Prefix) => { } -const createImportApiClient = (prefix: Prefix) => { +const createImportApiClient = () => { const { clientId, clientSecret, projectKey, oauthHost, host, - } = readConfig(prefix); + } = readConfig(Prefix.IMPORT); const authMiddlewareOptions: AuthMiddlewareOptions = { host: oauthHost, @@ -76,7 +77,7 @@ const createImportApiClient = (prefix: Prefix) => { return importApiRoot; } -const createStoreApiClient = (prefix: Prefix) => { +const createStoreApiClient = () => { const { clientId, clientSecret, @@ -84,7 +85,7 @@ const createStoreApiClient = (prefix: Prefix) => { oauthHost, host, storeKey - } = readConfig(prefix); + } = readConfig(Prefix.STORE); const authMiddlewareOptions: AuthMiddlewareOptions = { host: oauthHost, @@ -108,12 +109,12 @@ const createStoreApiClient = (prefix: Prefix) => { const storeApiRoot = createApiBuilderFromCtpClient(client) .withProjectKey({ projectKey }); - // .inStoreKeyWithStoreKeyValue({ storeKey }); return storeApiRoot; + } -const createMyApiClient = (prefix: Prefix) => { +const createMyApiClient = () => { const { clientId, clientSecret, @@ -122,7 +123,7 @@ const createMyApiClient = (prefix: Prefix) => { host, username, password - } = readConfig(prefix); + } = readConfig(Prefix.ME); const passwordAuthMiddlewareOptions: PasswordAuthMiddlewareOptions = { host: oauthHost, @@ -152,9 +153,10 @@ const createMyApiClient = (prefix: Prefix) => { .withProjectKey({ projectKey }); return myApiRoot; + } -const createStoreMyApiClient = (prefix: Prefix) => { +const createStoreMyApiClient = () => { const { clientId, clientSecret, @@ -164,7 +166,7 @@ const createStoreMyApiClient = (prefix: Prefix) => { storeKey, username, password - } = readConfig(prefix); + } = readConfig(Prefix.STORE_ME); const passwordAuthMiddlewareOptions: PasswordAuthMiddlewareOptions = { host: oauthHost, @@ -196,10 +198,11 @@ const createStoreMyApiClient = (prefix: Prefix) => { .inStoreKeyWithStoreKeyValue({ storeKey }); return storeMyApiRoot; + } -export const apiRoot = createApiClient(Prefix.DEV); -export const importApiRoot = createImportApiClient(Prefix.IMPORT); -export const storeApiRoot = createStoreApiClient(Prefix.STORE); -export const myApiRoot = createMyApiClient(Prefix.ME); -export const storeMyApiRoot = createStoreMyApiClient(Prefix.STORE_ME); \ No newline at end of file +export const apiRoot: ApiRoot = createApiClient(); +export const importApiRoot: ImportApiRoot = createImportApiClient(); +export const storeApiRoot: ApiRoot = createStoreApiClient(); +export const myApiRoot: ApiRoot = createMyApiClient(); +export const storeMyApiRoot: StoreMyApiRoot = createStoreMyApiClient(); \ No newline at end of file diff --git a/types/global.d.ts b/types/global.d.ts index e9e7c38..c6a4863 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -5,3 +5,7 @@ declare global { } declare module "chalk-animation" + +export type { ByProjectKeyRequestBuilder as ApiRoot } from "@commercetools/platform-sdk/dist/declarations/src/generated/client/by-project-key-request-builder"; +export type { ByProjectKeyRequestBuilder as ImportApiRoot } from "@commercetools/importapi-sdk/dist/declarations/src/generated/client/by-project-key-request-builder"; +export type { ByProjectKeyInStoreKeyByStoreKeyRequestBuilder as StoreMyApiRoot } from "@commercetools/platform-sdk/dist/declarations/src/generated/client/in-store/by-project-key-in-store-key-by-store-key-request-builder";