@contentstack/cli-variants 1.1.0 → 1.1.1
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.
|
@@ -62,9 +62,9 @@ class VariantEntries extends variant_api_adapter_1.default {
|
|
|
62
62
|
};
|
|
63
63
|
super(Object.assign((0, omit_1.default)(config, ['helpers']), conf));
|
|
64
64
|
this.config = config;
|
|
65
|
-
this.entriesMapperPath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(config.backupDir),
|
|
65
|
+
this.entriesMapperPath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(config.backupDir), 'mapper', 'entries');
|
|
66
66
|
this.personalizeConfig = this.config.modules.personalize;
|
|
67
|
-
this.entriesDirPath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(config.backupDir), (0, cli_utilities_1.sanitizePath)(config.
|
|
67
|
+
this.entriesDirPath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(config.backupDir), (0, cli_utilities_1.sanitizePath)(config.modules.entries.dirName));
|
|
68
68
|
this.failedVariantPath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(this.entriesMapperPath), 'failed-entry-variants.json');
|
|
69
69
|
this.failedVariantEntries = new Map();
|
|
70
70
|
}
|
|
@@ -81,7 +81,7 @@ class VariantEntries extends variant_api_adapter_1.default {
|
|
|
81
81
|
const filePath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(this.entriesMapperPath), 'data-for-variant-entry.json');
|
|
82
82
|
const variantIdPath = (0, path_1.resolve)((0, cli_utilities_1.sanitizePath)(this.config.backupDir), 'mapper', (0, cli_utilities_1.sanitizePath)(this.personalizeConfig.dirName), (0, cli_utilities_1.sanitizePath)(this.personalizeConfig.experiences.dirName), 'variants-uid-mapping.json');
|
|
83
83
|
if (!(0, fs_1.existsSync)(filePath)) {
|
|
84
|
-
(0, utils_1.log)(this.config, this.messages.
|
|
84
|
+
(0, utils_1.log)(this.config, this.messages.VARIANT_ENTRY_FILE_NOT_FOUND, 'info');
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
if (!(0, fs_1.existsSync)(variantIdPath)) {
|
package/lib/messages/index.d.ts
CHANGED
package/lib/messages/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const migrationMsg = {
|
|
|
18
18
|
IMPORT_MSG: 'Migrating {module}...',
|
|
19
19
|
};
|
|
20
20
|
const variantEntry = {
|
|
21
|
+
VARIANT_ENTRY_FILE_NOT_FOUND: 'Variant entry file not found!',
|
|
21
22
|
IMPORT_ENTRY_NOT_FOUND: 'Entries data not found to import variant entries',
|
|
22
23
|
EMPTY_VARIANT_UID_DATA: 'Empty variants entry mapper found!',
|
|
23
24
|
VARIANT_ID_NOT_FOUND: 'Variant ID not found',
|
package/package.json
CHANGED
|
@@ -56,14 +56,12 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
56
56
|
super(Object.assign(omit(config, ['helpers']), conf));
|
|
57
57
|
this.entriesMapperPath = resolve(
|
|
58
58
|
sanitizePath(config.backupDir),
|
|
59
|
-
sanitizePath(config.branchName || ''),
|
|
60
59
|
'mapper',
|
|
61
60
|
'entries',
|
|
62
61
|
);
|
|
63
62
|
this.personalizeConfig = this.config.modules.personalize;
|
|
64
63
|
this.entriesDirPath = resolve(
|
|
65
64
|
sanitizePath(config.backupDir),
|
|
66
|
-
sanitizePath(config.branchName || ''),
|
|
67
65
|
sanitizePath(config.modules.entries.dirName),
|
|
68
66
|
);
|
|
69
67
|
this.failedVariantPath = resolve(sanitizePath(this.entriesMapperPath), 'failed-entry-variants.json');
|
|
@@ -89,7 +87,7 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
89
87
|
);
|
|
90
88
|
|
|
91
89
|
if (!existsSync(filePath)) {
|
|
92
|
-
log(this.config, this.messages.
|
|
90
|
+
log(this.config, this.messages.VARIANT_ENTRY_FILE_NOT_FOUND, 'info');
|
|
93
91
|
return;
|
|
94
92
|
}
|
|
95
93
|
|
package/src/messages/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ const migrationMsg = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const variantEntry = {
|
|
16
|
+
VARIANT_ENTRY_FILE_NOT_FOUND: 'Variant entry file not found!',
|
|
16
17
|
IMPORT_ENTRY_NOT_FOUND: 'Entries data not found to import variant entries',
|
|
17
18
|
EMPTY_VARIANT_UID_DATA: 'Empty variants entry mapper found!',
|
|
18
19
|
VARIANT_ID_NOT_FOUND: 'Variant ID not found',
|