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
2
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 4.7.2 to 5.0.0-oclif3.1

6

lib/base.d.ts

@@ -6,5 +6,5 @@ import { type CommerceLayerClient } from '@commercelayer/sdk';

static baseFlags: {
organization: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
organization: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
domain: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
open: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;

@@ -11,0 +11,0 @@ staging: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;

@@ -13,2 +13,33 @@ "use strict";

class default_1 extends core_1.Command {
static baseFlags = {
organization: core_1.Flags.string({
char: 'o',
description: 'the slug of your organization',
required: true,
env: 'CL_CLI_ORGANIZATION',
hidden: true,
}),
domain: core_1.Flags.string({
char: 'd',
required: false,
hidden: true,
dependsOn: ['organization'],
env: 'CL_CLI_DOMAIN',
}),
accessToken: core_1.Flags.string({
char: 'a',
description: 'custom access token to use instead of the one used for login',
hidden: false,
required: true,
env: 'CL_CLI_ACCESS_TOKEN',
dependsOn: ['organization']
}),
open: core_1.Flags.boolean({
description: 'open checkout URL in default browser',
}),
staging: core_1.Flags.boolean({
description: 'connect to Checkout application in Staging environment',
hidden: true,
}),
};
// INIT (override)

@@ -47,3 +78,2 @@ async init() {

checkAcessTokenData(accessToken, flags) {
var _a, _b;
const info = cli_core_1.clToken.decodeAccessToken(accessToken);

@@ -54,38 +84,7 @@ if (info === null)

this.error(`Invalid application kind: ${cli_core_1.clColor.msg.error(info.application.kind)}. Only ${cli_core_1.clColor.api.kind(REQUIRED_APP_KIND)} access token can be used to generate a checkout URL`);
else if (((_a = info.organization) === null || _a === void 0 ? void 0 : _a.slug) !== flags.organization) // Organization
this.error(`The access token provided belongs to a wrong organization: ${cli_core_1.clColor.msg.error((_b = info.organization) === null || _b === void 0 ? void 0 : _b.slug)} instead of ${cli_core_1.clColor.style.organization(flags.organization)}`);
else if (info.organization?.slug !== flags.organization) // Organization
this.error(`The access token provided belongs to a wrong organization: ${cli_core_1.clColor.msg.error(info.organization?.slug)} instead of ${cli_core_1.clColor.style.organization(flags.organization)}`);
return true;
}
}
default_1.baseFlags = {
organization: core_1.Flags.string({
char: 'o',
description: 'the slug of your organization',
required: true,
env: 'CL_CLI_ORGANIZATION',
hidden: true,
}),
domain: core_1.Flags.string({
char: 'd',
required: false,
hidden: true,
dependsOn: ['organization'],
env: 'CL_CLI_DOMAIN',
}),
accessToken: core_1.Flags.string({
char: 'a',
description: 'custom access token to use instead of the one used for login',
hidden: false,
required: true,
env: 'CL_CLI_ACCESS_TOKEN',
dependsOn: ['organization']
}),
open: core_1.Flags.boolean({
description: 'open checkout URL in default browser',
}),
staging: core_1.Flags.boolean({
description: 'connect to Checkout application in Staging environment',
hidden: true,
}),
};
exports.default = default_1;

@@ -6,8 +6,8 @@ import Command from '../../base';

static flags: {
order: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
sku: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
bundle: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
market: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
coupon: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
email: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
order: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
sku: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
bundle: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
market: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
coupon: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
email: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
};

@@ -14,0 +14,0 @@ run(): Promise<any>;

@@ -9,2 +9,56 @@ "use strict";

class CheckoutIndex extends base_1.default {
static description = 'create checkout URLs';
static 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>',
];
static flags = {
...base_1.default.flags,
order: base_1.Flags.string({
char: 'O',
description: 'an order id',
exclusive: ['sku', 'bundle'],
multiple: false,
}),
sku: base_1.Flags.string({
char: 'S',
description: 'an SKU code',
exclusive: ['order'],
multiple: true,
}),
bundle: base_1.Flags.string({
char: 'B',
description: 'a bundle code',
exclusive: ['order'],
multiple: true,
}),
market: base_1.Flags.string({
char: 'm',
description: 'a market number',
exclusive: ['order'],
}),
coupon: base_1.Flags.string({
char: 'c',
description: 'a promo code',
exclusive: ['order'],
}),
email: base_1.Flags.string({
char: 'e',
description: 'a customer email',
exclusive: ['order'],
}),
/*
'set-defaults': flags.boolean({
char: 'D',
description: 'set order defaults',
dependsOn: ['sku'],
}),
place: flags.boolean({
char: 'P',
description: 'place the rorder',
dependsOn: ['sku'],
}),
*/
};
async run() {

@@ -139,36 +193,2 @@ const { flags } = await this.parse(CheckoutIndex);

}
CheckoutIndex.description = 'create checkout URLs';
CheckoutIndex.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>',
];
CheckoutIndex.flags = Object.assign(Object.assign({}, base_1.default.flags), { order: base_1.Flags.string({
char: 'O',
description: 'an order id',
exclusive: ['sku', 'bundle'],
multiple: false,
}), sku: base_1.Flags.string({
char: 'S',
description: 'an SKU code',
exclusive: ['order'],
multiple: true,
}), bundle: base_1.Flags.string({
char: 'B',
description: 'a bundle code',
exclusive: ['order'],
multiple: true,
}), market: base_1.Flags.string({
char: 'm',
description: 'a market number',
exclusive: ['order'],
}), coupon: base_1.Flags.string({
char: 'c',
description: 'a promo code',
exclusive: ['order'],
}), email: base_1.Flags.string({
char: 'e',
description: 'a customer email',
exclusive: ['order'],
}) });
exports.default = CheckoutIndex;

@@ -5,2 +5,4 @@ "use strict";

class Noc extends core_1.Command {
static hidden = true;
static flags = {};
async run() {

@@ -12,4 +14,2 @@ const output = '-= NoC =-';

}
Noc.hidden = true;
Noc.flags = {};
exports.default = Noc;

@@ -6,5 +6,5 @@ import Command from '../../base';

static args: {
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
};
run(): Promise<any>;
}

@@ -9,2 +9,9 @@ "use strict";

class CheckoutOrder extends base_1.default {
static description = 'create checkout URLs starting from an existing order';
static examples = [
'$ commercelayer checkout:order <order-id>',
];
static args = {
id: base_1.Args.string({ name: 'id', description: 'unique id of the order', required: true }),
};
async run() {

@@ -35,9 +42,2 @@ const { args, flags } = await this.parse(CheckoutOrder);

}
CheckoutOrder.description = 'create checkout URLs starting from an existing order';
CheckoutOrder.examples = [
'$ commercelayer checkout:order <order-id>',
];
CheckoutOrder.args = {
id: base_1.Args.string({ name: 'id', description: 'unique id of the order', required: true }),
};
exports.default = CheckoutOrder;

@@ -139,2 +139,3 @@ {

"strict": true,
"enableJsonFlag": false,
"isESM": false,

@@ -160,2 +161,3 @@ "relativePath": [

"strict": true,
"enableJsonFlag": false,
"isESM": false,

@@ -242,2 +244,3 @@ "relativePath": [

"strict": true,
"enableJsonFlag": false,
"isESM": false,

@@ -252,3 +255,3 @@ "relativePath": [

},
"version": "4.7.2"
"version": "5.0.0-oclif3.1"
}
{
"name": "@commercelayer/cli-plugin-checkout",
"description": "Commerce Layer CLI Checkout plugin",
"version": "4.7.2",
"version": "5.0.0-oclif3.1",
"author": "Pierluigi Viti <pierluigi@commercelayer.io>",
"homepage": "https://github.com/commercelayer/commercelayer-cli-plugin-checkout",
"repository": "commercelayer/commercelayer-cli-plugin-checkout",
"bugs": "https://github.com/commercelayer/commercelayer-cli-plugin-checkout/issues",

@@ -16,3 +18,2 @@ "engines": {

],
"homepage": "https://github.com/commercelayer/commercelayer-cli-plugin-checkout",
"keywords": [

@@ -44,3 +45,2 @@ "ecommerce",

},
"repository": "commercelayer/commercelayer-cli-plugin-checkout",
"scripts": {

@@ -58,6 +58,6 @@ "postpack": "rm -f oclif.manifest.json",

"devDependencies": {
"@commercelayer/cli-dev": "^2.0.5",
"@commercelayer/cli-dev": "beta",
"@commercelayer/eslint-config-ts": "^1.3.0",
"@oclif/plugin-help": "^5.2.20",
"@oclif/test": "^2.5.6",
"@oclif/plugin-help": "^6.0.12",
"@oclif/test": "^3.1.16",
"@semantic-release/changelog": "^6.0.3",

@@ -67,16 +67,16 @@ "@semantic-release/git": "^10.0.1",

"@types/mocha": "^10.0.6",
"@types/node": "^20.10.4",
"chai": "^4.3.10",
"eslint": "^8.55.0",
"mocha": "^10.2.0",
"@types/node": "^20.11.17",
"chai": "^4.4.1",
"eslint": "^8.56.0",
"mocha": "^10.3.0",
"nyc": "^15.1.0",
"oclif": "^4.0.4",
"semantic-release": "^22.0.12",
"oclif": "^4.4.11",
"semantic-release": "^23.0.2",
"ts-node": "^10.9.2",
"typescript": "5.3.2"
"typescript": "5.3.3"
},
"dependencies": {
"@commercelayer/cli-core": "^4.9.2",
"@commercelayer/sdk": "^5.24.0",
"@oclif/core": "^2.15.0",
"@commercelayer/cli-core": "beta",
"@commercelayer/sdk": "^5.31.1",
"@oclif/core": "^3.19.1",
"open": "^8.4.2",

@@ -83,0 +83,0 @@ "tslib": "^2.6.2"

@@ -53,3 +53,3 @@ # @commercelayer/cli-plugin-checkout

-m, --market=<value> a market number
--open open checkout URL in default browser
--open open checkout URL in default browser

@@ -82,3 +82,3 @@ DESCRIPTION

-a, --accessToken=<value> (required) custom access token to use instead of the one used for login
--open open checkout URL in default browser
--open open checkout URL in default browser

@@ -85,0 +85,0 @@ DESCRIPTION

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