@contentstack/cli-variants 1.3.3 → 2.0.0-beta.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.
- package/lib/export/attributes.d.ts +2 -2
- package/lib/export/attributes.js +51 -23
- package/lib/export/audiences.d.ts +2 -2
- package/lib/export/audiences.js +50 -24
- package/lib/export/events.d.ts +2 -2
- package/lib/export/events.js +52 -24
- package/lib/export/experiences.js +87 -54
- package/lib/export/projects.d.ts +3 -2
- package/lib/export/projects.js +55 -63
- package/lib/export/variant-entries.d.ts +19 -0
- package/lib/export/variant-entries.js +76 -1
- package/lib/import/attribute.d.ts +2 -0
- package/lib/import/attribute.js +83 -37
- package/lib/import/audiences.d.ts +2 -0
- package/lib/import/audiences.js +85 -41
- package/lib/import/events.d.ts +3 -1
- package/lib/import/events.js +86 -30
- package/lib/import/experiences.d.ts +2 -0
- package/lib/import/experiences.js +93 -39
- package/lib/import/project.d.ts +2 -0
- package/lib/import/project.js +81 -22
- package/lib/import/variant-entries.d.ts +10 -0
- package/lib/import/variant-entries.js +132 -47
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/types/export-config.d.ts +0 -2
- package/lib/types/import-config.d.ts +0 -1
- package/lib/types/utils.d.ts +1 -1
- package/lib/utils/constants.d.ts +91 -0
- package/lib/utils/constants.js +93 -0
- package/lib/utils/personalization-api-adapter.d.ts +34 -1
- package/lib/utils/personalization-api-adapter.js +171 -44
- package/lib/utils/variant-api-adapter.d.ts +28 -1
- package/lib/utils/variant-api-adapter.js +75 -0
- package/package.json +2 -2
- package/src/export/attributes.ts +84 -34
- package/src/export/audiences.ts +87 -41
- package/src/export/events.ts +84 -41
- package/src/export/experiences.ts +155 -83
- package/src/export/projects.ts +71 -39
- package/src/export/variant-entries.ts +136 -12
- package/src/import/attribute.ts +105 -49
- package/src/import/audiences.ts +110 -54
- package/src/import/events.ts +104 -41
- package/src/import/experiences.ts +140 -62
- package/src/import/project.ts +108 -38
- package/src/import/variant-entries.ts +179 -65
- package/src/index.ts +2 -1
- package/src/types/export-config.ts +0 -2
- package/src/types/import-config.ts +0 -1
- package/src/types/utils.ts +1 -1
- package/src/utils/constants.ts +98 -0
- package/src/utils/personalization-api-adapter.ts +202 -66
- package/src/utils/variant-api-adapter.ts +82 -1
- package/tsconfig.json +1 -1
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
PublishVariantEntryDto,
|
|
24
24
|
} from '../types';
|
|
25
25
|
import { fsUtil } from '../utils';
|
|
26
|
+
import { PROCESS_NAMES, MODULE_CONTEXTS } from '../utils/constants';
|
|
26
27
|
|
|
27
28
|
export default class VariantEntries extends VariantAdapter<VariantHttpClient<ImportConfig>> {
|
|
28
29
|
public entriesDirPath: string;
|
|
@@ -39,6 +40,8 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
39
40
|
private failedVariantPath!: string;
|
|
40
41
|
private failedVariantEntries!: Record<string, any>;
|
|
41
42
|
private environments!: Record<string, any>;
|
|
43
|
+
public progress: any;
|
|
44
|
+
private processInitialized: boolean = false;
|
|
42
45
|
|
|
43
46
|
constructor(readonly config: ImportConfig & { helpers?: ImportHelperMethodsConfig }) {
|
|
44
47
|
const conf: APIConfig & AdapterType<VariantHttpClient<ImportConfig>, APIConfig> = {
|
|
@@ -61,7 +64,24 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
61
64
|
this.failedVariantPath = resolve(sanitizePath(this.entriesMapperPath), 'failed-entry-variants.json');
|
|
62
65
|
this.failedVariantEntries = new Map();
|
|
63
66
|
if (this.config && this.config.context) {
|
|
64
|
-
this.config.context.module =
|
|
67
|
+
this.config.context.module = MODULE_CONTEXTS.VARIANT_ENTRIES;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Set parent progress manager for integration with entries module
|
|
73
|
+
*/
|
|
74
|
+
public setParentProgressManager(parentProgress: any): void {
|
|
75
|
+
this.parentProgressManager = parentProgress;
|
|
76
|
+
this.progress = parentProgress;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Update progress for a specific item
|
|
81
|
+
*/
|
|
82
|
+
protected updateProgress(success: boolean, itemName: string, error?: string, processName?: string): void {
|
|
83
|
+
if (this.progress) {
|
|
84
|
+
this.progress.tick(success, itemName, error, processName);
|
|
65
85
|
}
|
|
66
86
|
}
|
|
67
87
|
|
|
@@ -74,70 +94,71 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
74
94
|
* message indicating that no entries were found and return.
|
|
75
95
|
*/
|
|
76
96
|
async import() {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
try {
|
|
98
|
+
const filePath = resolve(sanitizePath(this.entriesMapperPath), 'data-for-variant-entry.json');
|
|
99
|
+
const variantIdPath = resolve(
|
|
100
|
+
sanitizePath(this.config.backupDir),
|
|
101
|
+
'mapper',
|
|
102
|
+
sanitizePath(this.personalizeConfig.dirName),
|
|
103
|
+
sanitizePath(this.personalizeConfig.experiences.dirName),
|
|
104
|
+
'variants-uid-mapping.json',
|
|
105
|
+
);
|
|
85
106
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
107
|
+
log.debug(`Checking for variant entry data file: ${filePath}`, this.config.context);
|
|
108
|
+
if (!existsSync(filePath)) {
|
|
109
|
+
log.warn(`Variant entry data file not found at path: ${filePath}, skipping import`, this.config.context);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
91
112
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
113
|
+
log.debug(`Checking for variant ID mapping file: ${variantIdPath}`, this.config.context);
|
|
114
|
+
if (!existsSync(variantIdPath)) {
|
|
115
|
+
log.error('Variant UID mapping file not found', this.config.context);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
97
118
|
|
|
98
|
-
|
|
99
|
-
|
|
119
|
+
const entriesForVariants = fsUtil.readFile(filePath, true) as EntryDataForVariantEntries[];
|
|
120
|
+
log.debug(`Loaded ${entriesForVariants?.length || 0} entries for variant processing`, this.config.context);
|
|
100
121
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
122
|
+
if (isEmpty(entriesForVariants)) {
|
|
123
|
+
log.warn('No entries found for variant import', this.config.context);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
105
126
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
const entriesUidMapperPath = join(sanitizePath(this.entriesMapperPath), 'uid-mapping.json');
|
|
128
|
+
const assetUidMapperPath = resolve(sanitizePath(this.config.backupDir), 'mapper', 'assets', 'uid-mapping.json');
|
|
129
|
+
const assetUrlMapperPath = resolve(sanitizePath(this.config.backupDir), 'mapper', 'assets', 'url-mapping.json');
|
|
130
|
+
const taxonomiesPath = resolve(
|
|
131
|
+
sanitizePath(this.config.backupDir),
|
|
132
|
+
'mapper',
|
|
133
|
+
sanitizePath(this.config.modules.taxonomies.dirName),
|
|
134
|
+
'terms',
|
|
135
|
+
'success.json',
|
|
136
|
+
);
|
|
137
|
+
const marketplaceAppMapperPath = resolve(
|
|
138
|
+
sanitizePath(this.config.backupDir),
|
|
139
|
+
'mapper',
|
|
140
|
+
'marketplace_apps',
|
|
141
|
+
'uid-mapping.json',
|
|
142
|
+
);
|
|
143
|
+
const envPath = resolve(sanitizePath(this.config.backupDir), 'environments', 'environments.json');
|
|
123
144
|
|
|
124
|
-
|
|
145
|
+
log.debug('Loading variant ID mapping and dependency data', this.config.context);
|
|
125
146
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
147
|
+
// NOTE Read and store list of variant IDs
|
|
148
|
+
this.variantIdList = (fsUtil.readFile(variantIdPath, true) || {}) as Record<string, unknown>;
|
|
149
|
+
if (isEmpty(this.variantIdList)) {
|
|
150
|
+
log.warn('Empty variant UID data found', this.config.context);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
132
153
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
154
|
+
// NOTE entry relational data lookup dependencies.
|
|
155
|
+
this.entriesUidMapper = (fsUtil.readFile(entriesUidMapperPath, true) || {}) as Record<string, any>;
|
|
156
|
+
this.installedExtensions = ((fsUtil.readFile(marketplaceAppMapperPath) as any) || { extension_uid: {} })
|
|
157
|
+
.extension_uid as Record<string, any>[];
|
|
158
|
+
this.taxonomies = (fsUtil.readFile(taxonomiesPath, true) || {}) as Record<string, unknown>;
|
|
159
|
+
this.assetUidMapper = (fsUtil.readFile(assetUidMapperPath, true) || {}) as Record<string, any>;
|
|
160
|
+
this.assetUrlMapper = (fsUtil.readFile(assetUrlMapperPath, true) || {}) as Record<string, any>;
|
|
161
|
+
this.environments = (fsUtil.readFile(envPath, true) || {}) as Record<string, any>;
|
|
141
162
|
|
|
142
163
|
log.debug(
|
|
143
164
|
`Loaded dependency data - Entries: ${Object.keys(this.entriesUidMapper)?.length}, Assets: ${
|
|
@@ -146,14 +167,68 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
146
167
|
this.config.context,
|
|
147
168
|
);
|
|
148
169
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
170
|
+
// Initialize progress manager - will be set up lazily when first variants are found
|
|
171
|
+
if (this.parentProgressManager) {
|
|
172
|
+
this.progress = this.parentProgressManager;
|
|
173
|
+
log.debug('Using parent progress manager for variant entries import', this.config.context);
|
|
174
|
+
} else {
|
|
175
|
+
this.progress = this.createSimpleProgress(PROCESS_NAMES.VARIANT_ENTRIES);
|
|
176
|
+
log.debug('Created standalone progress manager for variant entries import', this.config.context);
|
|
177
|
+
}
|
|
155
178
|
|
|
156
|
-
|
|
179
|
+
// set the token
|
|
180
|
+
await this.variantInstance.init();
|
|
181
|
+
log.info(`Processing ${entriesForVariants?.length} entries for variant import`, this.config.context);
|
|
182
|
+
for (const entriesForVariant of entriesForVariants) {
|
|
183
|
+
try {
|
|
184
|
+
await this.importVariantEntries(entriesForVariant);
|
|
185
|
+
log.debug(
|
|
186
|
+
`Successfully processed variant entry: ${entriesForVariant.content_type}/${entriesForVariant.locale}/${entriesForVariant.entry_uid}`,
|
|
187
|
+
this.config.context,
|
|
188
|
+
);
|
|
189
|
+
} catch (error) {
|
|
190
|
+
handleAndLogError(
|
|
191
|
+
error,
|
|
192
|
+
this.config.context,
|
|
193
|
+
`Failed to import variant entry: ${entriesForVariant.content_type}/${entriesForVariant.locale}/${entriesForVariant.entry_uid}`,
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Complete progress if we initialized it and own the progress manager
|
|
199
|
+
if (this.processInitialized && this.progress) {
|
|
200
|
+
const processName = this.parentProgressManager ? 'Variant Entries' : PROCESS_NAMES.VARIANT_ENTRIES;
|
|
201
|
+
this.progress.completeProcess(processName, true);
|
|
202
|
+
log.success(
|
|
203
|
+
`Completed import of variant entries across ${entriesForVariants.length} entries`,
|
|
204
|
+
this.config.context,
|
|
205
|
+
);
|
|
206
|
+
} else if (entriesForVariants.length === 0) {
|
|
207
|
+
log.info(`No variant entries found for import`, this.config.context);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Only complete overall progress if we own the progress manager (no parent)
|
|
211
|
+
if (!this.parentProgressManager) {
|
|
212
|
+
this.completeProgress(true);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
log.success(
|
|
216
|
+
`Variant entries imported successfully! Total entries: ${entriesForVariants.length} - processing completed`,
|
|
217
|
+
this.config.context,
|
|
218
|
+
);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
// Complete progress with error if we initialized it
|
|
221
|
+
if (this.processInitialized && this.progress) {
|
|
222
|
+
const processName = this.parentProgressManager ? 'Variant Entries' : PROCESS_NAMES.VARIANT_ENTRIES;
|
|
223
|
+
this.progress.completeProcess(processName, false);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!this.parentProgressManager) {
|
|
227
|
+
this.completeProgress(false, (error as any)?.message || 'Variant entries import failed');
|
|
228
|
+
}
|
|
229
|
+
handleAndLogError(error, this.config.context, 'Variant entries import failed');
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
157
232
|
}
|
|
158
233
|
|
|
159
234
|
/**
|
|
@@ -162,6 +237,7 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
162
237
|
* @param {EntryDataForVariantEntries} entriesForVariant - EntryDataForVariantEntries {
|
|
163
238
|
*/
|
|
164
239
|
async importVariantEntries(entriesForVariant: EntryDataForVariantEntries) {
|
|
240
|
+
let totalVariantEntries = 0;
|
|
165
241
|
const variantEntry = this.config.modules.variantEntry;
|
|
166
242
|
const { content_type, locale, entry_uid } = entriesForVariant;
|
|
167
243
|
|
|
@@ -194,7 +270,30 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
194
270
|
try {
|
|
195
271
|
const variantEntries = (await fs.readChunkFiles.next()) as VariantEntryStruct[];
|
|
196
272
|
if (variantEntries?.length) {
|
|
197
|
-
|
|
273
|
+
totalVariantEntries = totalVariantEntries + variantEntries.length;
|
|
274
|
+
|
|
275
|
+
// Initialize progress ONLY when we find the first variants (lazy initialization)
|
|
276
|
+
if (!this.processInitialized && this.progress) {
|
|
277
|
+
const processName = this.parentProgressManager ? 'Variant Entries' : PROCESS_NAMES.VARIANT_ENTRIES;
|
|
278
|
+
|
|
279
|
+
if (this.parentProgressManager) {
|
|
280
|
+
// Update the existing process total instead of creating a new one
|
|
281
|
+
this.progress.updateProcessTotal(processName, variantEntries.length);
|
|
282
|
+
} else {
|
|
283
|
+
this.progress.addProcess(PROCESS_NAMES.VARIANT_ENTRIES, variantEntries.length);
|
|
284
|
+
this.progress.startProcess(PROCESS_NAMES.VARIANT_ENTRIES);
|
|
285
|
+
}
|
|
286
|
+
this.processInitialized = true;
|
|
287
|
+
log.debug(`Initialized variant entries progress with first batch of ${variantEntries.length} variants`, this.config.context);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (this.processInitialized && this.progress) {
|
|
291
|
+
const processName = this.parentProgressManager ? 'Variant Entries' : PROCESS_NAMES.VARIANT_ENTRIES;
|
|
292
|
+
this.progress.updateProcessTotal(processName, totalVariantEntries);
|
|
293
|
+
log.debug(`Updated progress total to: ${totalVariantEntries}`, this.config.context);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
log.debug(`Processing batch of ${variantEntries.length} variant entries`, this.config.context);
|
|
198
297
|
await this.handleConcurrency(contentType, variantEntries, entriesForVariant);
|
|
199
298
|
}
|
|
200
299
|
} catch (error) {
|
|
@@ -251,6 +350,13 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
251
350
|
`Created entry variant: '${variantUid}' of entry uid ${entryUid} locale '${locale}'`,
|
|
252
351
|
this.config.context,
|
|
253
352
|
);
|
|
353
|
+
const processName = this.parentProgressManager ? 'Variant Entries' : PROCESS_NAMES.VARIANT_ENTRIES;
|
|
354
|
+
this.updateProgress(
|
|
355
|
+
true,
|
|
356
|
+
`variant entry: '${variantUid}' of entry uid ${entryUid} locale '${locale}'`,
|
|
357
|
+
undefined,
|
|
358
|
+
processName,
|
|
359
|
+
);
|
|
254
360
|
};
|
|
255
361
|
|
|
256
362
|
const onReject = ({ error, apiData }: any) => {
|
|
@@ -261,6 +367,14 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
|
|
|
261
367
|
this.config.context,
|
|
262
368
|
`Failed to create entry variant: '${variantUid}' of entry uid ${entryUid} locale '${locale}'`,
|
|
263
369
|
);
|
|
370
|
+
const processName = this.parentProgressManager ? 'Variant Entries' : PROCESS_NAMES.VARIANT_ENTRIES;
|
|
371
|
+
this.updateProgress(
|
|
372
|
+
false,
|
|
373
|
+
`'${variantUid}' of entry uid ${entryUid} locale '${locale}'`,
|
|
374
|
+
(error as any)?.message ||
|
|
375
|
+
`Failed to create entry variant: '${variantUid}' of entry uid ${entryUid} locale '${locale}'`,
|
|
376
|
+
processName,
|
|
377
|
+
);
|
|
264
378
|
};
|
|
265
379
|
// NOTE Find new variant Id by old Id
|
|
266
380
|
const variantId = this.variantIdList[variantEntry._variant._uid] as string;
|
package/src/index.ts
CHANGED
|
@@ -33,7 +33,6 @@ export type masterLocale = {
|
|
|
33
33
|
|
|
34
34
|
export interface DefaultConfig {
|
|
35
35
|
context: Context;
|
|
36
|
-
contentVersion: number;
|
|
37
36
|
versioning: boolean;
|
|
38
37
|
host: string;
|
|
39
38
|
cdn?: string;
|
|
@@ -233,7 +232,6 @@ export interface DefaultConfig {
|
|
|
233
232
|
writeConcurrency: number;
|
|
234
233
|
developerHubBaseUrl: string;
|
|
235
234
|
marketplaceAppEncryptionKey: string;
|
|
236
|
-
onlyTSModules: string[];
|
|
237
235
|
}
|
|
238
236
|
|
|
239
237
|
export interface ExportConfig extends DefaultConfig {
|
package/src/types/utils.ts
CHANGED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export const PROCESS_NAMES = {
|
|
2
|
+
PROJECTS: 'Projects',
|
|
3
|
+
ATTRIBUTES: 'Attributes',
|
|
4
|
+
AUDIENCES: 'Audiences',
|
|
5
|
+
EVENTS: 'Events',
|
|
6
|
+
EXPERIENCES: 'Experiences',
|
|
7
|
+
VARIANT_ENTRIES: 'Variant Entries',
|
|
8
|
+
} as const;
|
|
9
|
+
|
|
10
|
+
export const MODULE_DISPLAY_MAPPER = {
|
|
11
|
+
events: PROCESS_NAMES.EVENTS,
|
|
12
|
+
attributes: PROCESS_NAMES.ATTRIBUTES,
|
|
13
|
+
audiences: PROCESS_NAMES.AUDIENCES,
|
|
14
|
+
experiences: PROCESS_NAMES.EXPERIENCES,
|
|
15
|
+
projects: PROCESS_NAMES.PROJECTS,
|
|
16
|
+
'variant-entries': PROCESS_NAMES.VARIANT_ENTRIES,
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export const MODULE_CONTEXTS = {
|
|
20
|
+
PROJECTS: 'projects',
|
|
21
|
+
ATTRIBUTES: 'attributes',
|
|
22
|
+
AUDIENCES: 'audiences',
|
|
23
|
+
EVENTS: 'events',
|
|
24
|
+
EXPERIENCES: 'experiences',
|
|
25
|
+
VARIANT_ENTRIES: 'variant-entries',
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
// Export process status messages
|
|
29
|
+
export const EXPORT_PROCESS_STATUS = {
|
|
30
|
+
[PROCESS_NAMES.PROJECTS]: {
|
|
31
|
+
FETCHING: 'Fetching projects...',
|
|
32
|
+
EXPORTING: 'Exporting projects...',
|
|
33
|
+
FAILED: 'Failed to export projects.',
|
|
34
|
+
},
|
|
35
|
+
[PROCESS_NAMES.ATTRIBUTES]: {
|
|
36
|
+
FETCHING: 'Fetching attributes...',
|
|
37
|
+
EXPORTING: 'Exporting attributes...',
|
|
38
|
+
FAILED: 'Failed to export attributes.',
|
|
39
|
+
},
|
|
40
|
+
[PROCESS_NAMES.AUDIENCES]: {
|
|
41
|
+
FETCHING: 'Fetching audiences...',
|
|
42
|
+
EXPORTING: 'Exporting audiences...',
|
|
43
|
+
FAILED: 'Failed to export audiences.',
|
|
44
|
+
},
|
|
45
|
+
[PROCESS_NAMES.EVENTS]: {
|
|
46
|
+
FETCHING: 'Fetching events...',
|
|
47
|
+
EXPORTING: 'Exporting events...',
|
|
48
|
+
FAILED: 'Failed to export events.',
|
|
49
|
+
},
|
|
50
|
+
[PROCESS_NAMES.EXPERIENCES]: {
|
|
51
|
+
FETCHING: 'Fetching experiences...',
|
|
52
|
+
EXPORTING: 'Exporting experiences...',
|
|
53
|
+
FAILED: 'Failed to export experiences.',
|
|
54
|
+
},
|
|
55
|
+
[PROCESS_NAMES.VARIANT_ENTRIES]: {
|
|
56
|
+
PROCESSING: 'Processing variant entries...',
|
|
57
|
+
EXPORTING: 'Exporting variant entries...',
|
|
58
|
+
FAILED: 'Failed to export variant entries.',
|
|
59
|
+
},
|
|
60
|
+
} as const;
|
|
61
|
+
|
|
62
|
+
// Import process status messages
|
|
63
|
+
export const IMPORT_PROCESS_STATUS = {
|
|
64
|
+
[PROCESS_NAMES.PROJECTS]: {
|
|
65
|
+
CREATING: 'Creating projects...',
|
|
66
|
+
IMPORTING: 'Importing projects...',
|
|
67
|
+
FAILED: 'Failed to import projects.',
|
|
68
|
+
},
|
|
69
|
+
[PROCESS_NAMES.ATTRIBUTES]: {
|
|
70
|
+
CREATING: 'Creating attributes...',
|
|
71
|
+
IMPORTING: 'Importing attributes...',
|
|
72
|
+
FAILED: 'Failed to import attributes.',
|
|
73
|
+
},
|
|
74
|
+
[PROCESS_NAMES.AUDIENCES]: {
|
|
75
|
+
CREATING: 'Creating audiences...',
|
|
76
|
+
IMPORTING: 'Importing audiences...',
|
|
77
|
+
FAILED: 'Failed to import audiences.',
|
|
78
|
+
},
|
|
79
|
+
[PROCESS_NAMES.EVENTS]: {
|
|
80
|
+
CREATING: 'Creating events...',
|
|
81
|
+
IMPORTING: 'Importing events...',
|
|
82
|
+
FAILED: 'Failed to import events.',
|
|
83
|
+
},
|
|
84
|
+
[PROCESS_NAMES.EXPERIENCES]: {
|
|
85
|
+
CREATING: 'Creating experiences...',
|
|
86
|
+
IMPORTING: 'Importing experiences...',
|
|
87
|
+
FAILED: 'Failed to import experiences.',
|
|
88
|
+
},
|
|
89
|
+
[PROCESS_NAMES.VARIANT_ENTRIES]: {
|
|
90
|
+
PROCESSING: 'Processing variant entries...',
|
|
91
|
+
IMPORTING: 'Importing variant entries...',
|
|
92
|
+
FAILED: 'Failed to import variant entries.',
|
|
93
|
+
},
|
|
94
|
+
} as const;
|
|
95
|
+
|
|
96
|
+
export type ProcessName = typeof PROCESS_NAMES[keyof typeof PROCESS_NAMES];
|
|
97
|
+
export type ModuleKey = keyof typeof MODULE_DISPLAY_MAPPER;
|
|
98
|
+
export type ModuleContext = typeof MODULE_CONTEXTS[keyof typeof MODULE_CONTEXTS];
|