@contentstack/cli-cm-import 2.0.0-beta.1 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
47
47
  $ csdx COMMAND
48
48
  running command...
49
49
  $ csdx (--version)
50
- @contentstack/cli-cm-import/2.0.0-beta.1 linux-x64 node-v22.20.0
50
+ @contentstack/cli-cm-import/2.0.0-beta.2 linux-x64 node-v22.21.1
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -10,6 +10,7 @@ export type ApiOptions = {
10
10
  url?: string;
11
11
  entity: ApiModuleType;
12
12
  apiData?: Record<any, any> | any;
13
+ queryParam?: Record<any, any>;
13
14
  resolve: (value: any) => Promise<void> | void;
14
15
  reject: (error: any) => Promise<void> | void;
15
16
  additionalInfo?: Record<any, any>;
@@ -337,7 +337,9 @@ class BaseClass {
337
337
  if (!apiData || !apiData.filePath) {
338
338
  return Promise.resolve();
339
339
  }
340
- return this.stack.taxonomy(uid).import({ taxonomy: apiData.filePath }).then(onSuccess).catch(onReject);
340
+ const importParams = { taxonomy: apiData.filePath };
341
+ const importQueryParam = apiOptions.queryParam || {};
342
+ return this.stack.taxonomy(uid).import(importParams, importQueryParam).then(onSuccess).catch(onReject);
341
343
  default:
342
344
  return Promise.resolve();
343
345
  }
@@ -48,6 +48,7 @@ export default interface ImportConfig extends DefaultConfig, ExternalConfig {
48
48
  authtoken?: string;
49
49
  destinationStackName?: string;
50
50
  org_uid?: string;
51
+ contentVersion: number;
51
52
  replaceExisting?: boolean;
52
53
  skipExisting?: boolean;
53
54
  skipAudit?: boolean;
@@ -212,5 +212,5 @@
212
212
  ]
213
213
  }
214
214
  },
215
- "version": "2.0.0-beta.1"
215
+ "version": "2.0.0-beta.2"
216
216
  }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-import",
3
3
  "description": "Contentstack CLI plugin to import content into stack",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0-beta.2",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-audit": "~1.14.1",
8
+ "@contentstack/cli-audit": "~1.16.0",
9
9
  "@contentstack/cli-command": "~1.6.1",
10
10
  "@contentstack/cli-utilities": "~1.15.0",
11
11
  "@contentstack/management": "~1.22.0",
12
- "@contentstack/cli-variants": "~2.0.0-beta",
12
+ "@contentstack/cli-variants": "~2.0.0-beta.2",
13
13
  "@oclif/core": "^4.3.0",
14
14
  "big-json": "^3.2.0",
15
15
  "bluebird": "^3.7.2",
@@ -32,6 +32,7 @@
32
32
  "@types/mkdirp": "^1.0.2",
33
33
  "@types/mocha": "^8.2.3",
34
34
  "@types/node": "^14.18.63",
35
+ "@types/rewire": "^2.5.30",
35
36
  "@types/tar": "^6.1.13",
36
37
  "@types/uuid": "^9.0.8",
37
38
  "@typescript-eslint/eslint-plugin": "^5.62.0",
@@ -40,6 +41,7 @@
40
41
  "mocha": "^10.8.2",
41
42
  "nyc": "^15.1.0",
42
43
  "oclif": "^4.17.46",
44
+ "rewire": "^9.0.1",
43
45
  "ts-node": "^10.9.2",
44
46
  "typescript": "^4.9.5"
45
47
  },
@@ -57,7 +59,8 @@
57
59
  "lint": "eslint src/**/*.ts",
58
60
  "format": "eslint src/**/*.ts --fix",
59
61
  "test:integration": "mocha --forbid-only \"test/run.test.js\" --integration-test --timeout 60000",
60
- "test:unit": "mocha --forbid-only \"test/unit/*.test.ts\""
62
+ "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"",
63
+ "test:unit": "mocha --forbid-only \"test/**/*.test.ts\""
61
64
  },
62
65
  "engines": {
63
66
  "node": ">=14.0.0"