Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commercelayer/cli-plugin-checkout

Package Overview
Dependencies
Maintainers
3
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercelayer/cli-plugin-checkout - npm Package Compare versions

Comparing version 1.1.5 to 1.2.1

19

lib/base.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc