@contentstack/cli-cm-export 1.12.1 → 1.13.0

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
@@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
48
48
  $ csdx COMMAND
49
49
  running command...
50
50
  $ csdx (--version)
51
- @contentstack/cli-cm-export/1.12.1 linux-x64 node-v18.20.4
51
+ @contentstack/cli-cm-export/1.13.0 linux-x64 node-v18.20.4
52
52
  $ csdx --help [COMMAND]
53
53
  USAGE
54
54
  $ csdx COMMAND
@@ -17,6 +17,8 @@ class ExportCommand extends cli_command_1.Command {
17
17
  exportConfig.host = this.cmaHost;
18
18
  exportConfig.region = this.region;
19
19
  exportConfig.developerHubBaseUrl = this.developerHubUrl;
20
+ if (this.personalizeUrl)
21
+ exportConfig.modules.personalize.baseURL[exportConfig.region.name] = this.personalizeUrl;
20
22
  exportDir = exportConfig.cliLogsPath || exportConfig.data || exportConfig.exportDir;
21
23
  const managementAPIClient = await (0, cli_utilities_1.managementSDKClient)(exportConfig);
22
24
  const moduleExporter = new export_1.ModuleExporter(managementAPIClient, exportConfig);
@@ -33,7 +33,7 @@ const config = {
33
33
  'content-types',
34
34
  'custom-roles',
35
35
  'workflows',
36
- 'personalization',
36
+ 'personalize',
37
37
  'entries',
38
38
  'labels',
39
39
  'marketplace-apps',
@@ -144,11 +144,11 @@ const config = {
144
144
  dependencies: ['locales', 'content-types'],
145
145
  exportVersions: false,
146
146
  },
147
- personalization: {
147
+ personalize: {
148
148
  baseURL: {
149
- NA: 'https://personalization-api.contentstack.com',
149
+ NA: 'https://personalize-api.contentstack.com',
150
150
  },
151
- dirName: 'personalization',
151
+ dirName: 'personalize',
152
152
  exportOrder: ['attributes', 'audiences', 'events', 'experiences'],
153
153
  projects: {
154
154
  dirName: 'projects',
@@ -1,6 +1,6 @@
1
1
  import { AnyProperty } from '@contentstack/cli-variants';
2
2
  import { ModuleClassParams, ExportConfig } from '../../types';
3
- export default class ExportPersonalization {
3
+ export default class ExportPersonalize {
4
4
  exportConfig: ExportConfig;
5
5
  personalizeConfig: {
6
6
  dirName: string;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const cli_variants_1 = require("@contentstack/cli-variants");
4
4
  const utils_1 = require("../../utils");
5
- class ExportPersonalization {
5
+ class ExportPersonalize {
6
6
  constructor({ exportConfig }) {
7
7
  this.exportConfig = exportConfig;
8
- this.personalizeConfig = exportConfig.modules.personalization;
8
+ this.personalizeConfig = exportConfig.modules.personalize;
9
9
  }
10
10
  async start() {
11
11
  try {
@@ -27,7 +27,7 @@ class ExportPersonalization {
27
27
  audiences: new cli_variants_1.ExportAudiences(this.exportConfig),
28
28
  experiences: new cli_variants_1.ExportExperiences(this.exportConfig),
29
29
  };
30
- const order = this.exportConfig.modules.personalization
30
+ const order = this.exportConfig.modules.personalize
31
31
  .exportOrder;
32
32
  for (const module of order) {
33
33
  if (moduleMapper[module]) {
@@ -40,9 +40,14 @@ class ExportPersonalization {
40
40
  }
41
41
  }
42
42
  catch (error) {
43
+ if (error === 'Forbidden') {
44
+ (0, utils_1.log)(this.exportConfig, "Personalize is not enabled in the given organization!", 'info');
45
+ }
46
+ else {
47
+ (0, utils_1.log)(this.exportConfig, error, 'error');
48
+ }
43
49
  this.exportConfig.personalizationEnabled = false;
44
- (0, utils_1.log)(this.exportConfig, error, 'error');
45
50
  }
46
51
  }
47
52
  }
48
- exports.default = ExportPersonalization;
53
+ exports.default = ExportPersonalize;
@@ -109,7 +109,7 @@ export default interface DefaultConfig {
109
109
  dependencies?: Modules[];
110
110
  exportVersions: boolean;
111
111
  };
112
- personalization: {
112
+ personalize: {
113
113
  dirName: string;
114
114
  baseURL: Record<string, string>;
115
115
  } & AnyProperty;
@@ -26,7 +26,7 @@ export interface Region {
26
26
  cda: string;
27
27
  uiHost: string;
28
28
  }
29
- export type Modules = 'stack' | 'assets' | 'locales' | 'environments' | 'extensions' | 'webhooks' | 'global-fields' | 'entries' | 'content-types' | 'custom-roles' | 'workflows' | 'labels' | 'marketplace-apps' | 'taxonomies' | 'personalization';
29
+ export type Modules = 'stack' | 'assets' | 'locales' | 'environments' | 'extensions' | 'webhooks' | 'global-fields' | 'entries' | 'content-types' | 'custom-roles' | 'workflows' | 'labels' | 'marketplace-apps' | 'taxonomies' | 'personalize';
30
30
  export type ModuleClassParams = {
31
31
  stackAPIClient: ReturnType<ContentstackClient['stack']>;
32
32
  exportConfig: ExportConfig;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.12.1",
2
+ "version": "1.13.0",
3
3
  "commands": {
4
4
  "cm:stacks:export": {
5
5
  "id": "cm:stacks:export",
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-export",
3
3
  "description": "Contentstack CLI plugin to export content from stack",
4
- "version": "1.12.1",
4
+ "version": "1.13.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
8
  "@contentstack/cli-command": "~1.3.0",
9
- "@contentstack/cli-variants": "~0.0.1-alpha",
9
+ "@contentstack/cli-variants": "~1.0.0",
10
10
  "@contentstack/cli-utilities": "~1.7.2",
11
11
  "@oclif/core": "^3.26.5",
12
12
  "async": "^3.2.4",