@kontent-ai/migration-toolkit 2.9.1 → 3.0.0-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/README.md +19 -17
- package/dist/core/config.js +3 -3
- package/dist/core/config.js.map +1 -1
- package/dist/core/helpers/workflow-helper.d.ts +1 -1
- package/dist/core/helpers/workflow-helper.js +28 -26
- package/dist/core/helpers/workflow-helper.js.map +1 -1
- package/dist/core/logs/loggers.d.ts +1 -1
- package/dist/core/logs/loggers.js +15 -15
- package/dist/core/logs/loggers.js.map +1 -1
- package/dist/core/models/core.models.d.ts +27 -22
- package/dist/core/models/error.models.d.ts +14 -0
- package/dist/core/models/error.models.js +25 -0
- package/dist/core/models/error.models.js.map +1 -0
- package/dist/core/models/log.models.d.ts +2 -2
- package/dist/core/models/migration.models.d.ts +14 -14
- package/dist/core/models/migration.schema.d.ts +9 -9
- package/dist/core/models/migration.schema.js +28 -28
- package/dist/core/models/migration.schema.js.map +1 -1
- package/dist/core/utils/array.utils.d.ts +1 -1
- package/dist/core/utils/array.utils.js +4 -3
- package/dist/core/utils/array.utils.js.map +1 -1
- package/dist/core/utils/binary-data.utils.d.ts +1 -1
- package/dist/core/utils/binary-data.utils.js +6 -6
- package/dist/core/utils/binary-data.utils.js.map +1 -1
- package/dist/core/utils/confirm.utils.d.ts +1 -1
- package/dist/core/utils/confirm.utils.js +21 -20
- package/dist/core/utils/confirm.utils.js.map +1 -1
- package/dist/core/utils/error.utils.d.ts +1 -1
- package/dist/core/utils/error.utils.js +16 -14
- package/dist/core/utils/error.utils.js.map +1 -1
- package/dist/core/utils/external-id.utils.js +1 -1
- package/dist/core/utils/external-id.utils.js.map +1 -1
- package/dist/core/utils/global.utils.d.ts +3 -3
- package/dist/core/utils/global.utils.js +20 -18
- package/dist/core/utils/global.utils.js.map +1 -1
- package/dist/core/utils/http.utils.d.ts +2 -2
- package/dist/core/utils/http.utils.js +4 -4
- package/dist/core/utils/http.utils.js.map +1 -1
- package/dist/core/utils/management-client-utils.d.ts +4 -4
- package/dist/core/utils/management-client-utils.js +34 -34
- package/dist/core/utils/management-client-utils.js.map +1 -1
- package/dist/core/utils/processing-utils.d.ts +4 -4
- package/dist/core/utils/processing-utils.js +13 -13
- package/dist/core/utils/processing-utils.js.map +1 -1
- package/dist/core/utils/run.utils.d.ts +2 -2
- package/dist/core/utils/run.utils.js +7 -7
- package/dist/core/utils/run.utils.js.map +1 -1
- package/dist/export/context/export-context-fetcher.d.ts +1 -1
- package/dist/export/context/export-context-fetcher.js +92 -62
- package/dist/export/context/export-context-fetcher.js.map +1 -1
- package/dist/export/export-manager.d.ts +2 -2
- package/dist/export/export-manager.js +46 -37
- package/dist/export/export-manager.js.map +1 -1
- package/dist/export/export.models.d.ts +21 -2
- package/dist/export/utils/export.utils.d.ts +1 -1
- package/dist/export/utils/export.utils.js +3 -2
- package/dist/export/utils/export.utils.js.map +1 -1
- package/dist/file/file-manager.d.ts +2 -2
- package/dist/file/file-manager.js +7 -7
- package/dist/file/file-manager.js.map +1 -1
- package/dist/import/comparers/asset-comparer.d.ts +2 -2
- package/dist/import/comparers/asset-comparer.js +12 -11
- package/dist/import/comparers/asset-comparer.js.map +1 -1
- package/dist/import/context/import-context-fetcher.d.ts +1 -1
- package/dist/import/context/import-context-fetcher.js +77 -73
- package/dist/import/context/import-context-fetcher.js.map +1 -1
- package/dist/import/import-manager.d.ts +1 -1
- package/dist/import/import-manager.js +59 -56
- package/dist/import/import-manager.js.map +1 -1
- package/dist/import/import.models.d.ts +6 -2
- package/dist/import/importers/assets-importer.d.ts +3 -3
- package/dist/import/importers/assets-importer.js +46 -43
- package/dist/import/importers/assets-importer.js.map +1 -1
- package/dist/import/importers/content-items-importer.d.ts +3 -3
- package/dist/import/importers/content-items-importer.js +28 -25
- package/dist/import/importers/content-items-importer.js.map +1 -1
- package/dist/import/importers/language-variant-importer.d.ts +3 -3
- package/dist/import/importers/language-variant-importer.js +45 -45
- package/dist/import/importers/language-variant-importer.js.map +1 -1
- package/dist/import/importers/workflow-importer.d.ts +3 -2
- package/dist/import/importers/workflow-importer.js +58 -54
- package/dist/import/importers/workflow-importer.js.map +1 -1
- package/dist/import/utils/import.utils.d.ts +1 -1
- package/dist/import/utils/import.utils.js +3 -2
- package/dist/import/utils/import.utils.js.map +1 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/metadata.js +3 -3
- package/dist/metadata.js.map +1 -1
- package/dist/node/cli/actions/export-action.d.ts +1 -1
- package/dist/node/cli/actions/export-action.js +28 -23
- package/dist/node/cli/actions/export-action.js.map +1 -1
- package/dist/node/cli/actions/import-action.d.ts +1 -1
- package/dist/node/cli/actions/import-action.js +15 -12
- package/dist/node/cli/actions/import-action.js.map +1 -1
- package/dist/node/cli/actions/migrate-action.d.ts +1 -1
- package/dist/node/cli/actions/migrate-action.js +25 -22
- package/dist/node/cli/actions/migrate-action.js.map +1 -1
- package/dist/node/cli/app.js +13 -12
- package/dist/node/cli/app.js.map +1 -1
- package/dist/node/cli/args/args-fetcher.d.ts +1 -1
- package/dist/node/cli/args/args-fetcher.js +14 -13
- package/dist/node/cli/args/args-fetcher.js.map +1 -1
- package/dist/node/cli/args/args-setter.d.ts +1 -1
- package/dist/node/cli/args/args-setter.js +8 -6
- package/dist/node/cli/args/args-setter.js.map +1 -1
- package/dist/node/cli/cli.models.d.ts +2 -2
- package/dist/node/cli/commands.js +68 -56
- package/dist/node/cli/commands.js.map +1 -1
- package/dist/toolkit/elements-builder.d.ts +1 -1
- package/dist/toolkit/elements-builder.js +12 -12
- package/dist/toolkit/elements-builder.js.map +1 -1
- package/dist/toolkit/export.d.ts +2 -2
- package/dist/toolkit/export.js +8 -8
- package/dist/toolkit/export.js.map +1 -1
- package/dist/toolkit/file.d.ts +2 -1
- package/dist/toolkit/file.js +18 -16
- package/dist/toolkit/file.js.map +1 -1
- package/dist/toolkit/import.d.ts +1 -1
- package/dist/toolkit/import.js +12 -12
- package/dist/toolkit/import.js.map +1 -1
- package/dist/toolkit/migrate.d.ts +13 -4
- package/dist/toolkit/migrate.js +15 -13
- package/dist/toolkit/migrate.js.map +1 -1
- package/dist/translation/extraction/items-extraction.processor.d.ts +5 -4
- package/dist/translation/extraction/items-extraction.processor.js +73 -35
- package/dist/translation/extraction/items-extraction.processor.js.map +1 -1
- package/dist/translation/helpers/export-placeholder.utils.d.ts +11 -0
- package/dist/translation/helpers/export-placeholder.utils.js +11 -0
- package/dist/translation/helpers/export-placeholder.utils.js.map +1 -0
- package/dist/translation/helpers/rich-text.processor.d.ts +6 -6
- package/dist/translation/helpers/rich-text.processor.js +38 -38
- package/dist/translation/helpers/rich-text.processor.js.map +1 -1
- package/dist/translation/transforms/export-transforms.d.ts +2 -2
- package/dist/translation/transforms/export-transforms.js +93 -67
- package/dist/translation/transforms/export-transforms.js.map +1 -1
- package/dist/translation/transforms/import-transforms.d.ts +2 -2
- package/dist/translation/transforms/import-transforms.js +38 -40
- package/dist/translation/transforms/import-transforms.js.map +1 -1
- package/dist/zip/zip-manager.d.ts +4 -3
- package/dist/zip/zip-manager.js +9 -9
- package/dist/zip/zip-manager.js.map +1 -1
- package/dist/zip/zip-packager.d.ts +2 -2
- package/dist/zip/zip-packager.js +19 -17
- package/dist/zip/zip-packager.js.map +1 -1
- package/dist/zip/zip-transformer.d.ts +3 -2
- package/dist/zip/zip-transformer.js +16 -15
- package/dist/zip/zip-transformer.js.map +1 -1
- package/dist/zip/zip.models.d.ts +2 -2
- package/lib/core/config.ts +6 -6
- package/lib/core/helpers/workflow-helper.ts +190 -185
- package/lib/core/logs/loggers.ts +52 -52
- package/lib/core/models/core.models.ts +128 -119
- package/lib/core/models/error.models.ts +41 -0
- package/lib/core/models/log.models.ts +20 -20
- package/lib/core/models/migration.models.ts +54 -54
- package/lib/core/models/migration.schema.ts +108 -108
- package/lib/core/utils/array.utils.ts +43 -42
- package/lib/core/utils/binary-data.utils.ts +16 -16
- package/lib/core/utils/confirm.utils.ts +106 -105
- package/lib/core/utils/error.utils.ts +69 -72
- package/lib/core/utils/external-id.utils.ts +4 -4
- package/lib/core/utils/global.utils.ts +81 -75
- package/lib/core/utils/http.utils.ts +23 -23
- package/lib/core/utils/management-client-utils.ts +186 -186
- package/lib/core/utils/processing-utils.ts +82 -82
- package/lib/core/utils/run.utils.ts +50 -50
- package/lib/export/context/export-context-fetcher.ts +472 -447
- package/lib/export/export-manager.ts +233 -232
- package/lib/export/export.models.ts +71 -56
- package/lib/export/utils/export.utils.ts +9 -7
- package/lib/file/file-manager.ts +28 -28
- package/lib/import/comparers/asset-comparer.ts +107 -106
- package/lib/import/context/import-context-fetcher.ts +462 -462
- package/lib/import/import-manager.ts +243 -240
- package/lib/import/import.models.ts +69 -67
- package/lib/import/importers/assets-importer.ts +240 -236
- package/lib/import/importers/content-items-importer.ts +126 -122
- package/lib/import/importers/language-variant-importer.ts +324 -328
- package/lib/import/importers/workflow-importer.ts +372 -367
- package/lib/import/utils/import.utils.ts +9 -7
- package/lib/index.ts +12 -8
- package/lib/metadata.ts +3 -4
- package/lib/node/cli/actions/export-action.ts +43 -38
- package/lib/node/cli/actions/import-action.ts +32 -29
- package/lib/node/cli/actions/migrate-action.ts +49 -46
- package/lib/node/cli/app.ts +21 -21
- package/lib/node/cli/args/args-fetcher.ts +55 -54
- package/lib/node/cli/args/args-setter.ts +34 -32
- package/lib/node/cli/cli.models.ts +17 -17
- package/lib/node/cli/commands.ts +165 -153
- package/lib/toolkit/elements-builder.ts +69 -69
- package/lib/toolkit/export.ts +21 -21
- package/lib/toolkit/file.ts +59 -53
- package/lib/toolkit/import.ts +32 -32
- package/lib/toolkit/migrate.ts +60 -49
- package/lib/translation/extraction/items-extraction.processor.ts +203 -173
- package/lib/translation/helpers/export-placeholder.utils.ts +10 -0
- package/lib/translation/helpers/rich-text.processor.ts +311 -311
- package/lib/translation/transforms/export-transforms.ts +313 -279
- package/lib/translation/transforms/import-transforms.ts +188 -191
- package/lib/zip/zip-manager.ts +28 -27
- package/lib/zip/zip-packager.ts +75 -73
- package/lib/zip/zip-transformer.ts +112 -107
- package/lib/zip/zip.models.ts +7 -7
- package/package.json +91 -84
- package/dist/core/index.d.ts +0 -16
- package/dist/core/index.js +0 -17
- package/dist/core/index.js.map +0 -1
- package/dist/export/index.d.ts +0 -2
- package/dist/export/index.js +0 -3
- package/dist/export/index.js.map +0 -1
- package/dist/file/index.d.ts +0 -1
- package/dist/file/index.js +0 -2
- package/dist/file/index.js.map +0 -1
- package/dist/import/index.d.ts +0 -2
- package/dist/import/index.js +0 -3
- package/dist/import/index.js.map +0 -1
- package/dist/toolkit/index.d.ts +0 -5
- package/dist/toolkit/index.js +0 -6
- package/dist/toolkit/index.js.map +0 -1
- package/dist/translation/index.d.ts +0 -4
- package/dist/translation/index.js +0 -5
- package/dist/translation/index.js.map +0 -1
- package/dist/zip/index.d.ts +0 -4
- package/dist/zip/index.js +0 -5
- package/dist/zip/index.js.map +0 -1
- package/lib/core/index.ts +0 -18
- package/lib/export/index.ts +0 -2
- package/lib/file/index.ts +0 -1
- package/lib/import/index.ts +0 -2
- package/lib/toolkit/index.ts +0 -5
- package/lib/translation/index.ts +0 -4
- package/lib/zip/index.ts +0 -4
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getDefaultLogger } from "../../../core/logs/loggers.js";
|
|
2
|
+
import { confirmMigrateAsync } from "../../../core/utils/confirm.utils.js";
|
|
3
|
+
import { migrateAsync } from "../../../toolkit/migrate.js";
|
|
3
4
|
export async function migrateActionAsync(argsFetcher) {
|
|
4
|
-
const
|
|
5
|
-
const sourceEnvironmentId = argsFetcher.getRequiredArgumentValue(
|
|
6
|
-
const sourceApiKey = argsFetcher.getRequiredArgumentValue(
|
|
7
|
-
const targetEnvironmentId = argsFetcher.getRequiredArgumentValue(
|
|
8
|
-
const targetApiKey = argsFetcher.getRequiredArgumentValue(
|
|
9
|
-
const force = argsFetcher.getBooleanArgumentValue(
|
|
10
|
-
const
|
|
11
|
-
const
|
|
5
|
+
const logger = getDefaultLogger();
|
|
6
|
+
const sourceEnvironmentId = argsFetcher.getRequiredArgumentValue("sourceEnvironmentId");
|
|
7
|
+
const sourceApiKey = argsFetcher.getRequiredArgumentValue("sourceApiKey");
|
|
8
|
+
const targetEnvironmentId = argsFetcher.getRequiredArgumentValue("targetEnvironmentId");
|
|
9
|
+
const targetApiKey = argsFetcher.getRequiredArgumentValue("targetApiKey");
|
|
10
|
+
const force = argsFetcher.getBooleanArgumentValue("force", false);
|
|
11
|
+
const skipMissingReferences = argsFetcher.getBooleanArgumentValue("skipMissingReferences", false);
|
|
12
|
+
const items = argsFetcher.getRequiredArgumentValue("items").split(",");
|
|
13
|
+
const language = argsFetcher.getRequiredArgumentValue("language");
|
|
12
14
|
const migrateItems = items.map((m) => {
|
|
13
15
|
return {
|
|
14
16
|
itemCodename: m,
|
|
15
|
-
languageCodename: language
|
|
17
|
+
languageCodename: language,
|
|
16
18
|
};
|
|
17
19
|
});
|
|
18
20
|
await confirmMigrateAsync({
|
|
19
|
-
force
|
|
21
|
+
force,
|
|
20
22
|
sourceEnvironment: {
|
|
21
23
|
apiKey: sourceApiKey,
|
|
22
|
-
environmentId: sourceEnvironmentId
|
|
24
|
+
environmentId: sourceEnvironmentId,
|
|
23
25
|
},
|
|
24
26
|
targetEnvironment: {
|
|
25
27
|
apiKey: targetApiKey,
|
|
26
|
-
environmentId: targetEnvironmentId
|
|
28
|
+
environmentId: targetEnvironmentId,
|
|
27
29
|
},
|
|
28
|
-
logger
|
|
30
|
+
logger,
|
|
29
31
|
dataToMigrate: {
|
|
30
|
-
itemsCount: migrateItems.length
|
|
31
|
-
}
|
|
32
|
+
itemsCount: migrateItems.length,
|
|
33
|
+
},
|
|
32
34
|
});
|
|
33
35
|
await migrateAsync({
|
|
34
|
-
logger
|
|
36
|
+
logger,
|
|
35
37
|
sourceEnvironment: {
|
|
36
38
|
environmentId: sourceEnvironmentId,
|
|
37
39
|
apiKey: sourceApiKey,
|
|
38
|
-
items: migrateItems
|
|
40
|
+
items: migrateItems,
|
|
41
|
+
skipMissingReferences,
|
|
39
42
|
},
|
|
40
43
|
targetEnvironment: {
|
|
41
44
|
environmentId: targetEnvironmentId,
|
|
42
|
-
apiKey: targetApiKey
|
|
43
|
-
}
|
|
45
|
+
apiKey: targetApiKey,
|
|
46
|
+
},
|
|
44
47
|
});
|
|
45
|
-
|
|
48
|
+
logger.log({ type: "completed", message: `Migration has been successful` });
|
|
46
49
|
}
|
|
47
50
|
//# sourceMappingURL=migrate-action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-action.js","sourceRoot":"","sources":["../../../../lib/node/cli/actions/migrate-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"migrate-action.js","sourceRoot":"","sources":["../../../../lib/node/cli/actions/migrate-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,WAAgC;IACxE,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,WAAW,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IACxF,MAAM,YAAY,GAAG,WAAW,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;IAC1E,MAAM,mBAAmB,GAAG,WAAW,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IACxF,MAAM,YAAY,GAAG,WAAW,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,WAAW,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClE,MAAM,qBAAqB,GAAG,WAAW,CAAC,uBAAuB,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;IAClG,MAAM,KAAK,GAAG,WAAW,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,WAAW,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;IAClE,MAAM,YAAY,GAAgC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACjE,OAAO;YACN,YAAY,EAAE,CAAC;YACf,gBAAgB,EAAE,QAAQ;SAC1B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,mBAAmB,CAAC;QACzB,KAAK;QACL,iBAAiB,EAAE;YAClB,MAAM,EAAE,YAAY;YACpB,aAAa,EAAE,mBAAmB;SAClC;QACD,iBAAiB,EAAE;YAClB,MAAM,EAAE,YAAY;YACpB,aAAa,EAAE,mBAAmB;SAClC;QACD,MAAM;QACN,aAAa,EAAE;YACd,UAAU,EAAE,YAAY,CAAC,MAAM;SAC/B;KACD,CAAC,CAAC;IAEH,MAAM,YAAY,CAAC;QAClB,MAAM;QACN,iBAAiB,EAAE;YAClB,aAAa,EAAE,mBAAmB;YAClC,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,YAAY;YACnB,qBAAqB;SACrB;QACD,iBAAiB,EAAE;YAClB,aAAa,EAAE,mBAAmB;YAClC,MAAM,EAAE,YAAY;SACpB;KACD,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC,CAAC;AAC7E,CAAC"}
|
package/dist/node/cli/app.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import chalk from
|
|
3
|
-
import { match } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { match } from "ts-pattern";
|
|
4
|
+
import { handleError } from "../../core/utils/error.utils.js";
|
|
5
|
+
import { exitProgram } from "../../core/utils/global.utils.js";
|
|
6
|
+
import { exportActionAsync } from "./actions/export-action.js";
|
|
7
|
+
import { importActionAsync } from "./actions/import-action.js";
|
|
8
|
+
import { migrateActionAsync } from "./actions/migrate-action.js";
|
|
9
|
+
import { argumentsFetcherAsync } from "./args/args-fetcher.js";
|
|
10
|
+
import { cliArgs } from "./commands.js";
|
|
10
11
|
// Need to register --help commands
|
|
11
12
|
cliArgs.registerCommands();
|
|
12
13
|
const run = async () => {
|
|
13
14
|
const argsFetcher = await argumentsFetcherAsync();
|
|
14
15
|
const action = argsFetcher.getCliAction();
|
|
15
16
|
return await match(action)
|
|
16
|
-
.with(
|
|
17
|
-
.with(
|
|
18
|
-
.with(
|
|
17
|
+
.with("export", async () => await exportActionAsync(argsFetcher))
|
|
18
|
+
.with("import", async () => await importActionAsync(argsFetcher))
|
|
19
|
+
.with("migrate", async () => await migrateActionAsync(argsFetcher))
|
|
19
20
|
.otherwise(() => exitProgram({
|
|
20
|
-
message: `Invalid action '${chalk.red(action)}'
|
|
21
|
+
message: `Invalid action '${chalk.red(action)}'`,
|
|
21
22
|
}));
|
|
22
23
|
};
|
|
23
24
|
run().catch((err) => {
|
package/dist/node/cli/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../lib/node/cli/app.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../lib/node/cli/app.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CA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2
|
export declare function argumentsFetcherAsync(): Promise<CliArgumentsFetcher>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import chalk from
|
|
2
|
-
import { match } from
|
|
3
|
-
import yargs from
|
|
4
|
-
import { hideBin } from
|
|
5
|
-
import {
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { match } from "ts-pattern";
|
|
3
|
+
import yargs from "yargs";
|
|
4
|
+
import { hideBin } from "yargs/helpers";
|
|
5
|
+
import { MigrationToolkitError } from "../../../core/models/error.models.js";
|
|
6
|
+
import { exitProgram } from "../../../core/utils/global.utils.js";
|
|
6
7
|
export async function argumentsFetcherAsync() {
|
|
7
8
|
const argv = yargs(hideBin(process.argv));
|
|
8
9
|
const resolvedArgv = await argv.argv;
|
|
@@ -11,14 +12,14 @@ export async function argumentsFetcherAsync() {
|
|
|
11
12
|
};
|
|
12
13
|
return {
|
|
13
14
|
getCliAction() {
|
|
14
|
-
const command = resolvedArgv._
|
|
15
|
+
const command = resolvedArgv._[0]?.toString()?.toLowerCase();
|
|
15
16
|
return match(command)
|
|
16
17
|
.returnType()
|
|
17
|
-
.with(
|
|
18
|
-
.with(
|
|
19
|
-
.with(
|
|
18
|
+
.with("export", () => "export")
|
|
19
|
+
.with("import", () => "import")
|
|
20
|
+
.with("migrate", () => "migrate")
|
|
20
21
|
.otherwise(() => {
|
|
21
|
-
throw
|
|
22
|
+
throw new MigrationToolkitError("unsupportedCommand", `Unsupported command '${chalk.yellow(command)}'`);
|
|
22
23
|
});
|
|
23
24
|
},
|
|
24
25
|
getOptionalArgumentValue(argName) {
|
|
@@ -28,7 +29,7 @@ export async function argumentsFetcherAsync() {
|
|
|
28
29
|
const value = getOptionalArgumentValue(argName);
|
|
29
30
|
if (!value) {
|
|
30
31
|
exitProgram({
|
|
31
|
-
message: `Missing '${chalk.yellow(argName)}' argument value
|
|
32
|
+
message: `Missing '${chalk.yellow(argName)}' argument value`,
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
return value;
|
|
@@ -38,8 +39,8 @@ export async function argumentsFetcherAsync() {
|
|
|
38
39
|
if (!value) {
|
|
39
40
|
return defaultValue;
|
|
40
41
|
}
|
|
41
|
-
return value.toLowerCase() ===
|
|
42
|
-
}
|
|
42
|
+
return value.toLowerCase() === "true".toLowerCase();
|
|
43
|
+
},
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
//# sourceMappingURL=args-fetcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args-fetcher.js","sourceRoot":"","sources":["../../../../lib/node/cli/args/args-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"args-fetcher.js","sourceRoot":"","sources":["../../../../lib/node/cli/args/args-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AASlE,MAAM,CAAC,KAAK,UAAU,qBAAqB;IAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAe,MAAM,IAAI,CAAC,IAAI,CAAC;IAEjD,MAAM,wBAAwB,GAAG,CAAC,OAAe,EAAE,EAAE;QACpD,OAAO,YAAY,CAAC,OAAO,CAAC,E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H,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CliArgumentsSetter } from
|
|
1
|
+
import type { CliArgumentsSetter } from "../cli.models.js";
|
|
2
2
|
export declare function argumentsSetter(): CliArgumentsSetter;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import yargs from
|
|
2
|
-
import { hideBin } from
|
|
1
|
+
import yargs from "yargs";
|
|
2
|
+
import { hideBin } from "yargs/helpers";
|
|
3
3
|
export function argumentsSetter() {
|
|
4
4
|
const argv = yargs(hideBin(process.argv));
|
|
5
5
|
return {
|
|
6
6
|
withCommand(command) {
|
|
7
7
|
argv.command(command.name, command.description, (yargs) => {
|
|
8
|
-
command.examples.forEach((example) =>
|
|
8
|
+
command.examples.forEach((example) => {
|
|
9
|
+
yargs.example(command.name, example);
|
|
10
|
+
});
|
|
9
11
|
command.options.forEach((option) => {
|
|
10
12
|
yargs.positional(option.name, {
|
|
11
13
|
alias: option.alias,
|
|
12
14
|
describe: option.description,
|
|
13
15
|
type: option.type,
|
|
14
|
-
demandOption: option.isRequired
|
|
16
|
+
demandOption: option.isRequired,
|
|
15
17
|
});
|
|
16
18
|
});
|
|
17
19
|
});
|
|
@@ -22,13 +24,13 @@ export function argumentsSetter() {
|
|
|
22
24
|
alias: option.alias,
|
|
23
25
|
description: option.description,
|
|
24
26
|
type: option.type,
|
|
25
|
-
demandOption: option.isRequired
|
|
27
|
+
demandOption: option.isRequired,
|
|
26
28
|
});
|
|
27
29
|
return this;
|
|
28
30
|
},
|
|
29
31
|
registerCommands() {
|
|
30
32
|
argv.parseSync();
|
|
31
|
-
}
|
|
33
|
+
},
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
36
|
//# sourceMappingURL=args-setter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args-setter.js","sourceRoot":"","sources":["../../../../lib/node/cli/args/args-setter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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;gBACjB,YAAY,EAAE,MAAM,CAAC,UAAU;aAC/B,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;QACb,CAAC;QACD,gBAAgB;YACf,IAAI,CAAC,SAAS,EAAE,CAAC;QAClB,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CliAction } from
|
|
1
|
+
import type { CliAction } from "../../core/models/core.models.js";
|
|
2
2
|
export interface Command {
|
|
3
3
|
readonly name: string;
|
|
4
4
|
readonly description: string;
|
|
@@ -10,7 +10,7 @@ export interface CommandOption {
|
|
|
10
10
|
readonly isRequired: boolean;
|
|
11
11
|
readonly alias?: string;
|
|
12
12
|
readonly description?: string;
|
|
13
|
-
readonly type?:
|
|
13
|
+
readonly type?: "boolean" | "number" | "string";
|
|
14
14
|
}
|
|
15
15
|
export type CliArgumentsSetter = {
|
|
16
16
|
withCommand(command: Command): CliArgumentsSetter;
|
|
@@ -1,155 +1,167 @@
|
|
|
1
|
-
import { argumentsSetter } from
|
|
1
|
+
import { argumentsSetter } from "./args/args-setter.js";
|
|
2
2
|
export const cliArgs = argumentsSetter()
|
|
3
3
|
.withCommand({
|
|
4
|
-
name:
|
|
5
|
-
description:
|
|
4
|
+
name: "export",
|
|
5
|
+
description: "Exports content (items & assets) from Kontent.ai environment",
|
|
6
6
|
examples: [`kontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB`],
|
|
7
7
|
options: [
|
|
8
8
|
{
|
|
9
9
|
name: `sourceApiKey`,
|
|
10
10
|
description: `Api key used for request authorization`,
|
|
11
|
-
type:
|
|
12
|
-
isRequired: true
|
|
11
|
+
type: "string",
|
|
12
|
+
isRequired: true,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
name: `sourceEnvironmentId`,
|
|
16
16
|
description: `Environment id of the source environment`,
|
|
17
|
-
type:
|
|
18
|
-
isRequired: true
|
|
17
|
+
type: "string",
|
|
18
|
+
isRequired: true,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: `language`,
|
|
22
22
|
description: `Language codename of items to export`,
|
|
23
|
-
type:
|
|
24
|
-
isRequired: true
|
|
23
|
+
type: "string",
|
|
24
|
+
isRequired: true,
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
name: `items`,
|
|
28
28
|
description: `Comma separated item codenames to export`,
|
|
29
|
-
type:
|
|
30
|
-
isRequired: true
|
|
29
|
+
type: "string",
|
|
30
|
+
isRequired: true,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
name: `filename`,
|
|
34
34
|
description: `Name of items file to export / import`,
|
|
35
|
-
type:
|
|
36
|
-
isRequired: false
|
|
35
|
+
type: "string",
|
|
36
|
+
isRequired: false,
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: `assetsFilename`,
|
|
40
40
|
description: `Name of assets file to export / import`,
|
|
41
|
-
type:
|
|
42
|
-
isRequired: false
|
|
41
|
+
type: "string",
|
|
42
|
+
isRequired: false,
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
name: `baseUrl`,
|
|
46
46
|
description: `Custom base URL`,
|
|
47
|
-
type:
|
|
48
|
-
isRequired: false
|
|
49
|
-
}
|
|
50
|
-
|
|
47
|
+
type: "string",
|
|
48
|
+
isRequired: false,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: `skipMissingReferences`,
|
|
52
|
+
description: `When enabled, missing items and assets will be skipped instead of throwing errors`,
|
|
53
|
+
type: "boolean",
|
|
54
|
+
isRequired: false,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
51
57
|
})
|
|
52
58
|
.withCommand({
|
|
53
|
-
name:
|
|
54
|
-
description:
|
|
59
|
+
name: "import",
|
|
60
|
+
description: "Imports content (items & assets) into Kontent.ai environment",
|
|
55
61
|
examples: [
|
|
56
|
-
`kontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --filename=items.zip --assetsFilename=assets.zip
|
|
62
|
+
`kontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --filename=items.zip --assetsFilename=assets.zip`,
|
|
57
63
|
],
|
|
58
64
|
options: [
|
|
59
65
|
{
|
|
60
66
|
name: `targetApiKey`,
|
|
61
67
|
description: `Api key used for request authorization`,
|
|
62
|
-
type:
|
|
63
|
-
isRequired: true
|
|
68
|
+
type: "string",
|
|
69
|
+
isRequired: true,
|
|
64
70
|
},
|
|
65
71
|
{
|
|
66
72
|
name: `targetEnvironmentId`,
|
|
67
73
|
description: `Environment id of the target environment`,
|
|
68
|
-
type:
|
|
69
|
-
isRequired: true
|
|
74
|
+
type: "string",
|
|
75
|
+
isRequired: true,
|
|
70
76
|
},
|
|
71
77
|
{
|
|
72
78
|
name: `filename`,
|
|
73
79
|
description: `Name of items file to export / import`,
|
|
74
|
-
type:
|
|
75
|
-
isRequired: false
|
|
80
|
+
type: "string",
|
|
81
|
+
isRequired: false,
|
|
76
82
|
},
|
|
77
83
|
{
|
|
78
84
|
name: `assetsFilename`,
|
|
79
85
|
description: `Name of assets file to export / import`,
|
|
80
|
-
type:
|
|
81
|
-
isRequired: false
|
|
86
|
+
type: "string",
|
|
87
|
+
isRequired: false,
|
|
82
88
|
},
|
|
83
89
|
{
|
|
84
90
|
name: `baseUrl`,
|
|
85
91
|
description: `Custom base URL`,
|
|
86
|
-
type:
|
|
87
|
-
isRequired: false
|
|
88
|
-
}
|
|
89
|
-
]
|
|
92
|
+
type: "string",
|
|
93
|
+
isRequired: false,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
90
96
|
})
|
|
91
97
|
.withCommand({
|
|
92
|
-
name:
|
|
93
|
-
description:
|
|
98
|
+
name: "migrate",
|
|
99
|
+
description: "Migrates content (items & assets) from one Kontent.ai environment into another Kontent.ai environment",
|
|
94
100
|
examples: [
|
|
95
|
-
`kontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB
|
|
101
|
+
`kontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB`,
|
|
96
102
|
],
|
|
97
103
|
options: [
|
|
98
104
|
{
|
|
99
105
|
name: `sourceApiKey`,
|
|
100
106
|
description: `Api key used for request authorization`,
|
|
101
|
-
type:
|
|
102
|
-
isRequired: true
|
|
107
|
+
type: "string",
|
|
108
|
+
isRequired: true,
|
|
103
109
|
},
|
|
104
110
|
{
|
|
105
111
|
name: `sourceEnvironmentId`,
|
|
106
112
|
description: `Environment id of the source environment`,
|
|
107
|
-
type:
|
|
108
|
-
isRequired: true
|
|
113
|
+
type: "string",
|
|
114
|
+
isRequired: true,
|
|
109
115
|
},
|
|
110
116
|
{
|
|
111
117
|
name: `language`,
|
|
112
118
|
description: `Language codename of items to export`,
|
|
113
|
-
type:
|
|
114
|
-
isRequired: true
|
|
119
|
+
type: "string",
|
|
120
|
+
isRequired: true,
|
|
115
121
|
},
|
|
116
122
|
{
|
|
117
123
|
name: `items`,
|
|
118
124
|
description: `Comma separated item codenames to export`,
|
|
119
|
-
type:
|
|
120
|
-
isRequired: true
|
|
125
|
+
type: "string",
|
|
126
|
+
isRequired: true,
|
|
121
127
|
},
|
|
122
128
|
{
|
|
123
129
|
name: `targetApiKey`,
|
|
124
130
|
description: `Api key used for request authorization`,
|
|
125
|
-
type:
|
|
126
|
-
isRequired: true
|
|
131
|
+
type: "string",
|
|
132
|
+
isRequired: true,
|
|
127
133
|
},
|
|
128
134
|
{
|
|
129
135
|
name: `targetEnvironmentId`,
|
|
130
136
|
description: `Environment id of the target environment`,
|
|
131
|
-
type:
|
|
132
|
-
isRequired: true
|
|
137
|
+
type: "string",
|
|
138
|
+
isRequired: true,
|
|
133
139
|
},
|
|
134
140
|
{
|
|
135
141
|
name: `baseUrl`,
|
|
136
142
|
description: `Custom base URL`,
|
|
137
|
-
type:
|
|
138
|
-
isRequired: false
|
|
139
|
-
}
|
|
140
|
-
|
|
143
|
+
type: "string",
|
|
144
|
+
isRequired: false,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: `skipMissingReferences`,
|
|
148
|
+
description: `When enabled, missing items and assets will be skipped instead of throwing errors`,
|
|
149
|
+
type: "boolean",
|
|
150
|
+
isRequired: false,
|
|
151
|
+
},
|
|
152
|
+
],
|
|
141
153
|
})
|
|
142
154
|
.withOption({
|
|
143
155
|
alias: `f`,
|
|
144
156
|
name: `force`,
|
|
145
157
|
description: `When enabled, confirmation is not required`,
|
|
146
|
-
type:
|
|
147
|
-
isRequired: false
|
|
158
|
+
type: "boolean",
|
|
159
|
+
isRequired: false,
|
|
148
160
|
})
|
|
149
161
|
.withOption({
|
|
150
162
|
alias: `h`,
|
|
151
163
|
name: `help`,
|
|
152
164
|
description: `Show help`,
|
|
153
|
-
isRequired: false
|
|
165
|
+
isRequired: false,
|
|
154
166
|
});
|
|
155
167
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../lib/node/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../lib/node/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,EAAE;KACtC,WAAW,CAAC;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,CAAC,qHAAqH,CAAC;IACjI,OAAO,EAAE;QACR;YACC,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,IAAI;SAChB;QACD;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D;CACD,CAAC;KAED,UAAU,CAAC;IACX,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,4CAA4C;IACzD,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,KAAK;CACjB,CAAC;KACD,UAAU,CAAC;IACX,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,KAAK;CACjB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MigrationElementModels } from
|
|
1
|
+
import type { MigrationElementModels } from "../core/models/migration.models.js";
|
|
2
2
|
export declare const elementsBuilder: {
|
|
3
3
|
textElement: (data: Omit<MigrationElementModels.TextElement, "type">) => MigrationElementModels.TextElement;
|
|
4
4
|
assetElement: (data: Omit<MigrationElementModels.AssetElement, "type">) => MigrationElementModels.AssetElement;
|
|
@@ -2,68 +2,68 @@ export const elementsBuilder = {
|
|
|
2
2
|
textElement: (data) => {
|
|
3
3
|
return {
|
|
4
4
|
...data,
|
|
5
|
-
type:
|
|
5
|
+
type: "text",
|
|
6
6
|
};
|
|
7
7
|
},
|
|
8
8
|
assetElement: (data) => {
|
|
9
9
|
return {
|
|
10
10
|
...data,
|
|
11
|
-
type:
|
|
11
|
+
type: "asset",
|
|
12
12
|
};
|
|
13
13
|
},
|
|
14
14
|
customElement: (data) => {
|
|
15
15
|
return {
|
|
16
16
|
...data,
|
|
17
|
-
type:
|
|
17
|
+
type: "custom",
|
|
18
18
|
};
|
|
19
19
|
},
|
|
20
20
|
dateTimeElement: (data) => {
|
|
21
21
|
return {
|
|
22
22
|
...data,
|
|
23
|
-
type:
|
|
23
|
+
type: "date_time",
|
|
24
24
|
};
|
|
25
25
|
},
|
|
26
26
|
linkedItemsElement: (data) => {
|
|
27
27
|
return {
|
|
28
28
|
...data,
|
|
29
|
-
type:
|
|
29
|
+
type: "modular_content",
|
|
30
30
|
};
|
|
31
31
|
},
|
|
32
32
|
multipleChoiceElement: (data) => {
|
|
33
33
|
return {
|
|
34
34
|
...data,
|
|
35
|
-
type:
|
|
35
|
+
type: "multiple_choice",
|
|
36
36
|
};
|
|
37
37
|
},
|
|
38
38
|
numberElement: (data) => {
|
|
39
39
|
return {
|
|
40
40
|
...data,
|
|
41
|
-
type:
|
|
41
|
+
type: "number",
|
|
42
42
|
};
|
|
43
43
|
},
|
|
44
44
|
richTextElement: (data) => {
|
|
45
45
|
return {
|
|
46
46
|
...data,
|
|
47
|
-
type:
|
|
47
|
+
type: "rich_text",
|
|
48
48
|
};
|
|
49
49
|
},
|
|
50
50
|
subpagesElement: (data) => {
|
|
51
51
|
return {
|
|
52
52
|
...data,
|
|
53
|
-
type:
|
|
53
|
+
type: "subpages",
|
|
54
54
|
};
|
|
55
55
|
},
|
|
56
56
|
taxonomyElement: (data) => {
|
|
57
57
|
return {
|
|
58
58
|
...data,
|
|
59
|
-
type:
|
|
59
|
+
type: "taxonomy",
|
|
60
60
|
};
|
|
61
61
|
},
|
|
62
62
|
urlSlugElement: (data) => {
|
|
63
63
|
return {
|
|
64
64
|
...data,
|
|
65
|
-
type:
|
|
65
|
+
type: "url_slug",
|
|
66
66
|
};
|
|
67
|
-
}
|
|
67
|
+
},
|
|
68
68
|
};
|
|
69
69
|
//# sourceMappingURL=elements-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements-builder.js","sourceRoot":"","sources":["../../lib/toolkit/elements-builder.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;
|
|
1
|
+
{"version":3,"file":"elements-builder.js","sourceRoot":"","sources":["../../lib/toolkit/elements-builder.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,WAAW,EAAE,CAAC,IAAsD,EAAsC,EAAE;QAC3G,OAAO;YACN,GAAG,IAAI;YACP,IAAI,EAAE,MAAM;SACZ,CAAC;IACH,CAAC;IACD,YAAY,EAAE,CAAC,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|
|
1
|
-
import type { MigrationData } from
|
|
2
|
-
import type { ExportConfig } from
|
|
1
|
+
import type { MigrationData } from "../core/models/migration.models.js";
|
|
2
|
+
import type { ExportConfig } from "../export/export.models.js";
|
|
3
3
|
export declare function exportAsync(config: ExportConfig): Promise<MigrationData>;
|