Skip to content

Commit

Permalink
Merge pull request #1587 from contentstack/staging
Browse files Browse the repository at this point in the history
DX | 26-09-2024 | Variant EA Release
  • Loading branch information
aman19K authored Sep 26, 2024
2 parents eb3fd53 + e92c9f6 commit 34c5b27
Show file tree
Hide file tree
Showing 49 changed files with 484 additions and 242 deletions.
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ EXAMPLES
$ csdx plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/index.ts)_

## `csdx plugins:add PLUGIN`

Expand Down Expand Up @@ -343,7 +343,7 @@ EXAMPLES
$ csdx plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/inspect.ts)_

## `csdx plugins:install PLUGIN`

Expand Down Expand Up @@ -392,7 +392,7 @@ EXAMPLES
$ csdx plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/install.ts)_

## `csdx plugins:link PATH`

Expand Down Expand Up @@ -422,7 +422,7 @@ EXAMPLES
$ csdx plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/link.ts)_

## `csdx plugins:remove [PLUGIN]`

Expand Down Expand Up @@ -463,7 +463,7 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/reset.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/reset.ts)_

## `csdx plugins:uninstall [PLUGIN]`

Expand Down Expand Up @@ -491,7 +491,7 @@ EXAMPLES
$ csdx plugins:uninstall myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/uninstall.ts)_

## `csdx plugins:unlink [PLUGIN]`

