@contentstack/cli-cm-import 1.28.0 → 2.0.0-beta

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.
Files changed (87) hide show
  1. package/README.md +5 -7
  2. package/lib/commands/cm/stacks/import.d.ts +2 -0
  3. package/lib/commands/cm/stacks/import.js +46 -11
  4. package/lib/config/index.js +0 -1
  5. package/lib/import/module-importer.d.ts +2 -2
  6. package/lib/import/module-importer.js +9 -25
  7. package/lib/import/modules/assets.d.ts +6 -0
  8. package/lib/import/modules/assets.js +102 -25
  9. package/lib/import/modules/base-class.d.ts +17 -0
  10. package/lib/import/modules/base-class.js +45 -0
  11. package/lib/import/modules/content-types.d.ts +7 -10
  12. package/lib/import/modules/content-types.js +132 -68
  13. package/lib/import/modules/custom-roles.d.ts +6 -2
  14. package/lib/import/modules/custom-roles.js +80 -69
  15. package/lib/import/modules/entries.d.ts +7 -0
  16. package/lib/import/modules/entries.js +278 -163
  17. package/lib/import/modules/environments.d.ts +3 -0
  18. package/lib/import/modules/environments.js +69 -38
  19. package/lib/import/modules/extensions.d.ts +3 -0
  20. package/lib/import/modules/extensions.js +99 -64
  21. package/lib/import/modules/global-fields.d.ts +8 -1
  22. package/lib/import/modules/global-fields.js +123 -63
  23. package/lib/import/modules/index.d.ts +1 -0
  24. package/lib/import/modules/index.js +1 -0
  25. package/lib/import/modules/labels.d.ts +3 -0
  26. package/lib/import/modules/labels.js +104 -54
  27. package/lib/import/modules/locales.d.ts +15 -4
  28. package/lib/import/modules/locales.js +194 -94
  29. package/lib/import/modules/marketplace-apps.d.ts +6 -3
  30. package/lib/import/modules/marketplace-apps.js +177 -102
  31. package/lib/import/modules/personalize.d.ts +11 -4
  32. package/lib/import/modules/personalize.js +138 -47
  33. package/lib/import/modules/stack.d.ts +6 -0
  34. package/lib/import/modules/stack.js +71 -27
  35. package/lib/import/modules/taxonomies.d.ts +4 -2
  36. package/lib/import/modules/taxonomies.js +60 -46
  37. package/lib/import/modules/variant-entries.d.ts +7 -4
  38. package/lib/import/modules/variant-entries.js +76 -35
  39. package/lib/import/modules/webhooks.d.ts +3 -0
  40. package/lib/import/modules/webhooks.js +71 -40
  41. package/lib/import/modules/workflows.d.ts +3 -0
  42. package/lib/import/modules/workflows.js +98 -48
  43. package/lib/types/default-config.d.ts +0 -1
  44. package/lib/types/import-config.d.ts +0 -1
  45. package/lib/types/index.d.ts +1 -12
  46. package/lib/utils/backup-handler.js +1 -2
  47. package/lib/utils/constants.d.ts +243 -0
  48. package/lib/utils/constants.js +264 -0
  49. package/lib/utils/import-config-handler.js +2 -7
  50. package/lib/utils/import-path-resolver.d.ts +1 -1
  51. package/lib/utils/import-path-resolver.js +5 -5
  52. package/lib/utils/index.d.ts +1 -1
  53. package/lib/utils/index.js +6 -2
  54. package/lib/utils/marketplace-app-helper.js +3 -8
  55. package/lib/utils/progress-strategy-registry.d.ts +7 -0
  56. package/lib/utils/progress-strategy-registry.js +72 -0
  57. package/lib/utils/setup-branch.js +1 -1
  58. package/oclif.manifest.json +2 -2
  59. package/package.json +2 -2
  60. package/lib/import/modules-js/assets.d.ts +0 -33
  61. package/lib/import/modules-js/assets.js +0 -428
  62. package/lib/import/modules-js/content-types.d.ts +0 -34
  63. package/lib/import/modules-js/content-types.js +0 -204
  64. package/lib/import/modules-js/custom-roles.d.ts +0 -15
  65. package/lib/import/modules-js/custom-roles.js +0 -143
  66. package/lib/import/modules-js/entries.d.ts +0 -54
  67. package/lib/import/modules-js/entries.js +0 -1280
  68. package/lib/import/modules-js/environments.d.ts +0 -13
  69. package/lib/import/modules-js/environments.js +0 -85
  70. package/lib/import/modules-js/extensions.d.ts +0 -18
  71. package/lib/import/modules-js/extensions.js +0 -86
  72. package/lib/import/modules-js/global-fields.d.ts +0 -13
  73. package/lib/import/modules-js/global-fields.js +0 -106
  74. package/lib/import/modules-js/index.d.ts +0 -1
  75. package/lib/import/modules-js/index.js +0 -33
  76. package/lib/import/modules-js/labels.d.ts +0 -20
  77. package/lib/import/modules-js/labels.js +0 -148
  78. package/lib/import/modules-js/locales.d.ts +0 -24
  79. package/lib/import/modules-js/locales.js +0 -196
  80. package/lib/import/modules-js/marketplace-apps.d.ts +0 -63
  81. package/lib/import/modules-js/marketplace-apps.js +0 -429
  82. package/lib/import/modules-js/webhooks.d.ts +0 -17
  83. package/lib/import/modules-js/webhooks.js +0 -85
  84. package/lib/import/modules-js/workflows.d.ts +0 -19
  85. package/lib/import/modules-js/workflows.js +0 -170
  86. package/lib/utils/log.d.ts +0 -12
  87. package/lib/utils/log.js +0 -31
