@commercelayer/cli-plugin-checkout
Advanced tools
Comparing version 1.1.5 to 1.2.1
@@ -9,6 +9,3 @@ "use strict"; | ||
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk")); | ||
const path_1 = (0, tslib_1.__importDefault)(require("path")); | ||
const update_notifier_1 = (0, tslib_1.__importDefault)(require("update-notifier")); | ||
const common_1 = require("./common"); | ||
const token_1 = require("./token"); | ||
const cli_core_1 = require("@commercelayer/cli-core"); | ||
const pkg = require('../package.json'); | ||
@@ -18,11 +15,3 @@ class default_1 extends command_1.default { | ||
async init() { | ||
const notifier = (0, update_notifier_1.default)({ pkg, updateCheckInterval: 1000 * 60 * 60 }); | ||
if (notifier.update) { | ||
const pluginMode = path_1.default.resolve(__dirname).includes(`/@commercelayer/cli/node_modules/${pkg.name}/`); | ||
const command = pluginMode ? 'commercelayer plugins:update' : '{updateCommand}'; | ||
notifier.notify({ | ||
isGlobal: !pluginMode, | ||
message: `-= ${chalk_1.default.bgWhite.black.bold(` ${pkg.description} `)} =-\n\nNew version available: ${chalk_1.default.dim('{currentVersion}')} -> ${chalk_1.default.green('{latestVersion}')}\nRun ${chalk_1.default.cyanBright(command)} to update`, | ||
}); | ||
} | ||
cli_core_1.update.checkUpdate(pkg); | ||
return super.init(); | ||
@@ -40,3 +29,3 @@ } | ||
else | ||
this.error((0, common_1.formatError)(error, flags)); | ||
this.error(cli_core_1.output.formatError(error, flags)); | ||
} | ||
@@ -57,3 +46,3 @@ else | ||
checkApplication(accessToken, kind) { | ||
const info = (0, token_1.decodeAccessToken)(accessToken); | ||
const info = cli_core_1.token.decodeAccessToken(accessToken); | ||
if (info === null) | ||
@@ -60,0 +49,0 @@ this.error('Invalid access token provided'); |
@@ -6,3 +6,3 @@ "use strict"; | ||
const base_1 = (0, tslib_1.__importDefault)(require("../../base")); | ||
const common_1 = require("../../common"); | ||
const cli_core_1 = require("@commercelayer/cli-core"); | ||
const url_1 = require("../../url"); | ||
@@ -29,3 +29,3 @@ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk")); | ||
if (sdk_1.CommerceLayerStatic.isApiError(error)) { | ||
this.error((0, common_1.formatError)(error, flags)); | ||
this.error(cli_core_1.output.formatError(error, flags)); | ||
} | ||
@@ -32,0 +32,0 @@ else |
@@ -5,6 +5,6 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const common_1 = require("./common"); | ||
const cli_core_1 = require("@commercelayer/cli-core"); | ||
const cli_ux_1 = (0, tslib_1.__importDefault)(require("cli-ux")); | ||
const buildCheckoutUrl = (organization, id, accessToken) => { | ||
const baseUrl = (0, common_1.baseURL)(organization, 'checkout.commercelayer.app'); | ||
const baseUrl = cli_core_1.api.baseURL(organization, 'checkout.commercelayer.app'); | ||
const checkoutUrl = `${baseUrl}/${id}?accessToken=${accessToken}`; | ||
@@ -11,0 +11,0 @@ return checkoutUrl; |
@@ -1,1 +0,1 @@ | ||
{"version":"1.1.5","commands":{"checkout":{"id":"checkout","description":"create checkout URLs","pluginName":"@commercelayer/cli-plugin-checkout","pluginType":"core","aliases":[],"examples":["$ commercelayer checkout -O <order-id>","$ cl checkout -S <sku-code> -m <market-id> -c <coupon-code> -e <email-address>","$ cl checkout -S <sku-code-1> -S <sku-code-2> -m <market-id>"],"flags":{"organization":{"name":"organization","type":"option","char":"o","description":"the slug of your organization","required":true},"domain":{"name":"domain","type":"option","char":"d","hidden":true,"required":false},"accessToken":{"name":"accessToken","type":"option","char":"a","hidden":false,"required":true},"open":{"name":"open","type":"boolean","description":"open checkout URL in default browser","allowNo":false},"order":{"name":"order","type":"option","char":"O","description":"an order id"},"sku":{"name":"sku","type":"option","char":"S","description":"an SKU code"},"market":{"name":"market","type":"option","char":"m","description":"a market number"},"coupon":{"name":"coupon","type":"option","char":"c","description":"a promo code"},"email":{"name":"email","type":"option","char":"e","description":"a customer email"}},"args":[]},"checkout:noc":{"id":"checkout:noc","pluginName":"@commercelayer/cli-plugin-checkout","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"checkout:order":{"id":"checkout:order","description":"create checkout URLs starting from an existing order","pluginName":"@commercelayer/cli-plugin-checkout","pluginType":"core","aliases":[],"flags":{"organization":{"name":"organization","type":"option","char":"o","description":"the slug of your organization","required":true},"domain":{"name":"domain","type":"option","char":"d","hidden":true,"required":false},"accessToken":{"name":"accessToken","type":"option","char":"a","hidden":false,"required":true},"open":{"name":"open","type":"boolean","description":"open checkout URL in default browser","allowNo":false}},"args":[{"name":"id","description":"unique id of the order","required":true}]}}} | ||
{"version":"1.2.1","commands":{"checkout":{"id":"checkout","description":"create checkout URLs","pluginName":"@commercelayer/cli-plugin-checkout","pluginType":"core","aliases":[],"examples":["$ commercelayer checkout -O <order-id>","$ cl checkout -S <sku-code> -m <market-id> -c <coupon-code> -e <email-address>","$ cl checkout -S <sku-code-1> -S <sku-code-2> -m <market-id>"],"flags":{"organization":{"name":"organization","type":"option","char":"o","description":"the slug of your organization","required":true},"domain":{"name":"domain","type":"option","char":"d","hidden":true,"required":false},"accessToken":{"name":"accessToken","type":"option","char":"a","hidden":false,"required":true},"open":{"name":"open","type":"boolean","description":"open checkout URL in default browser","allowNo":false},"order":{"name":"order","type":"option","char":"O","description":"an order id"},"sku":{"name":"sku","type":"option","char":"S","description":"an SKU code"},"market":{"name":"market","type":"option","char":"m","description":"a market number"},"coupon":{"name":"coupon","type":"option","char":"c","description":"a promo code"},"email":{"name":"email","type":"option","char":"e","description":"a customer email"}},"args":[]},"checkout:noc":{"id":"checkout:noc","pluginName":"@commercelayer/cli-plugin-checkout","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"checkout:order":{"id":"checkout:order","description":"create checkout URLs starting from an existing order","pluginName":"@commercelayer/cli-plugin-checkout","pluginType":"core","aliases":[],"flags":{"organization":{"name":"organization","type":"option","char":"o","description":"the slug of your organization","required":true},"domain":{"name":"domain","type":"option","char":"d","hidden":true,"required":false},"accessToken":{"name":"accessToken","type":"option","char":"a","hidden":false,"required":true},"open":{"name":"open","type":"boolean","description":"open checkout URL in default browser","allowNo":false}},"args":[{"name":"id","description":"unique id of the order","required":true}]}}} |
{ | ||
"name": "@commercelayer/cli-plugin-checkout", | ||
"description": "Commerce Layer CLI Checkout plugin", | ||
"version": "1.1.5", | ||
"version": "1.2.1", | ||
"author": "Pierluigi Viti <pierluigi@commercelayer.io>", | ||
@@ -18,3 +18,2 @@ "bin": { | ||
"@types/node": "^10.17.60", | ||
"@types/update-notifier": "^5.0.0", | ||
"chai": "^4.3.4", | ||
@@ -74,2 +73,3 @@ "eslint": "^5.16.0", | ||
"dependencies": { | ||
"@commercelayer/cli-core": "file:../commercelayer-cli-core", | ||
"@commercelayer/js-auth": "^2.1.0", | ||
@@ -81,5 +81,3 @@ "@commercelayer/sdk": "2.3.0", | ||
"cli-ux": "^5.6.3", | ||
"jsonwebtoken": "^8.5.1", | ||
"tslib": "^1.14.1", | ||
"update-notifier": "^5.1.0" | ||
"tslib": "^1.14.1" | ||
}, | ||
@@ -86,0 +84,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
17
20952
18
323
+ Added@commercelayer/cli-core@file:../commercelayer-cli-core
- Removedjsonwebtoken@^8.5.1
- Removedupdate-notifier@^5.1.0
- Removed@sindresorhus/is@0.14.0(transitive)
- Removed@szmarczak/http-timer@1.1.2(transitive)
- Removedansi-align@3.0.1(transitive)
- Removedboxen@5.1.2(transitive)
- Removedbuffer-equal-constant-time@1.0.1(transitive)
- Removedcacheable-request@6.1.0(transitive)
- Removedcamelcase@6.3.0(transitive)
- Removedci-info@2.0.0(transitive)
- Removedcli-boxes@2.2.1(transitive)
- Removedclone-response@1.0.3(transitive)
- Removedconfigstore@5.0.1(transitive)
- Removedcrypto-random-string@2.0.0(transitive)
- Removeddecompress-response@3.3.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddefer-to-connect@1.1.3(transitive)
- Removeddot-prop@5.3.0(transitive)
- Removedduplexer3@0.1.5(transitive)
- Removedecdsa-sig-formatter@1.0.11(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedescape-goat@2.1.1(transitive)
- Removedget-stream@4.1.05.2.0(transitive)
- Removedglobal-dirs@3.0.1(transitive)
- Removedgot@9.6.0(transitive)
- Removedhas-yarn@2.1.0(transitive)
- Removedhttp-cache-semantics@4.1.1(transitive)
- Removedimport-lazy@2.1.0(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedini@1.3.82.0.0(transitive)
- Removedis-ci@2.0.0(transitive)
- Removedis-installed-globally@0.4.0(transitive)
- Removedis-npm@5.0.0(transitive)
- Removedis-obj@2.0.0(transitive)
- Removedis-path-inside@3.0.3(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedis-yarn-global@0.3.0(transitive)
- Removedjson-buffer@3.0.0(transitive)
- Removedjsonwebtoken@8.5.1(transitive)
- Removedjwa@1.4.1(transitive)
- Removedjws@3.2.2(transitive)
- Removedkeyv@3.1.0(transitive)
- Removedlatest-version@5.1.0(transitive)
- Removedlodash.includes@4.3.0(transitive)
- Removedlodash.isboolean@3.0.3(transitive)
- Removedlodash.isinteger@4.0.4(transitive)
- Removedlodash.isnumber@3.0.3(transitive)
- Removedlodash.isplainobject@4.0.6(transitive)
- Removedlodash.isstring@4.0.1(transitive)
- Removedlodash.once@4.1.1(transitive)
- Removedlowercase-keys@1.0.12.0.0(transitive)
- Removedmake-dir@3.1.0(transitive)
- Removedmimic-response@1.0.1(transitive)
- Removedminimist@1.2.8(transitive)
- Removednormalize-url@4.5.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedp-cancelable@1.1.0(transitive)
- Removedpackage-json@6.5.0(transitive)
- Removedprepend-http@2.0.0(transitive)
- Removedpump@3.0.2(transitive)
- Removedpupa@2.1.1(transitive)
- Removedrc@1.2.8(transitive)
- Removedregistry-auth-token@4.2.2(transitive)
- Removedregistry-url@5.1.0(transitive)
- Removedresponselike@1.0.2(transitive)
- Removedsemver@5.7.26.3.1(transitive)
- Removedsemver-diff@3.1.1(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedto-readable-stream@1.0.0(transitive)
- Removedtype-fest@0.20.2(transitive)
- Removedtypedarray-to-buffer@3.1.5(transitive)
- Removedunique-string@2.0.0(transitive)
- Removedupdate-notifier@5.1.0(transitive)
- Removedurl-parse-lax@3.0.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedwrite-file-atomic@3.0.3(transitive)
- Removedxdg-basedir@4.0.0(transitive)