Expand Down Expand Up @@ -535,5 +535,5 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.8/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.9/src/commands/plugins/update.ts)_
<!-- commandsstop -->
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/1.11.0 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-bootstrap/1.12.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.11.0",
"version": "1.12.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -17,7 +17,7 @@
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
},
"dependencies": {
"@contentstack/cli-cm-seed": "~1.8.0",
"@contentstack/cli-cm-seed": "~1.9.0",
"@contentstack/cli-command": "~1.3.0",
"@contentstack/cli-utilities": "~1.7.2",
"inquirer": "8.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-clone/1.11.1 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-clone/1.12.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.11.1",
"version": "1.12.0",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
"@colors/colors": "^1.5.0",
"@contentstack/cli-cm-export": "~1.12.0",
"@contentstack/cli-cm-import": "~1.17.0",
"@contentstack/cli-cm-export": "~1.13.0",
"@contentstack/cli-cm-import": "~1.18.0",
"@contentstack/cli-command": "~1.3.0",
"@contentstack/cli-utilities": "~1.7.2",
"async": "^3.2.4",
Expand Down
10 changes: 5 additions & 5 deletions packages/contentstack-config/src/utils/region-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const regions = {
name: 'NA',
'developerHubUrl': 'https://developerhub-api.contentstack.com',
'launchHubUrl': 'https://launch-api.contentstack.com',
'personalizeUrl': 'https://personalization-api.contentstack.com',
'personalizeUrl': 'https://personalize-api.contentstack.com',
},
EU: {
cma: 'https://eu-api.contentstack.com',
Expand All @@ -33,7 +33,7 @@ const regions = {
name: 'EU',
'developerHubUrl': 'https://eu-developerhub-api.contentstack.com',
'launchHubUrl': 'https://eu-launch-api.contentstack.com',
'personalizeUrl': 'Not available',
'personalizeUrl': 'https://eu-personalize-api.contentstack.com',
},
'AZURE-NA': {
cma: 'https://azure-na-api.contentstack.com',
Expand All @@ -42,7 +42,7 @@ const regions = {
name: 'AZURE-NA',
'developerHubUrl': 'https://azure-na-developerhub-api.contentstack.com',
'launchHubUrl': 'https://azure-na-launch-api.contentstack.com',
'personalizeUrl': 'Not available',
'personalizeUrl': 'https://azure-na-personalize-api.contentstack.com',
},
'AZURE-EU': {
cma: 'https://azure-eu-api.contentstack.com',
Expand All @@ -51,7 +51,7 @@ const regions = {
name: 'AZURE-EU',
'developerHubUrl': 'https://azure-eu-developerhub-api.contentstack.com',
'launchHubUrl': 'https://azure-eu-launch-api.contentstack.com',
'personalizeUrl': 'Not available',
'personalizeUrl': 'https://azure-eu-personalize-api.contentstack.com',
},
'GCP-NA': {
cma: 'https://gcp-na-api.contentstack.com',
Expand All @@ -60,7 +60,7 @@ const regions = {
name: 'GCP-NA',
'developerHubUrl': 'https://gcp-na-developerhub-api.contentstack.com',
'launchHubUrl': 'Not available',
'personalizeUrl': 'Not available',
'personalizeUrl': 'https://gcp-na-personalize-api.contentstack.com',
},
};

Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-export/1.12.1 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-export/1.13.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@contentstack/cli-cm-export",
"description": "Contentstack CLI plugin to export content from stack",
"version": "1.12.1",
"version": "1.13.0",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.3.0",
"@contentstack/cli-variants": "~0.0.1-alpha",
"@contentstack/cli-variants": "~1.0.0",
"@contentstack/cli-utilities": "~1.7.2",
"@oclif/core": "^3.26.5",
"async": "^3.2.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export default class ExportCommand extends Command {
exportConfig.host = this.cmaHost;
exportConfig.region = this.region;
exportConfig.developerHubBaseUrl = this.developerHubUrl;
if (this.personalizeUrl) exportConfig.modules.personalize.baseURL[exportConfig.region.name] = this.personalizeUrl;
exportDir = exportConfig.cliLogsPath || exportConfig.data || exportConfig.exportDir;
const managementAPIClient: ContentstackClient = await managementSDKClient(exportConfig);
const moduleExporter = new ModuleExporter(managementAPIClient, exportConfig);
Expand Down
8 changes: 4 additions & 4 deletions packages/contentstack-export/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const config: DefaultConfig = {
'content-types',
'custom-roles',
'workflows',
'personalization',
'personalize',
'entries',
'labels',
'marketplace-apps',
Expand Down Expand Up @@ -144,11 +144,11 @@ const config: DefaultConfig = {
dependencies: ['locales', 'content-types'],
exportVersions: false,
},
personalization: {
personalize: {
baseURL: {
NA: 'https://personalization-api.contentstack.com',
NA: 'https://personalize-api.contentstack.com',
},
dirName: 'personalization',
dirName: 'personalize',
exportOrder: ['attributes', 'audiences', 'events', 'experiences'],
projects: {
dirName: 'projects',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
import { log, formatError } from '../../utils';
import { ModuleClassParams, ExportConfig } from '../../types';

export default class ExportPersonalization {
export default class ExportPersonalize {
public exportConfig: ExportConfig;
public personalizeConfig: { dirName: string; baseURL: Record<string, string> } & AnyProperty;
constructor({ exportConfig }: ModuleClassParams) {
this.exportConfig = exportConfig;
this.personalizeConfig = exportConfig.modules.personalization;
this.personalizeConfig = exportConfig.modules.personalize;
}

async start(): Promise<void> {
Expand All @@ -39,7 +39,7 @@ export default class ExportPersonalization {
experiences: new ExportExperiences(this.exportConfig),
};

const order: (keyof typeof moduleMapper)[] = this.exportConfig.modules.personalization
const order: (keyof typeof moduleMapper)[] = this.exportConfig.modules.personalize
.exportOrder as (keyof typeof moduleMapper)[];

for (const module of order) {
Expand All @@ -51,8 +51,12 @@ export default class ExportPersonalization {
}
}
} catch (error) {
if (error === 'Forbidden') {
log(this.exportConfig, "Personalize is not enabled in the given organization!", 'info');
} else {
log(this.exportConfig, error, 'error');
}
this.exportConfig.personalizationEnabled = false;
log(this.exportConfig, error, 'error');
}
}
}
2 changes: 1 addition & 1 deletion packages/contentstack-export/src/types/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default interface DefaultConfig {
dependencies?: Modules[];
exportVersions: boolean;
};
personalization: {
personalize: {
dirName: string;
baseURL: Record<string, string>;
} & AnyProperty;
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type Modules =
| 'labels'
| 'marketplace-apps'
| 'taxonomies'
| 'personalization';
| 'personalize';

export type ModuleClassParams = {
stackAPIClient: ReturnType<ContentstackClient['stack']>;
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/1.17.1 darwin-arm64 node-v22.2.0
@contentstack/cli-cm-import/1.18.0 darwin-arm64 node-v22.2.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
Loading

0 comments on commit 34c5b27

Please sign in to comment.