@contentstack/cli-cm-import 1.28.1 → 2.0.1-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 (85) 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.js +6 -20
  6. package/lib/import/modules/assets.d.ts +6 -0
  7. package/lib/import/modules/assets.js +102 -25
  8. package/lib/import/modules/base-class.d.ts +17 -0
  9. package/lib/import/modules/base-class.js +45 -0
  10. package/lib/import/modules/content-types.d.ts +7 -10
  11. package/lib/import/modules/content-types.js +132 -68
  12. package/lib/import/modules/custom-roles.d.ts +6 -2
  13. package/lib/import/modules/custom-roles.js +80 -69
  14. package/lib/import/modules/entries.d.ts +7 -0
  15. package/lib/import/modules/entries.js +278 -163
  16. package/lib/import/modules/environments.d.ts +3 -0
  17. package/lib/import/modules/environments.js +69 -38
  18. package/lib/import/modules/extensions.d.ts +3 -0
  19. package/lib/import/modules/extensions.js +99 -64
  20. package/lib/import/modules/global-fields.d.ts +8 -1
  21. package/lib/import/modules/global-fields.js +123 -63
  22. package/lib/import/modules/index.d.ts +1 -0
  23. package/lib/import/modules/index.js +1 -0
  24. package/lib/import/modules/labels.d.ts +3 -0
  25. package/lib/import/modules/labels.js +104 -54
  26. package/lib/import/modules/locales.d.ts +15 -4
  27. package/lib/import/modules/locales.js +194 -94
  28. package/lib/import/modules/marketplace-apps.d.ts +6 -3
  29. package/lib/import/modules/marketplace-apps.js +177 -102
  30. package/lib/import/modules/personalize.d.ts +11 -4
  31. package/lib/import/modules/personalize.js +138 -47
  32. package/lib/import/modules/stack.d.ts +6 -0
  33. package/lib/import/modules/stack.js +71 -27
  34. package/lib/import/modules/taxonomies.d.ts +4 -2
  35. package/lib/import/modules/taxonomies.js +60 -46
  36. package/lib/import/modules/variant-entries.d.ts +7 -4
  37. package/lib/import/modules/variant-entries.js +76 -35
  38. package/lib/import/modules/webhooks.d.ts +3 -0
  39. package/lib/import/modules/webhooks.js +71 -40
  40. package/lib/import/modules/workflows.d.ts +3 -0
  41. package/lib/import/modules/workflows.js +98 -48
  42. package/lib/types/default-config.d.ts +0 -1
  43. package/lib/types/import-config.d.ts +0 -1
  44. package/lib/types/index.d.ts +1 -12
  45. package/lib/utils/backup-handler.js +0 -1
  46. package/lib/utils/constants.d.ts +243 -0
  47. package/lib/utils/constants.js +264 -0
  48. package/lib/utils/import-config-handler.js +2 -0
  49. package/lib/utils/import-path-resolver.js +3 -13
  50. package/lib/utils/index.d.ts +1 -1
  51. package/lib/utils/index.js +6 -2
  52. package/lib/utils/marketplace-app-helper.js +3 -8
  53. package/lib/utils/progress-strategy-registry.d.ts +7 -0
  54. package/lib/utils/progress-strategy-registry.js +78 -0
  55. package/lib/utils/setup-branch.js +1 -1
  56. package/oclif.manifest.json +2 -2
  57. package/package.json +3 -3
  58. package/lib/import/modules-js/assets.d.ts +0 -33
  59. package/lib/import/modules-js/assets.js +0 -428
  60. package/lib/import/modules-js/content-types.d.ts +0 -34
  61. package/lib/import/modules-js/content-types.js +0 -204
  62. package/lib/import/modules-js/custom-roles.d.ts +0 -15
  63. package/lib/import/modules-js/custom-roles.js +0 -143
  64. package/lib/import/modules-js/entries.d.ts +0 -54
  65. package/lib/import/modules-js/entries.js +0 -1280
  66. package/lib/import/modules-js/environments.d.ts +0 -13
  67. package/lib/import/modules-js/environments.js +0 -85
  68. package/lib/import/modules-js/extensions.d.ts +0 -18
  69. package/lib/import/modules-js/extensions.js +0 -86
  70. package/lib/import/modules-js/global-fields.d.ts +0 -13
  71. package/lib/import/modules-js/global-fields.js +0 -106
  72. package/lib/import/modules-js/index.d.ts +0 -1
  73. package/lib/import/modules-js/index.js +0 -33
  74. package/lib/import/modules-js/labels.d.ts +0 -20
  75. package/lib/import/modules-js/labels.js +0 -148
  76. package/lib/import/modules-js/locales.d.ts +0 -24
  77. package/lib/import/modules-js/locales.js +0 -196
  78. package/lib/import/modules-js/marketplace-apps.d.ts +0 -63
  79. package/lib/import/modules-js/marketplace-apps.js +0 -429
  80. package/lib/import/modules-js/webhooks.d.ts +0 -17
  81. package/lib/import/modules-js/webhooks.js +0 -85
  82. package/lib/import/modules-js/workflows.d.ts +0 -19
  83. package/lib/import/modules-js/workflows.js +0 -170
  84. package/lib/utils/log.d.ts +0 -12
  85. package/lib/utils/log.js +0 -31
