@commercelayer/cli-plugin-exports
Advanced tools
Comparing version 3.1.3 to 3.2.0
import type { ApiMode, KeyValRel, KeyValString } from '@commercelayer/cli-core'; | ||
import { Command, Flags, Args, ux } from '@oclif/core'; | ||
import { Command, Flags, Args } from '@oclif/core'; | ||
import { type CommerceLayerClient, type Export } from '@commercelayer/sdk'; | ||
@@ -38,3 +38,3 @@ import type { CommandError } from '@oclif/core/lib/interfaces'; | ||
} | ||
export { Flags, Args, ux as cliux }; | ||
export { Flags, Args }; | ||
export type ExportFormat = 'json' | 'csv'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.cliux = exports.Args = exports.Flags = exports.ExportCommand = exports.computeDelay = exports.notify = exports.encoding = void 0; | ||
exports.Args = exports.Flags = exports.ExportCommand = exports.computeDelay = exports.notify = exports.encoding = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -9,3 +9,2 @@ const cli_core_1 = require("@commercelayer/cli-core"); | ||
Object.defineProperty(exports, "Args", { enumerable: true, get: function () { return core_1.Args; } }); | ||
Object.defineProperty(exports, "cliux", { enumerable: true, get: function () { return core_1.ux; } }); | ||
const fs_1 = require("fs"); | ||
@@ -17,2 +16,3 @@ const axios_1 = tslib_1.__importDefault(require("axios")); | ||
const node_notifier_1 = tslib_1.__importDefault(require("node-notifier")); | ||
const cliux = tslib_1.__importStar(require("@commercelayer/cli-ux")); | ||
const pkg = require('../package.json'); | ||
@@ -182,3 +182,3 @@ exports.encoding = 'utf-8'; | ||
if (((jwtData.exp - securityInterval) * 1000) <= Date.now()) { | ||
await core_1.ux.wait((securityInterval + 1) * 1000); | ||
await cliux.wait((securityInterval + 1) * 1000); | ||
const organization = flags.organization; | ||
@@ -185,0 +185,0 @@ const domain = flags.domain; |
@@ -11,2 +11,3 @@ "use strict"; | ||
const node_path_1 = require("node:path"); | ||
const cliux = tslib_1.__importStar(require("@commercelayer/cli-ux")); | ||
const ALLOW_OVERQUEUING = true; // Allow to bypass the limit of concurrent exports | ||
@@ -157,3 +158,3 @@ const MAX_QUEUE_LENGTH = Math.floor(cli_core_1.clConfig.exports.max_queue_length / 2) - 1; | ||
if (!expJob.blindMode && !flags.quiet) | ||
base_1.cliux.action.start('Checking and merging exported files'); | ||
cliux.action.start('Checking and merging exported files'); | ||
const tmpOutputFile = await this.mergeExportFiles(exports, flags); | ||
@@ -164,3 +165,3 @@ const checkOk = this.checkExportedFile(expJob.totalRecords, (0, node_fs_1.readFileSync)(tmpOutputFile, { encoding: base_1.encoding }), expJob.format); | ||
if (!expJob.blindMode) | ||
base_1.cliux.action.stop(); | ||
cliux.action.stop(); | ||
outputFile = await this.saveOutput(tmpOutputFile, flags); | ||
@@ -281,3 +282,3 @@ (0, node_fs_1.unlinkSync)(tmpOutputFile); | ||
this.log(); | ||
await base_1.cliux.anykey(); | ||
await cliux.anykey(); | ||
} | ||
@@ -284,0 +285,0 @@ } |
@@ -7,2 +7,3 @@ "use strict"; | ||
const open_1 = tslib_1.__importDefault(require("open")); | ||
const cliux = tslib_1.__importStar(require("@commercelayer/cli-ux")); | ||
class ExportsCreate extends base_1.ExportCommand { | ||
@@ -123,11 +124,11 @@ static description = 'create a new export'; | ||
if (!blindMode) | ||
base_1.cliux.action.start(`Exporting ${resDesc}`, this.exportStatus(exp.status?.replace(/_/g, ' ') || 'waiting')); | ||
cliux.action.start(`Exporting ${resDesc}`, this.exportStatus(exp.status?.replace(/_/g, ' ') || 'waiting')); | ||
while (!['completed', 'interrupted'].includes(exp.status || '')) { | ||
jwtData = await this.checkAccessToken(jwtData, flags); | ||
exp = await this.cl.exports.retrieve(exp.id); | ||
base_1.cliux.action.status = this.exportStatus(exp.status?.replace(/_/g, ' ') || 'waiting'); | ||
await base_1.cliux.wait(delay); | ||
cliux.action.status = this.exportStatus(exp.status?.replace(/_/g, ' ') || 'waiting'); | ||
await cliux.wait(delay); | ||
} | ||
if (!blindMode) | ||
base_1.cliux.action.stop(this.exportStatus(exp.status)); | ||
cliux.action.stop(this.exportStatus(exp.status)); | ||
if (exp.status === 'completed') | ||
@@ -134,0 +135,0 @@ this.log(`\nExported ${cli_core_1.clColor.yellowBright(exp.records_count || 0)} ${resDesc}`); |
@@ -7,2 +7,3 @@ "use strict"; | ||
const cli_core_1 = require("@commercelayer/cli-core"); | ||
const cliux = tslib_1.__importStar(require("@commercelayer/cli-ux")); | ||
class ExportsGroup extends base_1.default { | ||
@@ -27,3 +28,3 @@ static description = 'list all the exports related to an export group'; | ||
let pageCount = 1; | ||
base_1.cliux.action.start('Fetching exports'); | ||
cliux.action.start('Fetching exports'); | ||
while (currentPage < pageCount) { | ||
@@ -44,3 +45,3 @@ const params = { | ||
} | ||
base_1.cliux.action.stop(); | ||
cliux.action.stop(); | ||
this.log(); | ||
@@ -47,0 +48,0 @@ if (tableData?.length) { |
@@ -7,2 +7,3 @@ "use strict"; | ||
const cli_core_1 = require("@commercelayer/cli-core"); | ||
const cliux = tslib_1.__importStar(require("@commercelayer/cli-ux")); | ||
const MAX_EXPORTS = 1000; | ||
@@ -55,3 +56,3 @@ class ExportsList extends base_1.default { | ||
pageSize = Math.min(flags.limit, pageSize); | ||
base_1.cliux.action.start('Fetching exports'); | ||
cliux.action.start('Fetching exports'); | ||
let delay = 0; | ||
@@ -86,3 +87,3 @@ while (currentPage < pageCount) { | ||
} | ||
base_1.cliux.action.stop(); | ||
cliux.action.stop(); | ||
this.log(); | ||
@@ -89,0 +90,0 @@ if (tableData?.length) { |
@@ -903,3 +903,3 @@ { | ||
}, | ||
"version": "3.1.3" | ||
"version": "3.2.0" | ||
} |
{ | ||
"name": "@commercelayer/cli-plugin-exports", | ||
"description": "Commerce Layer CLI Exports plugin", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"author": "Pierluigi Viti <pierluigi@commercelayer.io>", | ||
@@ -58,24 +58,25 @@ "homepage": "https://github.com/commercelayer/commercelayer-cli-plugin-exports", | ||
"@commercelayer/eslint-config-ts": "^1.4.5", | ||
"@oclif/plugin-help": "^6.0.22", | ||
"@oclif/plugin-help": "^6.2.8", | ||
"@oclif/test": "^3.2.15", | ||
"@semantic-release/changelog": "^6.0.3", | ||
"@semantic-release/git": "^10.0.1", | ||
"@types/chai": "^4.3.16", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^20.12.13", | ||
"@types/chai": "^4.3.17", | ||
"@types/mocha": "^10.0.7", | ||
"@types/node": "^22.5.0", | ||
"@types/node-notifier": "^8.0.5", | ||
"chai": "^4.4.1", | ||
"chai": "^4.5.0", | ||
"eslint": "^8.57.0", | ||
"mocha": "^10.4.0", | ||
"mocha": "^10.7.3", | ||
"nyc": "^15.1.0", | ||
"oclif": "^4.11.3", | ||
"semantic-release": "^23.1.1", | ||
"tsx": "^4.11.0", | ||
"typescript": "^5.4.5" | ||
"oclif": "^4.14.22", | ||
"semantic-release": "^24.1.0", | ||
"tsx": "^4.17.0", | ||
"typescript": "^5.5.4" | ||
}, | ||
"dependencies": { | ||
"@commercelayer/cli-core": "^5.0.2", | ||
"@commercelayer/sdk": "^6.3.0", | ||
"@oclif/core": "^3.26.6", | ||
"axios": "^1.7.2", | ||
"@commercelayer/cli-core": "^5.2.3", | ||
"@commercelayer/cli-ux": "^1.0.5", | ||
"@commercelayer/sdk": "^6.13.0", | ||
"@oclif/core": "^3.27.0", | ||
"axios": "^1.7.5", | ||
"cli-table3": "^0.6.5", | ||
@@ -85,3 +86,3 @@ "node-notifier": "^10.0.1", | ||
"spinnies": "^0.5.1", | ||
"tslib": "^2.6.2" | ||
"tslib": "^2.6.3" | ||
}, | ||
@@ -88,0 +89,0 @@ "publishConfig": { |
@@ -80,8 +80,4 @@ # @commercelayer/cli-plugin-exports | ||
USAGE | ||
$ commercelayer exports:all -t | ||
addresses|authorizations|bundles|captures|coupons|customer_addresses|customer_payment_sources|customer_subscriptions | ||
|customers|gift_cards|line_items|line_item_options|orders|payment_methods|price_tiers|prices|refunds|shipments|shipp | ||
ing_categories|shipping_methods|sku_lists|sku_list_items|sku_options|skus|stock_items|stock_transfers|tags|tax_categ | ||
ories|transactions|voids [-i <value>] [-w <value>] [-D] [-F csv|json | -C | ] [-x <value> | -X <value>] [-b] [-P | ] | ||
[-O] [-q] [-k] | ||
$ commercelayer exports:all -t addresses|authorizations|bundles|captures|... [-i <value>...] [-w <value>...] | ||
[-D] [-F csv|json | -C | ] [-x <value> | -X <value>] [-b] [-P | ] [-O] [-q] [-k] | ||
@@ -128,8 +124,4 @@ FLAGS | ||
USAGE | ||
$ commercelayer exports:create -t | ||
addresses|authorizations|bundles|captures|coupons|customer_addresses|customer_payment_sources|customer_subscriptions | ||
|customers|gift_cards|line_items|line_item_options|orders|payment_methods|price_tiers|prices|refunds|shipments|shipp | ||
ing_categories|shipping_methods|sku_lists|sku_list_items|sku_options|skus|stock_items|stock_transfers|tags|tax_categ | ||
ories|transactions|voids [-i <value>] [-w <value>] [-D] [-F csv|json | -C | ] [-x <value> | -X <value>] [-b] [-P | ] | ||
[-O] | ||
$ commercelayer exports:create -t addresses|authorizations|bundles|captures|... [-i <value>...] [-w <value>...] | ||
[-D] [-F csv|json | -C | ] [-x <value> | -X <value>] [-b] [-P | ] [-O] | ||
@@ -136,0 +128,0 @@ FLAGS |
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
2204
97361
10
276
+ Added@commercelayer/cli-ux@^1.0.5
+ Added@commercelayer/cli-ux@1.0.7(transitive)
Updated@commercelayer/sdk@^6.13.0
Updated@oclif/core@^3.27.0
Updatedaxios@^1.7.5
Updatedtslib@^2.6.3