@contentstack/cli-variants 2.0.0-beta.7 → 2.0.0-beta.9
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/lib/import/audiences.js
CHANGED
|
@@ -39,7 +39,7 @@ class Audiences extends utils_1.PersonalizationAdapter {
|
|
|
39
39
|
*/
|
|
40
40
|
import() {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a, _b
|
|
42
|
+
var _a, _b;
|
|
43
43
|
try {
|
|
44
44
|
cli_utilities_1.log.debug('Starting audiences import...', this.config.context);
|
|
45
45
|
const [canImport, audiencesCount] = yield this.analyzeAudiences();
|
|
@@ -73,15 +73,9 @@ class Audiences extends utils_1.PersonalizationAdapter {
|
|
|
73
73
|
progress.updateStatus(constants_1.IMPORT_PROCESS_STATUS[constants_1.PROCESS_NAMES.AUDIENCES].CREATING);
|
|
74
74
|
}
|
|
75
75
|
cli_utilities_1.log.debug(`Processing audience: ${name} (${uid})`, this.config.context);
|
|
76
|
-
// Skip Lytics audiences - they cannot be created via API (synced from Lytics)
|
|
77
|
-
if (((_a = audience.source) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'LYTICS') {
|
|
78
|
-
cli_utilities_1.log.debug(`Skipping Lytics audience: ${name} (${uid})`, this.config.context);
|
|
79
|
-
this.updateProgress(true, `audience: ${name} (skipped - Lytics)`, undefined, constants_1.PROCESS_NAMES.AUDIENCES);
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
76
|
try {
|
|
83
77
|
//check whether reference attributes exists or not
|
|
84
|
-
if ((
|
|
78
|
+
if ((_a = definition.rules) === null || _a === void 0 ? void 0 : _a.length) {
|
|
85
79
|
cli_utilities_1.log.debug(`Processing ${definition.rules.length} definition rules for audience: ${name}`, this.config.context);
|
|
86
80
|
definition.rules = (0, utils_1.lookUpAttributes)(definition.rules, attributesUid);
|
|
87
81
|
cli_utilities_1.log.debug(`Processed definition rules, remaining rules: ${definition.rules.length}`, this.config.context);
|
|
@@ -93,7 +87,7 @@ class Audiences extends utils_1.PersonalizationAdapter {
|
|
|
93
87
|
const audienceRes = yield this.createAudience({ definition, name, description });
|
|
94
88
|
//map old audience uid to new audience uid
|
|
95
89
|
//mapper file is used to check whether audience created or not before creating experience
|
|
96
|
-
this.audiencesUidMapper[uid] = (
|
|
90
|
+
this.audiencesUidMapper[uid] = (_b = audienceRes === null || audienceRes === void 0 ? void 0 : audienceRes.uid) !== null && _b !== void 0 ? _b : '';
|
|
97
91
|
this.updateProgress(true, `audience: ${name}`, undefined, constants_1.PROCESS_NAMES.AUDIENCES);
|
|
98
92
|
cli_utilities_1.log.debug(`Created audience: ${uid} -> ${audienceRes === null || audienceRes === void 0 ? void 0 : audienceRes.uid}`, this.config.context);
|
|
99
93
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-variants",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.9",
|
|
4
4
|
"description": "Variants plugin",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
+
"build": "pnpm compile",
|
|
8
9
|
"prepack": "pnpm compile",
|
|
9
10
|
"compile": "tsc -b tsconfig.json",
|
|
10
11
|
"test": "mocha --require ts-node/register --forbid-only \"test/**/*.test.ts\"",
|
|
11
|
-
"clean": "rm -rf ./lib ./node_modules tsconfig.
|
|
12
|
+
"clean": "rm -rf ./lib ./node_modules tsconfig.tsbuildinfo",
|
|
12
13
|
"test:unit:report": "nyc --extension .ts mocha --require ts-node/register --forbid-only \"test/unit/**/*.test.ts\""
|
|
13
14
|
},
|
|
14
15
|
"keywords": [
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
"author": "antony.raj@contentstack.com",
|
|
18
19
|
"license": "MIT",
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@contentstack/cli-dev-dependencies": "^
|
|
21
|
+
"@contentstack/cli-dev-dependencies": "^2.0.0-beta.0",
|
|
21
22
|
"@oclif/plugin-help": "^6.2.28",
|
|
22
23
|
"@oclif/test": "^4.1.13",
|
|
23
24
|
"@types/node": "^20.17.50",
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"typescript": "^5.8.3"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@contentstack/cli-utilities": "~2.0.0-beta.
|
|
31
|
+
"@contentstack/cli-utilities": "~2.0.0-beta.3",
|
|
31
32
|
"@oclif/core": "^4.3.0",
|
|
32
33
|
"@oclif/plugin-help": "^6.2.28",
|
|
33
34
|
"lodash": "^4.17.23",
|
package/src/import/audiences.ts
CHANGED
|
@@ -89,16 +89,9 @@ export default class Audiences extends PersonalizationAdapter<ImportConfig> {
|
|
|
89
89
|
}
|
|
90
90
|
log.debug(`Processing audience: ${name} (${uid})`, this.config.context);
|
|
91
91
|
|
|
92
|
-
// Skip Lytics audiences - they cannot be created via API (synced from Lytics)
|
|
93
|
-
if ((audience as any).source?.toUpperCase() === 'LYTICS') {
|
|
94
|
-
log.debug(`Skipping Lytics audience: ${name} (${uid})`, this.config.context);
|
|
95
|
-
this.updateProgress(true, `audience: ${name} (skipped - Lytics)`, undefined, PROCESS_NAMES.AUDIENCES);
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
92
|
try {
|
|
100
93
|
//check whether reference attributes exists or not
|
|
101
|
-
if (definition
|
|
94
|
+
if (definition.rules?.length) {
|
|
102
95
|
log.debug(
|
|
103
96
|
`Processing ${definition.rules.length} definition rules for audience: ${name}`,
|
|
104
97
|
this.config.context,
|