@kontent-ai/migration-toolkit 1.5.1 → 2.1.0
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/dist/es2022/core/config.d.ts +4 -0
- package/dist/es2022/core/config.js +6 -0
- package/dist/es2022/core/config.js.map +1 -0
- package/dist/es2022/core/models/migration.models.d.ts +4 -5
- package/dist/es2022/core/models/migration.schema.d.ts +46 -233
- package/dist/es2022/core/models/migration.schema.js +7 -22
- package/dist/es2022/core/models/migration.schema.js.map +1 -1
- package/dist/es2022/core/utils/binary-data.utils.d.ts +1 -0
- package/dist/es2022/core/utils/binary-data.utils.js.map +1 -1
- package/dist/es2022/core/utils/management-client-utils.d.ts +2 -2
- package/dist/es2022/core/utils/management-client-utils.js +11 -4
- package/dist/es2022/core/utils/management-client-utils.js.map +1 -1
- package/dist/es2022/export/export-manager.d.ts +1 -1
- package/dist/es2022/export/export-manager.js +6 -5
- package/dist/es2022/export/export-manager.js.map +1 -1
- package/dist/es2022/export/export.models.d.ts +4 -3
- package/dist/es2022/import/comparers/asset-comparer.js +2 -2
- package/dist/es2022/import/comparers/asset-comparer.js.map +1 -1
- package/dist/es2022/import/import.models.d.ts +2 -2
- package/dist/es2022/import/importers/assets-importer.js +2 -2
- package/dist/es2022/import/importers/assets-importer.js.map +1 -1
- package/dist/es2022/import/importers/language-variant-importer.js +4 -4
- package/dist/es2022/import/importers/language-variant-importer.js.map +1 -1
- package/dist/es2022/metadata.js +2 -2
- package/dist/es2022/toolkit/file.js +3 -2
- package/dist/es2022/toolkit/file.js.map +1 -1
- package/dist/es2022/translation/extraction/items-extraction.processor.d.ts +2 -2
- package/dist/es2022/translation/extraction/items-extraction.processor.js +10 -4
- package/dist/es2022/translation/extraction/items-extraction.processor.js.map +1 -1
- package/dist/es2022/translation/helpers/rich-text.processor.d.ts +2 -0
- package/dist/es2022/translation/helpers/rich-text.processor.js +56 -1
- package/dist/es2022/translation/helpers/rich-text.processor.js.map +1 -1
- package/dist/es2022/translation/transforms/export-transforms.js +131 -83
- package/dist/es2022/translation/transforms/export-transforms.js.map +1 -1
- package/dist/es2022/translation/transforms/import-transforms.js +22 -19
- package/dist/es2022/translation/transforms/import-transforms.js.map +1 -1
- package/dist/es2022/zip/zip-manager.d.ts +1 -0
- package/dist/es2022/zip/zip-manager.js +1 -1
- package/dist/es2022/zip/zip-manager.js.map +1 -1
- package/dist/es2022/zip/zip-packager.js +2 -1
- package/dist/es2022/zip/zip-packager.js.map +1 -1
- package/dist/es2022/zip/zip-transformer.d.ts +1 -1
- package/dist/es2022/zip/zip-transformer.js +3 -3
- package/dist/es2022/zip/zip-transformer.js.map +1 -1
- package/dist/es2022/zip/zip.models.d.ts +1 -0
- package/lib/core/config.ts +6 -0
- package/lib/core/models/migration.models.ts +12 -15
- package/lib/core/models/migration.schema.ts +11 -36
- package/lib/core/utils/binary-data.utils.ts +1 -0
- package/lib/core/utils/management-client-utils.ts +13 -6
- package/lib/export/export-manager.ts +22 -21
- package/lib/export/export.models.ts +18 -17
- package/lib/import/comparers/asset-comparer.ts +2 -2
- package/lib/import/import.models.ts +17 -17
- package/lib/import/importers/assets-importer.ts +2 -2
- package/lib/import/importers/language-variant-importer.ts +13 -13
- package/lib/metadata.ts +2 -2
- package/lib/toolkit/file.ts +3 -2
- package/lib/translation/extraction/items-extraction.processor.ts +16 -9
- package/lib/translation/helpers/rich-text.processor.ts +81 -1
- package/lib/translation/transforms/export-transforms.ts +143 -103
- package/lib/translation/transforms/import-transforms.ts +27 -31
- package/lib/zip/zip-manager.ts +2 -1
- package/lib/zip/zip-packager.ts +4 -3
- package/lib/zip/zip-transformer.ts +4 -4
- package/lib/zip/zip.models.ts +1 -0
- package/package.json +14 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../lib/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,yBAAyB,EAAE,aAAa;IACxC,0BAA0B,EAAE,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,OAAO,EAAE;CAClE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { MigrationAssetDescriptionSchema, MigrationAssetSchema, MigrationComponentSchema, MigrationDataSchema, MigrationElementSchema, MigrationElementsSchema, MigrationElementTypeSchema, MigrationElementValueSchema, MigrationItemSchema, MigrationItemSystemSchema, MigrationItemVersionSchema, MigrationReferenceSchema, MigrationUrlSlugModeSchema } from './migration.schema.js';
|
|
3
3
|
export declare namespace MigrationElementModels {
|
|
4
4
|
type MigrationElementDef<TElementType extends MigrationElementType = MigrationElementType, TValue extends MigrationElementValue = MigrationElementValue> = {
|
|
5
5
|
readonly value: TValue | undefined;
|
|
@@ -7,13 +7,13 @@ export declare namespace MigrationElementModels {
|
|
|
7
7
|
};
|
|
8
8
|
export type TextElement = MigrationElementDef<'text', string>;
|
|
9
9
|
export type NumberElement = MigrationElementDef<'number', number>;
|
|
10
|
-
export type RichTextElement = MigrationElementDef<'rich_text',
|
|
10
|
+
export type RichTextElement = MigrationElementDef<'rich_text', string>;
|
|
11
11
|
export type MultipleChoiceElement = MigrationElementDef<'multiple_choice', MigrationReference[]>;
|
|
12
12
|
export type DateTimeElement = MigrationElementDef<'date_time', string>;
|
|
13
13
|
export type AssetElement = MigrationElementDef<'asset', MigrationReference[]>;
|
|
14
14
|
export type LinkedItemsElement = MigrationElementDef<'modular_content', MigrationReference[]>;
|
|
15
15
|
export type TaxonomyElement = MigrationElementDef<'taxonomy', MigrationReference[]>;
|
|
16
|
-
export type UrlSlugElement = MigrationElementDef<'url_slug',
|
|
16
|
+
export type UrlSlugElement = MigrationElementDef<'url_slug', string>;
|
|
17
17
|
export type CustomElement = MigrationElementDef<'custom', string>;
|
|
18
18
|
export type SubpagesElement = MigrationElementDef<'subpages', MigrationReference[]>;
|
|
19
19
|
export {};
|
|
@@ -31,11 +31,10 @@ export type MigrationItemSystem<TTypeCodenames extends string = string, TLanguag
|
|
|
31
31
|
};
|
|
32
32
|
export type MigrationUrlSlugMode = z.infer<typeof MigrationUrlSlugModeSchema>;
|
|
33
33
|
export type MigrationElementType = z.infer<typeof MigrationElementTypeSchema>;
|
|
34
|
-
export type MigrationUrlSlugElementValue = z.infer<typeof MigrationUrlSlugElementValueSchema>;
|
|
35
|
-
export type MigrationRichTextElementValue = z.infer<typeof MigrationRichTextElementValueSchema>;
|
|
36
34
|
export type MigrationComponent = z.infer<typeof MigrationComponentSchema>;
|
|
37
35
|
export type MigrationElementValue = z.infer<typeof MigrationElementValueSchema>;
|
|
38
36
|
export type MigrationElement = z.infer<typeof MigrationElementSchema>;
|
|
37
|
+
export type MigrationElementTransformData = Omit<MigrationElement, 'type'>;
|
|
39
38
|
export type MigrationElements = z.infer<typeof MigrationElementsSchema>;
|
|
40
39
|
export type MigrationAssetDescription = z.infer<typeof MigrationAssetDescriptionSchema>;
|
|
41
40
|
export type MigrationAsset = z.infer<typeof MigrationAssetSchema>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
interface Elements {
|
|
3
4
|
readonly [key: string]: Element;
|
|
4
5
|
}
|
|
5
6
|
type UrlSlugMode = 'autogenerated' | 'custom';
|
|
6
|
-
type UrlSlugElementValue = {
|
|
7
|
-
readonly value?: string;
|
|
8
|
-
readonly mode: UrlSlugMode;
|
|
9
|
-
};
|
|
10
7
|
type Reference = {
|
|
11
8
|
readonly codename: string;
|
|
12
9
|
};
|
|
@@ -17,14 +14,13 @@ type Component = {
|
|
|
17
14
|
};
|
|
18
15
|
readonly elements: Elements;
|
|
19
16
|
};
|
|
20
|
-
type
|
|
21
|
-
readonly value: string;
|
|
22
|
-
readonly components: Readonly<Component[]>;
|
|
23
|
-
};
|
|
24
|
-
type ElementValue = string | undefined | number | Reference[] | RichTextElementValue | UrlSlugElementValue;
|
|
17
|
+
type ElementValue = string | undefined | number | Reference[];
|
|
25
18
|
type Element = {
|
|
26
19
|
readonly type: ElementType;
|
|
27
20
|
readonly value?: ElementValue;
|
|
21
|
+
readonly display_timezone?: string;
|
|
22
|
+
readonly components?: readonly Component[];
|
|
23
|
+
readonly mode?: UrlSlugMode;
|
|
28
24
|
};
|
|
29
25
|
type ElementType = 'text' | 'rich_text' | 'number' | 'multiple_choice' | 'date_time' | 'asset' | 'modular_content' | 'taxonomy' | 'url_slug' | 'custom' | 'subpages';
|
|
30
26
|
export declare const MigrationUrlSlugModeSchema: z.ZodReadonly<z.ZodEnum<["autogenerated", "custom"]>>;
|
|
@@ -96,89 +92,24 @@ export declare const MigrationComponentSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
96
92
|
};
|
|
97
93
|
elements: Readonly<Elements>;
|
|
98
94
|
}>>;
|
|
99
|
-
export declare const MigrationUrlSlugElementValueSchema: z.ZodReadonly<z.ZodObject<{
|
|
100
|
-
value: z.ZodOptional<z.ZodString>;
|
|
101
|
-
mode: z.ZodReadonly<z.ZodEnum<["autogenerated", "custom"]>>;
|
|
102
|
-
}, "strict", z.ZodTypeAny, {
|
|
103
|
-
mode: "autogenerated" | "custom";
|
|
104
|
-
value?: string | undefined;
|
|
105
|
-
}, {
|
|
106
|
-
mode: "autogenerated" | "custom";
|
|
107
|
-
value?: string | undefined;
|
|
108
|
-
}>>;
|
|
109
|
-
export declare const MigrationRichTextElementValueSchema: z.ZodReadonly<z.ZodObject<{
|
|
110
|
-
value: z.ZodString;
|
|
111
|
-
components: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
112
|
-
system: z.ZodObject<{
|
|
113
|
-
id: z.ZodString;
|
|
114
|
-
type: z.ZodReadonly<z.ZodObject<{
|
|
115
|
-
codename: z.ZodReadonly<z.ZodString>;
|
|
116
|
-
}, "strict", z.ZodTypeAny, {
|
|
117
|
-
codename: string;
|
|
118
|
-
}, {
|
|
119
|
-
codename: string;
|
|
120
|
-
}>>;
|
|
121
|
-
}, "strict", z.ZodTypeAny, {
|
|
122
|
-
type: Readonly<{
|
|
123
|
-
codename: string;
|
|
124
|
-
}>;
|
|
125
|
-
id: string;
|
|
126
|
-
}, {
|
|
127
|
-
type: Readonly<{
|
|
128
|
-
codename: string;
|
|
129
|
-
}>;
|
|
130
|
-
id: string;
|
|
131
|
-
}>;
|
|
132
|
-
elements: z.ZodReadonly<z.ZodType<Elements, z.ZodTypeDef, Elements>>;
|
|
133
|
-
}, "strict", z.ZodTypeAny, {
|
|
134
|
-
system: {
|
|
135
|
-
type: Readonly<{
|
|
136
|
-
codename: string;
|
|
137
|
-
}>;
|
|
138
|
-
id: string;
|
|
139
|
-
};
|
|
140
|
-
elements: Readonly<Elements>;
|
|
141
|
-
}, {
|
|
142
|
-
system: {
|
|
143
|
-
type: Readonly<{
|
|
144
|
-
codename: string;
|
|
145
|
-
}>;
|
|
146
|
-
id: string;
|
|
147
|
-
};
|
|
148
|
-
elements: Readonly<Elements>;
|
|
149
|
-
}>>, "many">>;
|
|
150
|
-
}, "strict", z.ZodTypeAny, {
|
|
151
|
-
value: string;
|
|
152
|
-
components: readonly Readonly<{
|
|
153
|
-
system: {
|
|
154
|
-
type: Readonly<{
|
|
155
|
-
codename: string;
|
|
156
|
-
}>;
|
|
157
|
-
id: string;
|
|
158
|
-
};
|
|
159
|
-
elements: Readonly<Elements>;
|
|
160
|
-
}>[];
|
|
161
|
-
}, {
|
|
162
|
-
value: string;
|
|
163
|
-
components: readonly Readonly<{
|
|
164
|
-
system: {
|
|
165
|
-
type: Readonly<{
|
|
166
|
-
codename: string;
|
|
167
|
-
}>;
|
|
168
|
-
id: string;
|
|
169
|
-
};
|
|
170
|
-
elements: Readonly<Elements>;
|
|
171
|
-
}>[];
|
|
172
|
-
}>>;
|
|
173
95
|
export declare const MigrationElementValueSchema: z.ZodUnion<[z.ZodString, z.ZodUndefined, z.ZodNumber, z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
174
96
|
codename: z.ZodReadonly<z.ZodString>;
|
|
175
97
|
}, "strict", z.ZodTypeAny, {
|
|
176
98
|
codename: string;
|
|
177
99
|
}, {
|
|
178
100
|
codename: string;
|
|
179
|
-
}>>, "many"
|
|
180
|
-
|
|
181
|
-
|
|
101
|
+
}>>, "many">]>;
|
|
102
|
+
export declare const MigrationElementSchema: z.ZodReadonly<z.ZodObject<{
|
|
103
|
+
type: z.ZodReadonly<z.ZodEnum<["text", "rich_text", "number", "multiple_choice", "date_time", "asset", "modular_content", "taxonomy", "url_slug", "custom", "subpages"]>>;
|
|
104
|
+
value: z.ZodUnion<[z.ZodString, z.ZodUndefined, z.ZodNumber, z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
105
|
+
codename: z.ZodReadonly<z.ZodString>;
|
|
106
|
+
}, "strict", z.ZodTypeAny, {
|
|
107
|
+
codename: string;
|
|
108
|
+
}, {
|
|
109
|
+
codename: string;
|
|
110
|
+
}>>, "many">]>;
|
|
111
|
+
display_timezone: z.ZodOptional<z.ZodString>;
|
|
112
|
+
components: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
182
113
|
system: z.ZodObject<{
|
|
183
114
|
id: z.ZodString;
|
|
184
115
|
type: z.ZodReadonly<z.ZodObject<{
|
|
@@ -216,10 +147,15 @@ export declare const MigrationElementValueSchema: z.ZodUnion<[z.ZodString, z.Zod
|
|
|
216
147
|
id: string;
|
|
217
148
|
};
|
|
218
149
|
elements: Readonly<Elements>;
|
|
219
|
-
}>>, "many"
|
|
150
|
+
}>>, "many">>>;
|
|
151
|
+
mode: z.ZodOptional<z.ZodReadonly<z.ZodEnum<["autogenerated", "custom"]>>>;
|
|
220
152
|
}, "strict", z.ZodTypeAny, {
|
|
221
|
-
|
|
222
|
-
|
|
153
|
+
type: "number" | "custom" | "text" | "rich_text" | "multiple_choice" | "date_time" | "asset" | "modular_content" | "taxonomy" | "url_slug" | "subpages";
|
|
154
|
+
value?: string | number | Readonly<{
|
|
155
|
+
codename: string;
|
|
156
|
+
}>[] | undefined;
|
|
157
|
+
display_timezone?: string | undefined;
|
|
158
|
+
components?: readonly Readonly<{
|
|
223
159
|
system: {
|
|
224
160
|
type: Readonly<{
|
|
225
161
|
codename: string;
|
|
@@ -227,10 +163,15 @@ export declare const MigrationElementValueSchema: z.ZodUnion<[z.ZodString, z.Zod
|
|
|
227
163
|
id: string;
|
|
228
164
|
};
|
|
229
165
|
elements: Readonly<Elements>;
|
|
230
|
-
}>[];
|
|
166
|
+
}>[] | undefined;
|
|
167
|
+
mode?: "autogenerated" | "custom" | undefined;
|
|
231
168
|
}, {
|
|
232
|
-
|
|
233
|
-
|
|
169
|
+
type: "number" | "custom" | "text" | "rich_text" | "multiple_choice" | "date_time" | "asset" | "modular_content" | "taxonomy" | "url_slug" | "subpages";
|
|
170
|
+
value?: string | number | Readonly<{
|
|
171
|
+
codename: string;
|
|
172
|
+
}>[] | undefined;
|
|
173
|
+
display_timezone?: string | undefined;
|
|
174
|
+
components?: readonly Readonly<{
|
|
234
175
|
system: {
|
|
235
176
|
type: Readonly<{
|
|
236
177
|
codename: string;
|
|
@@ -238,136 +179,8 @@ export declare const MigrationElementValueSchema: z.ZodUnion<[z.ZodString, z.Zod
|
|
|
238
179
|
id: string;
|
|
239
180
|
};
|
|
240
181
|
elements: Readonly<Elements>;
|
|
241
|
-
}>[];
|
|
242
|
-
|
|
243
|
-
value: z.ZodOptional<z.ZodString>;
|
|
244
|
-
mode: z.ZodReadonly<z.ZodEnum<["autogenerated", "custom"]>>;
|
|
245
|
-
}, "strict", z.ZodTypeAny, {
|
|
246
|
-
mode: "autogenerated" | "custom";
|
|
247
|
-
value?: string | undefined;
|
|
248
|
-
}, {
|
|
249
|
-
mode: "autogenerated" | "custom";
|
|
250
|
-
value?: string | undefined;
|
|
251
|
-
}>>]>;
|
|
252
|
-
export declare const MigrationElementSchema: z.ZodReadonly<z.ZodObject<{
|
|
253
|
-
type: z.ZodReadonly<z.ZodEnum<["text", "rich_text", "number", "multiple_choice", "date_time", "asset", "modular_content", "taxonomy", "url_slug", "custom", "subpages"]>>;
|
|
254
|
-
value: z.ZodUnion<[z.ZodString, z.ZodUndefined, z.ZodNumber, z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
255
|
-
codename: z.ZodReadonly<z.ZodString>;
|
|
256
|
-
}, "strict", z.ZodTypeAny, {
|
|
257
|
-
codename: string;
|
|
258
|
-
}, {
|
|
259
|
-
codename: string;
|
|
260
|
-
}>>, "many">, z.ZodReadonly<z.ZodObject<{
|
|
261
|
-
value: z.ZodString;
|
|
262
|
-
components: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
263
|
-
system: z.ZodObject<{
|
|
264
|
-
id: z.ZodString;
|
|
265
|
-
type: z.ZodReadonly<z.ZodObject<{
|
|
266
|
-
codename: z.ZodReadonly<z.ZodString>;
|
|
267
|
-
}, "strict", z.ZodTypeAny, {
|
|
268
|
-
codename: string;
|
|
269
|
-
}, {
|
|
270
|
-
codename: string;
|
|
271
|
-
}>>;
|
|
272
|
-
}, "strict", z.ZodTypeAny, {
|
|
273
|
-
type: Readonly<{
|
|
274
|
-
codename: string;
|
|
275
|
-
}>;
|
|
276
|
-
id: string;
|
|
277
|
-
}, {
|
|
278
|
-
type: Readonly<{
|
|
279
|
-
codename: string;
|
|
280
|
-
}>;
|
|
281
|
-
id: string;
|
|
282
|
-
}>;
|
|
283
|
-
elements: z.ZodReadonly<z.ZodType<Elements, z.ZodTypeDef, Elements>>;
|
|
284
|
-
}, "strict", z.ZodTypeAny, {
|
|
285
|
-
system: {
|
|
286
|
-
type: Readonly<{
|
|
287
|
-
codename: string;
|
|
288
|
-
}>;
|
|
289
|
-
id: string;
|
|
290
|
-
};
|
|
291
|
-
elements: Readonly<Elements>;
|
|
292
|
-
}, {
|
|
293
|
-
system: {
|
|
294
|
-
type: Readonly<{
|
|
295
|
-
codename: string;
|
|
296
|
-
}>;
|
|
297
|
-
id: string;
|
|
298
|
-
};
|
|
299
|
-
elements: Readonly<Elements>;
|
|
300
|
-
}>>, "many">>;
|
|
301
|
-
}, "strict", z.ZodTypeAny, {
|
|
302
|
-
value: string;
|
|
303
|
-
components: readonly Readonly<{
|
|
304
|
-
system: {
|
|
305
|
-
type: Readonly<{
|
|
306
|
-
codename: string;
|
|
307
|
-
}>;
|
|
308
|
-
id: string;
|
|
309
|
-
};
|
|
310
|
-
elements: Readonly<Elements>;
|
|
311
|
-
}>[];
|
|
312
|
-
}, {
|
|
313
|
-
value: string;
|
|
314
|
-
components: readonly Readonly<{
|
|
315
|
-
system: {
|
|
316
|
-
type: Readonly<{
|
|
317
|
-
codename: string;
|
|
318
|
-
}>;
|
|
319
|
-
id: string;
|
|
320
|
-
};
|
|
321
|
-
elements: Readonly<Elements>;
|
|
322
|
-
}>[];
|
|
323
|
-
}>>, z.ZodReadonly<z.ZodObject<{
|
|
324
|
-
value: z.ZodOptional<z.ZodString>;
|
|
325
|
-
mode: z.ZodReadonly<z.ZodEnum<["autogenerated", "custom"]>>;
|
|
326
|
-
}, "strict", z.ZodTypeAny, {
|
|
327
|
-
mode: "autogenerated" | "custom";
|
|
328
|
-
value?: string | undefined;
|
|
329
|
-
}, {
|
|
330
|
-
mode: "autogenerated" | "custom";
|
|
331
|
-
value?: string | undefined;
|
|
332
|
-
}>>]>;
|
|
333
|
-
}, "strict", z.ZodTypeAny, {
|
|
334
|
-
type: "number" | "custom" | "text" | "rich_text" | "multiple_choice" | "date_time" | "asset" | "modular_content" | "taxonomy" | "url_slug" | "subpages";
|
|
335
|
-
value?: string | number | Readonly<{
|
|
336
|
-
codename: string;
|
|
337
|
-
}>[] | Readonly<{
|
|
338
|
-
value: string;
|
|
339
|
-
components: readonly Readonly<{
|
|
340
|
-
system: {
|
|
341
|
-
type: Readonly<{
|
|
342
|
-
codename: string;
|
|
343
|
-
}>;
|
|
344
|
-
id: string;
|
|
345
|
-
};
|
|
346
|
-
elements: Readonly<Elements>;
|
|
347
|
-
}>[];
|
|
348
|
-
}> | Readonly<{
|
|
349
|
-
mode: "autogenerated" | "custom";
|
|
350
|
-
value?: string | undefined;
|
|
351
|
-
}> | undefined;
|
|
352
|
-
}, {
|
|
353
|
-
type: "number" | "custom" | "text" | "rich_text" | "multiple_choice" | "date_time" | "asset" | "modular_content" | "taxonomy" | "url_slug" | "subpages";
|
|
354
|
-
value?: string | number | Readonly<{
|
|
355
|
-
codename: string;
|
|
356
|
-
}>[] | Readonly<{
|
|
357
|
-
value: string;
|
|
358
|
-
components: readonly Readonly<{
|
|
359
|
-
system: {
|
|
360
|
-
type: Readonly<{
|
|
361
|
-
codename: string;
|
|
362
|
-
}>;
|
|
363
|
-
id: string;
|
|
364
|
-
};
|
|
365
|
-
elements: Readonly<Elements>;
|
|
366
|
-
}>[];
|
|
367
|
-
}> | Readonly<{
|
|
368
|
-
mode: "autogenerated" | "custom";
|
|
369
|
-
value?: string | undefined;
|
|
370
|
-
}> | undefined;
|
|
182
|
+
}>[] | undefined;
|
|
183
|
+
mode?: "autogenerated" | "custom" | undefined;
|
|
371
184
|
}>>;
|
|
372
185
|
export declare const MigrationItemVersionSchema: z.ZodReadonly<z.ZodObject<{
|
|
373
186
|
workflow_step: z.ZodReadonly<z.ZodObject<{
|
|
@@ -708,12 +521,12 @@ export declare const MigrationAssetSchema: z.ZodReadonly<z.ZodObject<z.objectUti
|
|
|
708
521
|
codename: string;
|
|
709
522
|
}>>>;
|
|
710
523
|
}, {
|
|
711
|
-
|
|
524
|
+
binary_data: z.ZodUnion<[z.ZodType<Buffer, z.ZodTypeDef, Buffer>, z.ZodType<import("buffer").Blob, z.ZodTypeDef, import("buffer").Blob>]>;
|
|
712
525
|
}>, "strict", z.ZodTypeAny, {
|
|
713
526
|
codename: string;
|
|
714
527
|
filename: string;
|
|
715
528
|
title: string;
|
|
716
|
-
|
|
529
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
717
530
|
collection?: Readonly<{
|
|
718
531
|
codename: string;
|
|
719
532
|
}> | undefined;
|
|
@@ -730,7 +543,7 @@ export declare const MigrationAssetSchema: z.ZodReadonly<z.ZodObject<z.objectUti
|
|
|
730
543
|
codename: string;
|
|
731
544
|
filename: string;
|
|
732
545
|
title: string;
|
|
733
|
-
|
|
546
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
734
547
|
collection?: Readonly<{
|
|
735
548
|
codename: string;
|
|
736
549
|
}> | undefined;
|
|
@@ -858,12 +671,12 @@ export declare const MigrationAssetsSchema: z.ZodReadonly<z.ZodArray<z.ZodReadon
|
|
|
858
671
|
codename: string;
|
|
859
672
|
}>>>;
|
|
860
673
|
}, {
|
|
861
|
-
|
|
674
|
+
binary_data: z.ZodUnion<[z.ZodType<Buffer, z.ZodTypeDef, Buffer>, z.ZodType<import("buffer").Blob, z.ZodTypeDef, import("buffer").Blob>]>;
|
|
862
675
|
}>, "strict", z.ZodTypeAny, {
|
|
863
676
|
codename: string;
|
|
864
677
|
filename: string;
|
|
865
678
|
title: string;
|
|
866
|
-
|
|
679
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
867
680
|
collection?: Readonly<{
|
|
868
681
|
codename: string;
|
|
869
682
|
}> | undefined;
|
|
@@ -880,7 +693,7 @@ export declare const MigrationAssetsSchema: z.ZodReadonly<z.ZodArray<z.ZodReadon
|
|
|
880
693
|
codename: string;
|
|
881
694
|
filename: string;
|
|
882
695
|
title: string;
|
|
883
|
-
|
|
696
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
884
697
|
collection?: Readonly<{
|
|
885
698
|
codename: string;
|
|
886
699
|
}> | undefined;
|
|
@@ -1349,12 +1162,12 @@ export declare const MigrationDataSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
1349
1162
|
codename: string;
|
|
1350
1163
|
}>>>;
|
|
1351
1164
|
}, {
|
|
1352
|
-
|
|
1165
|
+
binary_data: z.ZodUnion<[z.ZodType<Buffer, z.ZodTypeDef, Buffer>, z.ZodType<import("buffer").Blob, z.ZodTypeDef, import("buffer").Blob>]>;
|
|
1353
1166
|
}>, "strict", z.ZodTypeAny, {
|
|
1354
1167
|
codename: string;
|
|
1355
1168
|
filename: string;
|
|
1356
1169
|
title: string;
|
|
1357
|
-
|
|
1170
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
1358
1171
|
collection?: Readonly<{
|
|
1359
1172
|
codename: string;
|
|
1360
1173
|
}> | undefined;
|
|
@@ -1371,7 +1184,7 @@ export declare const MigrationDataSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
1371
1184
|
codename: string;
|
|
1372
1185
|
filename: string;
|
|
1373
1186
|
title: string;
|
|
1374
|
-
|
|
1187
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
1375
1188
|
collection?: Readonly<{
|
|
1376
1189
|
codename: string;
|
|
1377
1190
|
}> | undefined;
|
|
@@ -1420,7 +1233,7 @@ export declare const MigrationDataSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
1420
1233
|
codename: string;
|
|
1421
1234
|
filename: string;
|
|
1422
1235
|
title: string;
|
|
1423
|
-
|
|
1236
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
1424
1237
|
collection?: Readonly<{
|
|
1425
1238
|
codename: string;
|
|
1426
1239
|
}> | undefined;
|
|
@@ -1469,7 +1282,7 @@ export declare const MigrationDataSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
1469
1282
|
codename: string;
|
|
1470
1283
|
filename: string;
|
|
1471
1284
|
title: string;
|
|
1472
|
-
|
|
1285
|
+
binary_data: Buffer | import("buffer").Blob;
|
|
1473
1286
|
collection?: Readonly<{
|
|
1474
1287
|
codename: string;
|
|
1475
1288
|
}> | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
export const MigrationUrlSlugModeSchema = z.enum(['autogenerated', 'custom']).readonly();
|
|
3
4
|
export const MigrationElementTypeSchema = z
|
|
@@ -44,30 +45,14 @@ export const MigrationComponentSchema = z
|
|
|
44
45
|
elements: MigrationElementsSchema
|
|
45
46
|
})
|
|
46
47
|
.readonly();
|
|
47
|
-
export const
|
|
48
|
-
.strictObject({
|
|
49
|
-
value: z.optional(z.string()),
|
|
50
|
-
mode: MigrationUrlSlugModeSchema
|
|
51
|
-
})
|
|
52
|
-
.readonly();
|
|
53
|
-
export const MigrationRichTextElementValueSchema = z
|
|
54
|
-
.strictObject({
|
|
55
|
-
value: z.string(),
|
|
56
|
-
components: z.array(MigrationComponentSchema).readonly()
|
|
57
|
-
})
|
|
58
|
-
.readonly();
|
|
59
|
-
export const MigrationElementValueSchema = z.union([
|
|
60
|
-
z.string(),
|
|
61
|
-
z.undefined(),
|
|
62
|
-
z.number(),
|
|
63
|
-
z.array(MigrationReferenceSchema),
|
|
64
|
-
MigrationRichTextElementValueSchema,
|
|
65
|
-
MigrationUrlSlugElementValueSchema
|
|
66
|
-
]);
|
|
48
|
+
export const MigrationElementValueSchema = z.union([z.string(), z.undefined(), z.number(), z.array(MigrationReferenceSchema)]);
|
|
67
49
|
export const MigrationElementSchema = z
|
|
68
50
|
.strictObject({
|
|
69
51
|
type: MigrationElementTypeSchema,
|
|
70
|
-
value: MigrationElementValueSchema
|
|
52
|
+
value: MigrationElementValueSchema,
|
|
53
|
+
display_timezone: z.string().optional(),
|
|
54
|
+
components: z.array(MigrationComponentSchema).readonly().optional(),
|
|
55
|
+
mode: MigrationUrlSlugModeSchema.optional()
|
|
71
56
|
})
|
|
72
57
|
.readonly();
|
|
73
58
|
export const MigrationItemVersionSchema = z
|
|
@@ -106,7 +91,7 @@ const BaseMigrationAssetSchema = z.strictObject({
|
|
|
106
91
|
folder: z.optional(MigrationReferenceSchema)
|
|
107
92
|
});
|
|
108
93
|
export const MigrationAssetSchema = BaseMigrationAssetSchema.extend({
|
|
109
|
-
|
|
94
|
+
binary_data: z.union([z.instanceof(Buffer), z.instanceof(Blob)])
|
|
110
95
|
}).readonly();
|
|
111
96
|
export const ZipMigrationAssetSchema = BaseMigrationAssetSchema.extend({
|
|
112
97
|
_zipFilename: z.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.schema.js","sourceRoot":"","sources":["../../../../lib/core/models/migration.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"migration.schema.js","sourceRoot":"","sources":["../../../../lib/core/models/migration.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwCxB,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AACzF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACtC,IAAI,CAAC;IACF,MAAM;IACN,WAAW;IACX,QAAQ;IACR,iBAAiB;IACjB,WAAW;IACX,OAAO;IACP,iBAAiB;IACjB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;CACb,CAAC;KACD,QAAQ,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACpC,YAAY,CAAC;IACV,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,QAAQ,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC1B,YAAY,CAAC;IACV,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzD,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1D,cAAc,EAAE,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C,CAAC,QAAQ,CAAC,wBAAwB,CAAC;CAC/C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,MAAM,CAAC;IAChE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;CACnE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACnE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CAC3B,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CAAC;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE5E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KAC/B,YAAY,CAAC;IACV,KAAK,EAAE,oBAAoB;IAC3B,MAAM,EAAE,qBAAqB;CAChC,CAAC;KACD,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-data.utils.js","sourceRoot":"","sources":["../../../../lib/core/utils/binary-data.utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"binary-data.utils.js","sourceRoot":"","sources":["../../../../lib/core/utils/binary-data.utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,GAAW;IACvD,wDAAwD;IACxD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAE9B,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,QAAQ,CAC9C;QACI,GAAG;KACN,EACD;QACI,YAAY,EAAE,aAAa;QAC3B,aAAa,EAAE,oBAAoB;KACtC,CACJ,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,gBAAgB,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAE/G,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAmB;IAC7C,OAAO,IAAI,YAAY,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;AAC9D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AssetFolderModels, CollectionModels, EnvironmentModels, LanguageModels, ManagementClient, TaxonomyModels, WorkflowModels } from '@kontent-ai/management-sdk';
|
|
2
1
|
import { IRetryStrategyOptions } from '@kontent-ai/core-sdk';
|
|
3
|
-
import {
|
|
2
|
+
import { AssetFolderModels, CollectionModels, EnvironmentModels, LanguageModels, ManagementClient, TaxonomyModels, WorkflowModels } from '@kontent-ai/management-sdk';
|
|
4
3
|
import { FlattenedContentType } from '../models/core.models.js';
|
|
4
|
+
import { LogSpinnerData, Logger } from '../models/log.models.js';
|
|
5
5
|
export interface ManagementClientConfig {
|
|
6
6
|
readonly environmentId: string;
|
|
7
7
|
readonly apiKey: string;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { createManagementClient } from '@kontent-ai/management-sdk';
|
|
2
|
-
import { runMapiRequestAsync } from './run.utils.js';
|
|
3
|
-
import { isNotUndefined } from './global.utils.js';
|
|
4
2
|
import chalk from 'chalk';
|
|
5
|
-
import {
|
|
3
|
+
import { coreConfig } from '../config.js';
|
|
6
4
|
import { findRequired } from './array.utils.js';
|
|
5
|
+
import { isNotUndefined } from './global.utils.js';
|
|
6
|
+
import { defaultHttpService, defaultRetryStrategy } from './http.utils.js';
|
|
7
|
+
import { runMapiRequestAsync } from './run.utils.js';
|
|
7
8
|
export function getMigrationManagementClient(config) {
|
|
8
9
|
return createManagementClient({
|
|
9
10
|
environmentId: config.environmentId,
|
|
10
11
|
retryStrategy: config.retryStrategy ?? defaultRetryStrategy,
|
|
11
12
|
httpService: defaultHttpService,
|
|
12
|
-
apiKey: config.apiKey
|
|
13
|
+
apiKey: config.apiKey,
|
|
14
|
+
headers: [
|
|
15
|
+
{
|
|
16
|
+
header: coreConfig.kontentTrackingHeaderName,
|
|
17
|
+
value: coreConfig.kontentTrackingHeaderValue
|
|
18
|
+
}
|
|
19
|
+
]
|
|
13
20
|
});
|
|
14
21
|
}
|
|
15
22
|
export function managementClientUtils(client, logger) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"management-client-utils.js","sourceRoot":"","sources":["../../../../lib/core/utils/management-client-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"management-client-utils.js","sourceRoot":"","sources":["../../../../lib/core/utils/management-client-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAUH,sBAAsB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,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B,6BAA6B;QAC7B,mBAAmB;QACnB,uBAAuB;KAC1B,CAAC;AACN,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { extractErrorData,
|
|
2
|
+
import { extractErrorData, findRequired, getBinaryDataFromUrlAsync, getDefaultLogger, getMigrationManagementClient, isNotUndefined, MigrationAssetsSchema, MigrationItemsSchema, processItemsAsync } from '../core/index.js';
|
|
3
3
|
import { exportTransforms } from '../translation/index.js';
|
|
4
4
|
import { exportContextFetcherAsync } from './context/export-context-fetcher.js';
|
|
5
5
|
export function exportManager(config) {
|
|
@@ -68,7 +68,7 @@ export function exportManager(config) {
|
|
|
68
68
|
const itemElement = findRequired(elements, (m) => m.element.id === typeElement.id, `Could not find element '${chalk.red(typeElement.codename)}'`);
|
|
69
69
|
model[typeElement.codename] = {
|
|
70
70
|
type: typeElement.type,
|
|
71
|
-
|
|
71
|
+
...getMigrationElementToStore({
|
|
72
72
|
context: context,
|
|
73
73
|
contentType: contentType,
|
|
74
74
|
exportElement: itemElement,
|
|
@@ -78,7 +78,7 @@ export function exportManager(config) {
|
|
|
78
78
|
return model;
|
|
79
79
|
}, {});
|
|
80
80
|
};
|
|
81
|
-
const
|
|
81
|
+
const getMigrationElementToStore = (data) => {
|
|
82
82
|
try {
|
|
83
83
|
return exportTransforms[data.typeElement.type]({
|
|
84
84
|
context: data.context,
|
|
@@ -86,7 +86,8 @@ export function exportManager(config) {
|
|
|
86
86
|
exportElement: {
|
|
87
87
|
components: data.exportElement.components.map((component) => mapToMigrationComponent(data.context, component)),
|
|
88
88
|
value: data.exportElement.value,
|
|
89
|
-
urlSlugMode: data.exportElement.mode
|
|
89
|
+
urlSlugMode: data.exportElement.mode,
|
|
90
|
+
displayTimezone: data.exportElement.display_timezone
|
|
90
91
|
}
|
|
91
92
|
});
|
|
92
93
|
}
|
|
@@ -136,7 +137,7 @@ export function exportManager(config) {
|
|
|
136
137
|
filename: asset.fileName,
|
|
137
138
|
title: asset.title ?? '',
|
|
138
139
|
codename: asset.codename,
|
|
139
|
-
|
|
140
|
+
binary_data: binaryData.data,
|
|
140
141
|
collection: assetCollection ? { codename: assetCollection.codename } : undefined,
|
|
141
142
|
folder: assetFolder ? { codename: assetFolder.codename } : undefined,
|
|
142
143
|
descriptions: asset.descriptions.map((description) => {
|