@@ -41,11 +41,10 @@ async function backupHandler(importConfig) {
41
41
  }
42
42
  if (backupDirPath) {
43
43
  cli_utilities_1.log.debug(`Starting content copy to backup directory: ${backupDirPath}`);
44
- cli_utilities_1.cliux.print('Copying content to the backup directory...');
44
+ cli_utilities_1.log.info('Copying content to the backup directory...', importConfig.context);
45
45
  return new Promise((resolve, reject) => {
46
46
  return (0, fs_extra_1.copy)(sourceDir, backupDirPath, (error) => {
47
47
  if (error) {
48
- (0, index_1.trace)(error, 'error', true);
49
48
  return reject(error);
50
49
  }
51
50
  cli_utilities_1.log.debug(`Successfully created backup at: ${backupDirPath}`);
@@ -0,0 +1,243 @@
1
+ export declare const PROCESS_NAMES: {
2
+ readonly ASSET_FOLDERS: "Folders";
3
+ readonly ASSET_VERSIONS: "Versions";
4
+ readonly ASSET_UPLOAD: "Upload";
5
+ readonly ASSET_PUBLISH: "Publish";
6
+ readonly CONTENT_TYPES_CREATE: "Content Types Create";
7
+ readonly CONTENT_TYPES_UPDATE: "Content Types Update";
8
+ readonly CONTENT_TYPES_REPLACE_EXISTING: "Content Types Replace Existing";
9
+ readonly CT_PREPARATION: "CT Preparation";
10
+ readonly ENTRIES_CREATE: "Entries Create";
11
+ readonly ENTRIES_REPLACE_EXISTING: "Entries Replace Existing";
12
+ readonly REFERENCE_UPDATES: "Reference Updates";
13
+ readonly CT_RESTORATION: "CT Restoration";
14
+ readonly FIELD_RULES_UPDATE: "Field Rules Update";
15
+ readonly ENTRIES_PUBLISH: "Entries Publish";
16
+ readonly CLEANUP: "Cleanup";
17
+ readonly EXTENSIONS_CREATE: "Extensions Create";
18
+ readonly EXTENSIONS_REPLACE_EXISTING: "Extensions Replace Existing";
19
+ readonly GLOBAL_FIELDS_CREATE: "Global Fields Create";
20
+ readonly GLOBAL_FIELDS_UPDATE: "Global Fields Update";
21
+ readonly GLOBAL_FIELDS_REPLACE_EXISTING: "Global Fields Replace Existing";
22
+ readonly LABELS_CREATE: "Labels Create";
23
+ readonly LABELS_UPDATE: "Labels Update";
24
+ readonly MASTER_LOCALE: "Master Locale";
25
+ readonly LOCALES_CREATE: "Locales Create";
26
+ readonly LOCALES_UPDATE: "Locales Update";
27
+ readonly SETUP_ENVIRONMENT: "Setup Environment";
28
+ readonly CREATE_APPS: "Create Apps";
29
+ readonly INSTALL_APPS: "Install Apps";
30
+ readonly GET_ROLES: "Get Roles";
31
+ readonly WORKFLOWS_CREATE: "Workflows Create";
32
+ readonly VARIANT_ENTRIES_IMPORT: "Variant Entries";
33
+ readonly ENVIRONMENTS_IMPORT: "Environments Import";
34
+ readonly CUSTOM_ROLES_BUILD_MAPPINGS: "Custom Roles Build Mappings";
35
+ readonly CUSTOM_ROLES_IMPORT: "Custom Roles Import";
36
+ readonly STACK_IMPORT: "Stack Import";
37
+ readonly CONTENT_TYPES_GF_UPDATE: "Content Types GF Update";
38
+ readonly CONTENT_TYPES_EXT_UPDATE: "Content Types Ext Update";
39
+ readonly WEBHOOKS_IMPORT: "Webhooks Import";
40
+ readonly TAXONOMIES_IMPORT: "Taxonomies Import";
41
+ readonly PERSONALIZE_PROJECTS: "Projects";
42
+ };
43
+ export declare const MODULE_CONTEXTS: {
44
+ readonly ASSETS: "assets";
45
+ readonly CONTENT_TYPES: "content-types";
46
+ readonly CUSTOM_ROLES: "custom-roles";
47
+ readonly ENTRIES: "entries";
48
+ readonly ENVIRONMENTS: "environments";
49
+ readonly EXTENSIONS: "extensions";
50
+ readonly GLOBAL_FIELDS: "global-fields";
51
+ readonly LABELS: "labels";
52
+ readonly LOCALES: "locales";
53
+ readonly MARKETPLACE_APPS: "marketplace-apps";
54
+ readonly PERSONALIZE: "personalize";
55
+ readonly STACK: "stack";
56
+ readonly TAXONOMIES: "taxonomies";
57
+ readonly VARIANT_ENTRIES: "variant-entries";
58
+ readonly WEBHOOKS: "webhooks";
59
+ readonly WORKFLOWS: "workflows";
60
+ };
61
+ export declare const MODULE_NAMES: {
62
+ readonly assets: "Assets";
63
+ readonly "content-types": "Content Types";
64
+ readonly "custom-roles": "Custom Roles";
65
+ readonly entries: "Entries";
66
+ readonly environments: "Environments";
67
+ readonly extensions: "Extensions";
68
+ readonly "global-fields": "Global Fields";
69
+ readonly labels: "Labels";
70
+ readonly locales: "Locales";
71
+ readonly "marketplace-apps": "Marketplace Apps";
72
+ readonly personalize: "Personalize";
73
+ readonly stack: "Stack";
74
+ readonly taxonomies: "Taxonomies";
75
+ readonly "variant-entries": "Variant Entries";
76
+ readonly webhooks: "Webhooks";
77
+ readonly workflows: "Workflows";
78
+ };
79
+ export declare const PROCESS_STATUS: {
80
+ Folders: {
81
+ CREATING: string;
82
+ FAILED: string;
83
+ };
84
+ Versions: {
85
+ IMPORTING: string;
86
+ FAILED: string;
87
+ };
88
+ Upload: {
89
+ UPLOADING: string;
90
+ FAILED: string;
91
+ };
92
+ Publish: {
93
+ PUBLISHING: string;
94
+ FAILED: string;
95
+ };
96
+ "Content Types Create": {
97
+ CREATING: string;
98
+ FAILED: string;
99
+ };
100
+ "Content Types Update": {
101
+ UPDATING: string;
102
+ FAILED: string;
103
+ };
104
+ "Content Types Replace Existing": {
105
+ REPLACING: string;
106
+ FAILED: string;
107
+ };
108
+ "CT Preparation": {
109
+ PREPARING: string;
110
+ FAILED: string;
111
+ };
112
+ "Entries Create": {
113
+ CREATING: string;
114
+ FAILED: string;
115
+ };
116
+ "Entries Replace Existing": {
117
+ REPLACING: string;
118
+ FAILED: string;
119
+ };
120
+ "Reference Updates": {
121
+ UPDATING: string;
122
+ FAILED: string;
123
+ };
124
+ "CT Restoration": {
125
+ RESTORING: string;
126
+ FAILED: string;
127
+ };
128
+ "Field Rules Update": {
129
+ UPDATING: string;
130
+ FAILED: string;
131
+ };
132
+ "Entries Publish": {
133
+ PUBLISHING: string;
134
+ FAILED: string;
135
+ };
136
+ Cleanup: {
137
+ CLEANING: string;
138
+ FAILED: string;
139
+ };
140
+ "Extensions Create": {
141
+ CREATING: string;
142
+ FAILED: string;
143
+ };
144
+ "Extensions Replace Existing": {
145
+ REPLACING: string;
146
+ FAILED: string;
147
+ };
148
+ "Global Fields Create": {
149
+ CREATING: string;
150
+ FAILED: string;
151
+ };
152
+ "Global Fields Update": {
153
+ UPDATING: string;
154
+ FAILED: string;
155
+ };
156
+ "Global Fields Replace Existing": {
157
+ REPLACING: string;
158
+ FAILED: string;
159
+ };
160
+ "Labels Create": {
161
+ CREATING: string;
162
+ FAILED: string;
163
+ };
164
+ "Labels Update": {
165
+ UPDATING: string;
166
+ FAILED: string;
167
+ };
168
+ "Master Locale": {
169
+ PROCESSING: string;
170
+ FAILED: string;
171
+ };
172
+ "Locales Create": {
173
+ CREATING: string;
174
+ FAILED: string;
175
+ };
176
+ "Locales Update": {
177
+ UPDATING: string;
178
+ FAILED: string;
179
+ };
180
+ "Setup Environment": {
181
+ SETTING_UP: string;
182
+ FAILED: string;
183
+ };
184
+ "Create Apps": {
185
+ CREATING: string;
186
+ FAILED: string;
187
+ };
188
+ "Install Apps": {
189
+ INSTALLING: string;
190
+ FAILED: string;
191
+ };
192
+ "Get Roles": {
193
+ FETCHING: string;
194
+ FAILED: string;
195
+ };
196
+ "Workflows Create": {
197
+ IMPORTING: string;
198
+ FAILED: string;
199
+ };
200
+ "Variant Entries": {
201
+ IMPORTING: string;
202
+ FAILED: string;
203
+ };
204
+ "Environments Import": {
205
+ IMPORTING: string;
206
+ FAILED: string;
207
+ };
208
+ "Custom Roles Build Mappings": {
209
+ BUILDING: string;
210
+ FAILED: string;
211
+ };
212
+ "Custom Roles Import": {
213
+ IMPORTING: string;
214
+ FAILED: string;
215
+ };
216
+ "Stack Import": {
217
+ IMPORTING: string;
218
+ FAILED: string;
219
+ };
220
+ "Content Types GF Update": {
221
+ UPDATING: string;
222
+ FAILED: string;
223
+ };
224
+ "Content Types Ext Update": {
225
+ UPDATING: string;
226
+ FAILED: string;
227
+ };
228
+ "Webhooks Import": {
229
+ IMPORTING: string;
230
+ FAILED: string;
231
+ };
232
+ "Taxonomies Import": {
233
+ IMPORTING: string;
234
+ FAILED: string;
235
+ };
236
+ Projects: {
237
+ IMPORTING: string;
238
+ FAILED: string;
239
+ };
240
+ };
241
+ export type ImportProcessName = (typeof PROCESS_NAMES)[keyof typeof PROCESS_NAMES];
242
+ export type ImportModuleContext = (typeof MODULE_CONTEXTS)[keyof typeof MODULE_CONTEXTS];
243
+ export type ImportProcessStatus = (typeof PROCESS_STATUS)[keyof typeof PROCESS_STATUS];
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROCESS_STATUS = exports.MODULE_NAMES = exports.MODULE_CONTEXTS = exports.PROCESS_NAMES = void 0;
4
+ exports.PROCESS_NAMES = {
5
+ // Assets module
6
+ ASSET_FOLDERS: 'Folders',
7
+ ASSET_VERSIONS: 'Versions',
8
+ ASSET_UPLOAD: 'Upload',
9
+ ASSET_PUBLISH: 'Publish',
10
+ // Content Types module
11
+ CONTENT_TYPES_CREATE: 'Content Types Create',
12
+ CONTENT_TYPES_UPDATE: 'Content Types Update',
13
+ CONTENT_TYPES_REPLACE_EXISTING: 'Content Types Replace Existing',
14
+ // Entries module
15
+ CT_PREPARATION: 'CT Preparation',
16
+ ENTRIES_CREATE: 'Entries Create',
17
+ ENTRIES_REPLACE_EXISTING: 'Entries Replace Existing',
18
+ REFERENCE_UPDATES: 'Reference Updates',
19
+ CT_RESTORATION: 'CT Restoration',
20
+ FIELD_RULES_UPDATE: 'Field Rules Update',
21
+ ENTRIES_PUBLISH: 'Entries Publish',
22
+ CLEANUP: 'Cleanup',
23
+ // Extensions module
24
+ EXTENSIONS_CREATE: 'Extensions Create',
25
+ EXTENSIONS_REPLACE_EXISTING: 'Extensions Replace Existing',
26
+ // Global Fields module
27
+ GLOBAL_FIELDS_CREATE: 'Global Fields Create',
28
+ GLOBAL_FIELDS_UPDATE: 'Global Fields Update',
29
+ GLOBAL_FIELDS_REPLACE_EXISTING: 'Global Fields Replace Existing',
30
+ // Labels module
31
+ LABELS_CREATE: 'Labels Create',
32
+ LABELS_UPDATE: 'Labels Update',
33
+ // Locales module
34
+ MASTER_LOCALE: 'Master Locale',
35
+ LOCALES_CREATE: 'Locales Create',
36
+ LOCALES_UPDATE: 'Locales Update',
37
+ // Marketplace Apps module
38
+ SETUP_ENVIRONMENT: 'Setup Environment',
39
+ CREATE_APPS: 'Create Apps',
40
+ INSTALL_APPS: 'Install Apps',
41
+ // Workflows module
42
+ GET_ROLES: 'Get Roles',
43
+ WORKFLOWS_CREATE: 'Workflows Create',
44
+ // Additional processes for import modules
45
+ VARIANT_ENTRIES_IMPORT: 'Variant Entries',
46
+ ENVIRONMENTS_IMPORT: 'Environments Import',
47
+ CUSTOM_ROLES_BUILD_MAPPINGS: 'Custom Roles Build Mappings',
48
+ CUSTOM_ROLES_IMPORT: 'Custom Roles Import',
49
+ STACK_IMPORT: 'Stack Import',
50
+ CONTENT_TYPES_GF_UPDATE: 'Content Types GF Update',
51
+ CONTENT_TYPES_EXT_UPDATE: 'Content Types Ext Update',
52
+ WEBHOOKS_IMPORT: 'Webhooks Import',
53
+ TAXONOMIES_IMPORT: 'Taxonomies Import',
54
+ PERSONALIZE_PROJECTS: 'Projects',
55
+ };
56
+ exports.MODULE_CONTEXTS = {
57
+ ASSETS: 'assets',
58
+ CONTENT_TYPES: 'content-types',
59
+ CUSTOM_ROLES: 'custom-roles',
60
+ ENTRIES: 'entries',
61
+ ENVIRONMENTS: 'environments',
62
+ EXTENSIONS: 'extensions',
63
+ GLOBAL_FIELDS: 'global-fields',
64
+ LABELS: 'labels',
65
+ LOCALES: 'locales',
66
+ MARKETPLACE_APPS: 'marketplace-apps',
67
+ PERSONALIZE: 'personalize',
68
+ STACK: 'stack',
69
+ TAXONOMIES: 'taxonomies',
70
+ VARIANT_ENTRIES: 'variant-entries',
71
+ WEBHOOKS: 'webhooks',
72
+ WORKFLOWS: 'workflows',
73
+ };
74
+ // Display names for modules to avoid scattering user-facing strings
75
+ exports.MODULE_NAMES = {
76
+ [exports.MODULE_CONTEXTS.ASSETS]: 'Assets',
77
+ [exports.MODULE_CONTEXTS.CONTENT_TYPES]: 'Content Types',
78
+ [exports.MODULE_CONTEXTS.CUSTOM_ROLES]: 'Custom Roles',
79
+ [exports.MODULE_CONTEXTS.ENTRIES]: 'Entries',
80
+ [exports.MODULE_CONTEXTS.ENVIRONMENTS]: 'Environments',
81
+ [exports.MODULE_CONTEXTS.EXTENSIONS]: 'Extensions',
82
+ [exports.MODULE_CONTEXTS.GLOBAL_FIELDS]: 'Global Fields',
83
+ [exports.MODULE_CONTEXTS.LABELS]: 'Labels',
84
+ [exports.MODULE_CONTEXTS.LOCALES]: 'Locales',
85
+ [exports.MODULE_CONTEXTS.MARKETPLACE_APPS]: 'Marketplace Apps',
86
+ [exports.MODULE_CONTEXTS.PERSONALIZE]: 'Personalize',
87
+ [exports.MODULE_CONTEXTS.STACK]: 'Stack',
88
+ [exports.MODULE_CONTEXTS.TAXONOMIES]: 'Taxonomies',
89
+ [exports.MODULE_CONTEXTS.VARIANT_ENTRIES]: 'Variant Entries',
90
+ [exports.MODULE_CONTEXTS.WEBHOOKS]: 'Webhooks',
91
+ [exports.MODULE_CONTEXTS.WORKFLOWS]: 'Workflows',
92
+ };
93
+ exports.PROCESS_STATUS = {
94
+ // Assets
95
+ [exports.PROCESS_NAMES.ASSET_FOLDERS]: {
96
+ CREATING: 'Creating asset folders...',
97
+ FAILED: 'Failed to create asset folders.',
98
+ },
99
+ [exports.PROCESS_NAMES.ASSET_VERSIONS]: {
100
+ IMPORTING: 'Importing asset versions...',
101
+ FAILED: 'Failed to process asset versions.',
102
+ },
103
+ [exports.PROCESS_NAMES.ASSET_UPLOAD]: {
104
+ UPLOADING: 'Uploading asset files...',
105
+ FAILED: 'Failed to upload assets.',
106
+ },
107
+ [exports.PROCESS_NAMES.ASSET_PUBLISH]: {
108
+ PUBLISHING: 'Publishing assets...',
109
+ FAILED: 'Failed to publish assets.',
110
+ },
111
+ // Content Types
112
+ [exports.PROCESS_NAMES.CONTENT_TYPES_CREATE]: {
113
+ CREATING: 'Creating content types...',
114
+ FAILED: 'Failed to create content types.',
115
+ },
116
+ [exports.PROCESS_NAMES.CONTENT_TYPES_UPDATE]: {
117
+ UPDATING: 'Updating content types with references...',
118
+ FAILED: 'Failed to update content types.',
119
+ },
120
+ [exports.PROCESS_NAMES.CONTENT_TYPES_REPLACE_EXISTING]: {
121
+ REPLACING: 'Replacing existing content types...',
122
+ FAILED: 'Failed to replace existing content types.',
123
+ },
124
+ // Entries
125
+ [exports.PROCESS_NAMES.CT_PREPARATION]: {
126
+ PREPARING: 'Preparing content types for entry import...',
127
+ FAILED: 'Failed to prepare content types.',
128
+ },
129
+ [exports.PROCESS_NAMES.ENTRIES_CREATE]: {
130
+ CREATING: 'Creating entries...',
131
+ FAILED: 'Failed to create entries.',
132
+ },
133
+ [exports.PROCESS_NAMES.ENTRIES_REPLACE_EXISTING]: {
134
+ REPLACING: 'Replacing existing entries...',
135
+ FAILED: 'Failed to replace existing entries.',
136
+ },
137
+ [exports.PROCESS_NAMES.REFERENCE_UPDATES]: {
138
+ UPDATING: 'Updating entry references...',
139
+ FAILED: 'Failed to update entry references.',
140
+ },
141
+ [exports.PROCESS_NAMES.CT_RESTORATION]: {
142
+ RESTORING: 'Restoring content type references...',
143
+ FAILED: 'Failed to restore content types.',
144
+ },
145
+ [exports.PROCESS_NAMES.FIELD_RULES_UPDATE]: {
146
+ UPDATING: 'Updating field rules...',
147
+ FAILED: 'Failed to update field rules.',
148
+ },
149
+ [exports.PROCESS_NAMES.ENTRIES_PUBLISH]: {
150
+ PUBLISHING: 'Publishing entries...',
151
+ FAILED: 'Failed to publish entries.',
152
+ },
153
+ [exports.PROCESS_NAMES.CLEANUP]: {
154
+ CLEANING: 'Cleaning up auto-created entries...',
155
+ FAILED: 'Failed to clean up temporary data.',
156
+ },
157
+ // Extensions
158
+ [exports.PROCESS_NAMES.EXTENSIONS_CREATE]: {
159
+ CREATING: 'Creating extensions...',
160
+ FAILED: 'Failed to create extensions.',
161
+ },
162
+ [exports.PROCESS_NAMES.EXTENSIONS_REPLACE_EXISTING]: {
163
+ REPLACING: 'Replacing existing extensions...',
164
+ FAILED: 'Failed to replace existing extensions.',
165
+ },
166
+ // Global Fields
167
+ [exports.PROCESS_NAMES.GLOBAL_FIELDS_CREATE]: {
168
+ CREATING: 'Creating global fields...',
169
+ FAILED: 'Failed to create global fields.',
170
+ },
171
+ [exports.PROCESS_NAMES.GLOBAL_FIELDS_UPDATE]: {
172
+ UPDATING: 'Updating global fields...',
173
+ FAILED: 'Failed to update global fields.',
174
+ },
175
+ [exports.PROCESS_NAMES.GLOBAL_FIELDS_REPLACE_EXISTING]: {
176
+ REPLACING: 'Replacing existing global fields...',
177
+ FAILED: 'Failed to replace existing global fields.',
178
+ },
179
+ // Labels
180
+ [exports.PROCESS_NAMES.LABELS_CREATE]: {
181
+ CREATING: 'Creating labels...',
182
+ FAILED: 'Failed to create labels.',
183
+ },
184
+ [exports.PROCESS_NAMES.LABELS_UPDATE]: {
185
+ UPDATING: 'Updating labels...',
186
+ FAILED: 'Failed to update labels.',
187
+ },
188
+ // Locales
189
+ [exports.PROCESS_NAMES.MASTER_LOCALE]: {
190
+ PROCESSING: 'Processing master locale...',
191
+ FAILED: 'Failed to process master locale.',
192
+ },
193
+ [exports.PROCESS_NAMES.LOCALES_CREATE]: {
194
+ CREATING: 'Creating locales...',
195
+ FAILED: 'Failed to create locales.',
196
+ },
197
+ [exports.PROCESS_NAMES.LOCALES_UPDATE]: {
198
+ UPDATING: 'Updating locales...',
199
+ FAILED: 'Failed to update locales.',
200
+ },
201
+ // Marketplace Apps
202
+ [exports.PROCESS_NAMES.SETUP_ENVIRONMENT]: {
203
+ SETTING_UP: 'Setting up marketplace SDK and authentication...',
204
+ FAILED: 'Failed to setup environment.',
205
+ },
206
+ [exports.PROCESS_NAMES.CREATE_APPS]: {
207
+ CREATING: 'Creating private apps...',
208
+ FAILED: 'Failed to create marketplace apps.',
209
+ },
210
+ [exports.PROCESS_NAMES.INSTALL_APPS]: {
211
+ INSTALLING: 'Installing marketplace apps...',
212
+ FAILED: 'Failed to install marketplace apps.',
213
+ },
214
+ // Workflows
215
+ [exports.PROCESS_NAMES.GET_ROLES]: {
216
+ FETCHING: 'Fetching roles for workflow processing...',
217
+ FAILED: 'Failed to fetch workflow roles.',
218
+ },
219
+ [exports.PROCESS_NAMES.WORKFLOWS_CREATE]: {
220
+ IMPORTING: 'Importing workflows...',
221
+ FAILED: 'Failed to create workflows.',
222
+ },
223
+ // Additional import processes
224
+ [exports.PROCESS_NAMES.VARIANT_ENTRIES_IMPORT]: {
225
+ IMPORTING: 'Importing variant entries...',
226
+ FAILED: 'Failed to import variant entries.',
227
+ },
228
+ [exports.PROCESS_NAMES.ENVIRONMENTS_IMPORT]: {
229
+ IMPORTING: 'Importing environments...',
230
+ FAILED: 'Failed to import environments.',
231
+ },
232
+ [exports.PROCESS_NAMES.CUSTOM_ROLES_BUILD_MAPPINGS]: {
233
+ BUILDING: 'Building locale mappings...',
234
+ FAILED: 'Failed to build locale mappings.',
235
+ },
236
+ [exports.PROCESS_NAMES.CUSTOM_ROLES_IMPORT]: {
237
+ IMPORTING: 'Importing custom roles...',
238
+ FAILED: 'Failed to import custom roles.',
239
+ },
240
+ [exports.PROCESS_NAMES.STACK_IMPORT]: {
241
+ IMPORTING: 'Importing stack settings...',
242
+ FAILED: 'Failed to import stack settings.',
243
+ },
244
+ [exports.PROCESS_NAMES.CONTENT_TYPES_GF_UPDATE]: {
245
+ UPDATING: 'Updating global fields with content type references...',
246
+ FAILED: 'Failed to update global fields.',
247
+ },
248
+ [exports.PROCESS_NAMES.CONTENT_TYPES_EXT_UPDATE]: {
249
+ UPDATING: 'Updating extensions...',
250
+ FAILED: 'Failed to update extensions.',
251
+ },
252
+ [exports.PROCESS_NAMES.WEBHOOKS_IMPORT]: {
253
+ IMPORTING: 'Importing webhooks...',
254
+ FAILED: 'Failed to import webhooks.',
255
+ },
256
+ [exports.PROCESS_NAMES.TAXONOMIES_IMPORT]: {
257
+ IMPORTING: 'Importing taxonomies...',
258
+ FAILED: 'Failed to import taxonomies.',
259
+ },
260
+ [exports.PROCESS_NAMES.PERSONALIZE_PROJECTS]: {
261
+ IMPORTING: 'Importing personalization projects...',
262
+ FAILED: 'Failed to import personalization projects.',
263
+ },
264
+ };
@@ -35,13 +35,6 @@ const setupConfig = async (importCmdFlags) => {
35
35
  config.contentDir = path.resolve(config.contentDir);
36
36
  //Note to support the old key
37
37
  config.data = config.contentDir;
38
- if ((0, file_helper_1.fileExistsSync)(path.join(config.contentDir, 'export-info.json'))) {
39
- config.contentVersion =
40
- ((await (0, file_helper_1.readFile)(path.join(config.contentDir, 'export-info.json'))) || {}).contentVersion || 2;
41
- }
42
- else {
43
- config.contentVersion = 1;
44
- }
45
38
  const managementTokenAlias = importCmdFlags['management-token-alias'] || importCmdFlags['alias'];
46
39
  if (managementTokenAlias) {
47
40
  const { token, apiKey } = (_a = cli_utilities_1.configHandler.get(`tokens.${managementTokenAlias}`)) !== null && _a !== void 0 ? _a : {};
@@ -120,6 +113,8 @@ const setupConfig = async (importCmdFlags) => {
120
113
  if (importCmdFlags['exclude-global-modules']) {
121
114
  config['exclude-global-modules'] = importCmdFlags['exclude-global-modules'];
122
115
  }
116
+ // Set progress supported module to check and display console logs
117
+ cli_utilities_1.configHandler.set('log.progressSupportedModule', 'import');
123
118
  // Add authentication details to config for context tracking
124
119
  config.authenticationMethod = authenticationMethod;
125
120
  cli_utilities_1.log.debug('Import configuration setup completed', Object.assign({}, config));
@@ -19,7 +19,7 @@ export declare const resolveImportPath: (importConfig: ImportConfig, stackAPICli
19
19
  * @param importConfig - The import configuration object
20
20
  * @param resolvedPath - The resolved path
21
21
  */
22
- export declare const updateImportConfigWithResolvedPath: (importConfig: ImportConfig, resolvedPath: string) => void;
22
+ export declare const updateImportConfigWithResolvedPath: (importConfig: ImportConfig, resolvedPath: string) => Promise<void>;
23
23
  /**
24
24
  * Executes the complete import path resolution logic
25
25
  * @param importConfig - The import configuration object
@@ -4,9 +4,9 @@ exports.executeImportPathLogic = exports.updateImportConfigWithResolvedPath = ex
4
4
  const tslib_1 = require("tslib");
5
5
  const path = tslib_1.__importStar(require("path"));
6
6
  const cli_utilities_1 = require("@contentstack/cli-utilities");
7
- const file_helper_1 = require("./file-helper");
8
- const interactive_1 = require("./interactive");
9
7
  const config_1 = tslib_1.__importDefault(require("../config"));
8
+ const interactive_1 = require("./interactive");
9
+ const file_helper_1 = require("./file-helper");
10
10
  /**
11
11
  * Selects a branch from directory structure when multiple branches are found
12
12
  * @param contentDir - The content directory path
@@ -107,7 +107,7 @@ exports.resolveImportPath = resolveImportPath;
107
107
  * @param importConfig - The import configuration object
108
108
  * @param resolvedPath - The resolved path
109
109
  */
110
- const updateImportConfigWithResolvedPath = (importConfig, resolvedPath) => {
110
+ const updateImportConfigWithResolvedPath = async (importConfig, resolvedPath) => {
111
111
  cli_utilities_1.log.debug(`Updating import config with resolved path: ${resolvedPath}`);
112
112
  if (!(0, file_helper_1.fileExistsSync)(resolvedPath)) {
113
113
  cli_utilities_1.log.warn(`Resolved path does not exist: ${resolvedPath}, skipping config update`);
@@ -116,7 +116,7 @@ const updateImportConfigWithResolvedPath = (importConfig, resolvedPath) => {
116
116
  importConfig.branchDir = resolvedPath;
117
117
  importConfig.contentDir = resolvedPath;
118
118
  importConfig.data = resolvedPath;
119
- cli_utilities_1.log.debug(`Import config updated - contentDir: ${importConfig.contentDir}, branchDir: ${importConfig.branchDir}, data: ${importConfig.data}`);
119
+ cli_utilities_1.log.debug(`Import config updated - contentDir: ${importConfig.contentDir}, branchDir: ${importConfig.branchDir}, data: ${importConfig.data},`);
120
120
  };
121
121
  exports.updateImportConfigWithResolvedPath = updateImportConfigWithResolvedPath;
122
122
  /**
@@ -128,7 +128,7 @@ exports.updateImportConfigWithResolvedPath = updateImportConfigWithResolvedPath;
128
128
  const executeImportPathLogic = async (importConfig, stackAPIClient) => {
129
129
  cli_utilities_1.log.debug('Executing import path resolution logic');
130
130
  const resolvedPath = await (0, exports.resolveImportPath)(importConfig, stackAPIClient);
131
- (0, exports.updateImportConfigWithResolvedPath)(importConfig, resolvedPath);
131
+ await (0, exports.updateImportConfigWithResolvedPath)(importConfig, resolvedPath);
132
132
  return resolvedPath;
133
133
  };
134
134
  exports.executeImportPathLogic = executeImportPathLogic;
@@ -12,5 +12,5 @@ export { schemaTemplate, suppressSchemaReference, removeReferenceFields } from '
12
12
  export { lookupExtension } from './extension-helper';
13
13
  export { lookupEntries, removeUidsFromJsonRteFields, removeEntryRefsFromJSONRTE, restoreJsonRteEntryRefs, } from './entries-helper';
14
14
  export * from './common-helper';
15
- export * from './log';
16
15
  export { lookUpTaxonomy, lookUpTerms } from './taxonomies-helper';
16
+ export { MODULE_CONTEXTS, MODULE_NAMES, PROCESS_NAMES, PROCESS_STATUS } from './constants';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lookUpTerms = exports.lookUpTaxonomy = exports.restoreJsonRteEntryRefs = exports.removeEntryRefsFromJSONRTE = exports.removeUidsFromJsonRteFields = exports.lookupEntries = exports.lookupExtension = exports.removeReferenceFields = exports.suppressSchemaReference = exports.schemaTemplate = exports.ifAppAlreadyExist = exports.getAllStackSpecificApps = exports.confirmToCloseProcess = exports.makeRedirectUrlCall = exports.handleNameConflict = exports.getConfirmationToCreateApps = exports.getOrgUid = exports.getDeveloperHubUrl = exports.lookupAssets = exports.uploadAssetHelper = exports.unlinkFileLogger = exports.log = exports.backupHandler = exports.fsUtil = exports.fileHelper = exports.setupImportConfig = exports.interactive = exports.executeImportPathLogic = exports.updateImportConfigWithResolvedPath = exports.resolveImportPath = exports.selectBranchFromDirectory = exports.setupBranchConfig = void 0;
3
+ exports.PROCESS_STATUS = exports.PROCESS_NAMES = exports.MODULE_NAMES = exports.MODULE_CONTEXTS = exports.lookUpTerms = exports.lookUpTaxonomy = exports.restoreJsonRteEntryRefs = exports.removeEntryRefsFromJSONRTE = exports.removeUidsFromJsonRteFields = exports.lookupEntries = exports.lookupExtension = exports.removeReferenceFields = exports.suppressSchemaReference = exports.schemaTemplate = exports.ifAppAlreadyExist = exports.getAllStackSpecificApps = exports.confirmToCloseProcess = exports.makeRedirectUrlCall = exports.handleNameConflict = exports.getConfirmationToCreateApps = exports.getOrgUid = exports.getDeveloperHubUrl = exports.lookupAssets = exports.uploadAssetHelper = exports.unlinkFileLogger = exports.log = exports.backupHandler = exports.fsUtil = exports.fileHelper = exports.setupImportConfig = exports.interactive = exports.executeImportPathLogic = exports.updateImportConfigWithResolvedPath = exports.resolveImportPath = exports.selectBranchFromDirectory = exports.setupBranchConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  var setup_branch_1 = require("./setup-branch");
6
6
  Object.defineProperty(exports, "setupBranchConfig", { enumerable: true, get: function () { return setup_branch_1.setupBranchConfig; } });
@@ -44,7 +44,11 @@ Object.defineProperty(exports, "removeUidsFromJsonRteFields", { enumerable: true
44
44
  Object.defineProperty(exports, "removeEntryRefsFromJSONRTE", { enumerable: true, get: function () { return entries_helper_1.removeEntryRefsFromJSONRTE; } });
45
45
  Object.defineProperty(exports, "restoreJsonRteEntryRefs", { enumerable: true, get: function () { return entries_helper_1.restoreJsonRteEntryRefs; } });
46
46
  tslib_1.__exportStar(require("./common-helper"), exports);
47
- tslib_1.__exportStar(require("./log"), exports);
48
47
  var taxonomies_helper_1 = require("./taxonomies-helper");
49
48
  Object.defineProperty(exports, "lookUpTaxonomy", { enumerable: true, get: function () { return taxonomies_helper_1.lookUpTaxonomy; } });
50
49
  Object.defineProperty(exports, "lookUpTerms", { enumerable: true, get: function () { return taxonomies_helper_1.lookUpTerms; } });
50
+ var constants_1 = require("./constants");
51
+ Object.defineProperty(exports, "MODULE_CONTEXTS", { enumerable: true, get: function () { return constants_1.MODULE_CONTEXTS; } });
52
+ Object.defineProperty(exports, "MODULE_NAMES", { enumerable: true, get: function () { return constants_1.MODULE_NAMES; } });
53
+ Object.defineProperty(exports, "PROCESS_NAMES", { enumerable: true, get: function () { return constants_1.PROCESS_NAMES; } });
54
+ Object.defineProperty(exports, "PROCESS_STATUS", { enumerable: true, get: function () { return constants_1.PROCESS_STATUS; } });