@@ -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
+ };
@@ -113,6 +113,8 @@ const setupConfig = async (importCmdFlags) => {
113
113
  if (importCmdFlags['exclude-global-modules']) {
114
114
  config['exclude-global-modules'] = importCmdFlags['exclude-global-modules'];
115
115
  }
116
+ // Set progress supported module to check and display console logs
117
+ cli_utilities_1.configHandler.set('log.progressSupportedModule', 'import');
116
118
  // Add authentication details to config for context tracking
117
119
  config.authenticationMethod = authenticationMethod;
118
120
  cli_utilities_1.log.debug('Import configuration setup completed', Object.assign({}, config));
@@ -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
@@ -116,17 +116,7 @@ const updateImportConfigWithResolvedPath = async (importConfig, resolvedPath) =>
116
116
  importConfig.branchDir = resolvedPath;
117
117
  importConfig.contentDir = resolvedPath;
118
118
  importConfig.data = resolvedPath;
119
- const exportInfoPath = path.join(resolvedPath, 'export-info.json');
120
- if ((0, file_helper_1.fileExistsSync)(exportInfoPath)) {
121
- const exportInfo = await (0, file_helper_1.readFile)(exportInfoPath);
122
- importConfig.contentVersion = (exportInfo === null || exportInfo === void 0 ? void 0 : exportInfo.contentVersion) || 2;
123
- cli_utilities_1.log.debug(`Content version set to ${importConfig.contentVersion} from ${exportInfoPath}`);
124
- }
125
- else {
126
- importConfig.contentVersion = 1;
127
- cli_utilities_1.log.debug(`No export-info.json found at ${exportInfoPath}, setting content version to 1`);
128
- }
129
- cli_utilities_1.log.debug(`Import config updated - contentDir: ${importConfig.contentDir}, branchDir: ${importConfig.branchDir}, data: ${importConfig.data}, contentVersion: ${importConfig.contentVersion}`);
119
+ cli_utilities_1.log.debug(`Import config updated - contentDir: ${importConfig.contentDir}, branchDir: ${importConfig.branchDir}, data: ${importConfig.data},`);
130
120
  };
131
121
  exports.updateImportConfigWithResolvedPath = updateImportConfigWithResolvedPath;
132
122
  /**
@@ -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; } });
@@ -8,7 +8,6 @@ const omitBy_1 = tslib_1.__importDefault(require("lodash/omitBy"));
8
8
  const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
9
9
  const includes_1 = tslib_1.__importDefault(require("lodash/includes"));
10
10
  const cli_utilities_1 = require("@contentstack/cli-utilities");
11
- const log_1 = require("../utils/log");
12
11
  const utils_1 = require("../utils");
13
12
  const interactive_1 = require("../utils/interactive");
14
13
  const getAllStackSpecificApps = async (config, skip = 0, listOfApps = []) => {
@@ -22,7 +21,6 @@ const getAllStackSpecificApps = async (config, skip = 0, listOfApps = []) => {
22
21
  .fetchAll({ target_uids: config.target_stack, skip })
23
22
  .catch((error) => {
24
23
  (0, cli_utilities_1.handleAndLogError)(error);
25
- (0, log_1.trace)(error, 'error', true);
26
24
  });
27
25
  if (collection) {
28
26
  const { items: apps, count } = collection;
@@ -58,8 +56,7 @@ const getOrgUid = async (config) => {
58
56
  .stack({ api_key: config.target_stack })
59
57
  .fetch()
60
58
  .catch((error) => {
61
- (0, cli_utilities_1.handleAndLogError)(error);
62
- (0, log_1.trace)(error, 'error', true);
59
+ throw error;
63
60
  });
64
61
  const orgUid = (tempStackData === null || tempStackData === void 0 ? void 0 : tempStackData.org_uid) || '';
65
62
  cli_utilities_1.log.debug(`Organization UID: ${orgUid}`);
@@ -81,7 +78,7 @@ const getConfirmationToCreateApps = async (privateApps, config) => {
81
78
  return Promise.resolve(true);
82
79
  }
83
80
  else {
84
- cli_utilities_1.log.debug('User declined to create private apps (second prompt)');
81
+ cli_utilities_1.log.warn('User declined to create private apps (second prompt)');
85
82
  return Promise.resolve(false);
86
83
  }
87
84
  }
@@ -92,7 +89,7 @@ const getConfirmationToCreateApps = async (privateApps, config) => {
92
89
  }
93
90
  }
94
91
  else {
95
- cli_utilities_1.log.debug('Force prompt disabled, automatically creating private apps');
92
+ cli_utilities_1.log.info('Force prompt disabled, automatically creating private apps');
96
93
  return Promise.resolve(true);
97
94
  }
98
95
  };
@@ -115,7 +112,6 @@ const makeRedirectUrlCall = async (response, appName, config) => {
115
112
  .then(async ({ response }) => {
116
113
  if ((0, includes_1.default)([501, 403], response.status)) {
117
114
  cli_utilities_1.log.error(`OAuth API call failed for ${appName}: ${response.statusText}`);
118
- (0, log_1.trace)(response, 'error', true);
119
115
  await (0, exports.confirmToCloseProcess)(response.data, config);
120
116
  }
121
117
  else {
@@ -123,7 +119,6 @@ const makeRedirectUrlCall = async (response, appName, config) => {
123
119
  }
124
120
  })
125
121
  .catch((error) => {
126
- (0, log_1.trace)(error, 'error', true);
127
122
  if ((0, includes_1.default)([501, 403], error.status)) {
128
123
  (0, cli_utilities_1.handleAndLogError)(error);
129
124
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Progress Strategy Registrations for Import Modules
3
+ * This file registers progress calculation strategies for all import modules
4
+ * to ensure correct item counts in the final summary.
5
+ */
6
+ import { ProgressStrategyRegistry } from '@contentstack/cli-utilities';
7
+ export default ProgressStrategyRegistry;