@squiz/dxp-cli-next 5.33.0-develop.1 → 5.33.0-develop.11
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 +1 -0
- package/bin/dxp.js +6 -1
- package/dist/dxp.js +4480 -0
- package/package.json +36 -30
- package/lib/ApiService.d.ts +0 -39
- package/lib/ApiService.js +0 -120
- package/lib/ApiService.spec.d.ts +0 -1
- package/lib/ApiService.spec.js +0 -182
- package/lib/ApplicationConfig.d.ts +0 -7
- package/lib/ApplicationConfig.js +0 -38
- package/lib/ApplicationConfig.spec.d.ts +0 -1
- package/lib/ApplicationConfig.spec.js +0 -84
- package/lib/ApplicationStore.d.ts +0 -13
- package/lib/ApplicationStore.js +0 -53
- package/lib/__tests__/cmp/dev-mode.spec.d.ts +0 -1
- package/lib/__tests__/cmp/dev-mode.spec.js +0 -54
- package/lib/__tests__/helpers.d.ts +0 -17
- package/lib/__tests__/helpers.js +0 -54
- package/lib/__tests__/integration/main.spec.d.ts +0 -1
- package/lib/__tests__/integration/main.spec.js +0 -45
- package/lib/__tests__/smoke/validate.spec.d.ts +0 -1
- package/lib/__tests__/smoke/validate.spec.js +0 -37
- package/lib/__tests__/unit/cli.d.ts +0 -0
- package/lib/__tests__/unit/cli.js +0 -7
- package/lib/auth/index.d.ts +0 -3
- package/lib/auth/index.js +0 -14
- package/lib/auth/login/login.d.ts +0 -22
- package/lib/auth/login/login.js +0 -268
- package/lib/auth/login/login.spec.d.ts +0 -1
- package/lib/auth/login/login.spec.js +0 -179
- package/lib/auth/logout/logout.d.ts +0 -3
- package/lib/auth/logout/logout.js +0 -115
- package/lib/auth/logout/logout.spec.d.ts +0 -1
- package/lib/auth/logout/logout.spec.js +0 -67
- package/lib/cdp/constants.d.ts +0 -1
- package/lib/cdp/constants.js +0 -4
- package/lib/cdp/index.d.ts +0 -3
- package/lib/cdp/index.js +0 -16
- package/lib/cdp/instance/activate/activate.d.ts +0 -5
- package/lib/cdp/instance/activate/activate.js +0 -107
- package/lib/cdp/instance/activate/activate.spec.d.ts +0 -1
- package/lib/cdp/instance/activate/activate.spec.js +0 -274
- package/lib/cdp/instance/instanceCommand.d.ts +0 -3
- package/lib/cdp/instance/instanceCommand.js +0 -15
- package/lib/cdp/schema/deploy/deploy.const.d.ts +0 -5
- package/lib/cdp/schema/deploy/deploy.const.js +0 -8
- package/lib/cdp/schema/deploy/deploy.d.ts +0 -4
- package/lib/cdp/schema/deploy/deploy.js +0 -107
- package/lib/cdp/schema/deploy/deploy.spec.d.ts +0 -1
- package/lib/cdp/schema/deploy/deploy.spec.js +0 -137
- package/lib/cdp/schema/schemaCommand.d.ts +0 -3
- package/lib/cdp/schema/schemaCommand.js +0 -15
- package/lib/cdp/utils.d.ts +0 -23
- package/lib/cdp/utils.js +0 -133
- package/lib/cmp/deploy.d.ts +0 -3
- package/lib/cmp/deploy.js +0 -124
- package/lib/cmp/dev-mode-ui.d.ts +0 -4
- package/lib/cmp/dev-mode-ui.js +0 -51
- package/lib/cmp/dev-mode.d.ts +0 -4
- package/lib/cmp/dev-mode.js +0 -58
- package/lib/cmp/edge-components/compiler.d.ts +0 -13
- package/lib/cmp/edge-components/compiler.js +0 -55
- package/lib/cmp/index.d.ts +0 -3
- package/lib/cmp/index.js +0 -18
- package/lib/cmp/init.d.ts +0 -3
- package/lib/cmp/init.js +0 -105
- package/lib/cmp/utils/definitions.d.ts +0 -481
- package/lib/cmp/utils/definitions.js +0 -262
- package/lib/cmp/utils/definitions.spec.d.ts +0 -1
- package/lib/cmp/utils/definitions.spec.js +0 -503
- package/lib/constants.d.ts +0 -1
- package/lib/constants.js +0 -4
- package/lib/datastore/blueprint/add/add.d.ts +0 -3
- package/lib/datastore/blueprint/add/add.js +0 -119
- package/lib/datastore/blueprint/add/add.spec.d.ts +0 -1
- package/lib/datastore/blueprint/add/add.spec.js +0 -134
- package/lib/datastore/blueprint/blueprintCommand.d.ts +0 -3
- package/lib/datastore/blueprint/blueprintCommand.js +0 -21
- package/lib/datastore/blueprint/list/list.d.ts +0 -3
- package/lib/datastore/blueprint/list/list.js +0 -76
- package/lib/datastore/blueprint/list/list.spec.d.ts +0 -1
- package/lib/datastore/blueprint/list/list.spec.js +0 -51
- package/lib/datastore/blueprint/rename/rename.d.ts +0 -3
- package/lib/datastore/blueprint/rename/rename.js +0 -93
- package/lib/datastore/blueprint/rename/rename.spec.d.ts +0 -1
- package/lib/datastore/blueprint/rename/rename.spec.js +0 -142
- package/lib/datastore/blueprint/update/update.d.ts +0 -3
- package/lib/datastore/blueprint/update/update.js +0 -89
- package/lib/datastore/blueprint/update/update.spec.d.ts +0 -1
- package/lib/datastore/blueprint/update/update.spec.js +0 -99
- package/lib/datastore/bundle/bundle.d.ts +0 -3
- package/lib/datastore/bundle/bundle.js +0 -176
- package/lib/datastore/bundle/bundle.spec.d.ts +0 -1
- package/lib/datastore/bundle/bundle.spec.js +0 -94
- package/lib/datastore/index.d.ts +0 -3
- package/lib/datastore/index.js +0 -16
- package/lib/datastore/simulator/add/add.d.ts +0 -3
- package/lib/datastore/simulator/add/add.js +0 -125
- package/lib/datastore/simulator/add/add.spec.d.ts +0 -1
- package/lib/datastore/simulator/add/add.spec.js +0 -114
- package/lib/datastore/simulator/clear/clear.d.ts +0 -3
- package/lib/datastore/simulator/clear/clear.js +0 -70
- package/lib/datastore/simulator/clear/clear.spec.d.ts +0 -1
- package/lib/datastore/simulator/clear/clear.spec.js +0 -224
- package/lib/datastore/simulator/list/list.d.ts +0 -3
- package/lib/datastore/simulator/list/list.js +0 -115
- package/lib/datastore/simulator/list/list.spec.d.ts +0 -1
- package/lib/datastore/simulator/list/list.spec.js +0 -95
- package/lib/datastore/simulator/pause/pause.d.ts +0 -3
- package/lib/datastore/simulator/pause/pause.js +0 -84
- package/lib/datastore/simulator/pause/pause.spec.d.ts +0 -1
- package/lib/datastore/simulator/pause/pause.spec.js +0 -90
- package/lib/datastore/simulator/remove/remove.d.ts +0 -3
- package/lib/datastore/simulator/remove/remove.js +0 -68
- package/lib/datastore/simulator/remove/remove.spec.d.ts +0 -1
- package/lib/datastore/simulator/remove/remove.spec.js +0 -224
- package/lib/datastore/simulator/resume/resume.d.ts +0 -3
- package/lib/datastore/simulator/resume/resume.js +0 -84
- package/lib/datastore/simulator/resume/resume.spec.d.ts +0 -1
- package/lib/datastore/simulator/resume/resume.spec.js +0 -90
- package/lib/datastore/simulator/simulatorCommand.d.ts +0 -3
- package/lib/datastore/simulator/simulatorCommand.js +0 -27
- package/lib/datastore/simulator/upgrade/upgrade.d.ts +0 -3
- package/lib/datastore/simulator/upgrade/upgrade.js +0 -157
- package/lib/datastore/simulator/upgrade/upgrade.spec.d.ts +0 -1
- package/lib/datastore/simulator/upgrade/upgrade.spec.js +0 -199
- package/lib/datastore/simulator/utils.d.ts +0 -29
- package/lib/datastore/simulator/utils.js +0 -218
- package/lib/datastore/simulator/utils.spec.d.ts +0 -1
- package/lib/datastore/simulator/utils.spec.js +0 -201
- package/lib/datastore/utils.d.ts +0 -20
- package/lib/datastore/utils.js +0 -241
- package/lib/datastore/utils.spec.d.ts +0 -1
- package/lib/datastore/utils.spec.js +0 -113
- package/lib/dxp.d.ts +0 -1
- package/lib/dxp.js +0 -57
- package/lib/job-runner/index.d.ts +0 -3
- package/lib/job-runner/index.js +0 -22
- package/lib/job-runner/job/listJobs/listJobs.d.ts +0 -3
- package/lib/job-runner/job/listJobs/listJobs.js +0 -66
- package/lib/job-runner/job/listJobs/listJobs.spec.d.ts +0 -1
- package/lib/job-runner/job/listJobs/listJobs.spec.js +0 -42
- package/lib/job-runner/job/uploadJob/uploadJob.d.ts +0 -3
- package/lib/job-runner/job/uploadJob/uploadJob.js +0 -56
- package/lib/job-runner/job/uploadJob/uploadJob.spec.d.ts +0 -1
- package/lib/job-runner/job/uploadJob/uploadJob.spec.js +0 -42
- package/lib/job-runner/jobContext/listJobContexts.d.ts +0 -3
- package/lib/job-runner/jobContext/listJobContexts.js +0 -66
- package/lib/job-runner/jobContext/listJobContexts.spec.d.ts +0 -1
- package/lib/job-runner/jobContext/listJobContexts.spec.js +0 -58
- package/lib/job-runner/jobExecution/beginJob/beginJob.d.ts +0 -3
- package/lib/job-runner/jobExecution/beginJob/beginJob.js +0 -68
- package/lib/job-runner/jobExecution/beginJob/beginJob.spec.d.ts +0 -1
- package/lib/job-runner/jobExecution/beginJob/beginJob.spec.js +0 -62
- package/lib/job-runner/jobExecution/listJobExecutions/listJobExecutions.d.ts +0 -3
- package/lib/job-runner/jobExecution/listJobExecutions/listJobExecutions.js +0 -67
- package/lib/job-runner/jobExecution/listJobExecutions/listJobExecutions.spec.d.ts +0 -1
- package/lib/job-runner/jobExecution/listJobExecutions/listJobExecutions.spec.js +0 -64
- package/lib/job-runner/jobExecution/terminateJob/terminateJob.d.ts +0 -3
- package/lib/job-runner/jobExecution/terminateJob/terminateJob.js +0 -64
- package/lib/job-runner/jobExecution/terminateJob/terminateJob.spec.d.ts +0 -1
- package/lib/job-runner/jobExecution/terminateJob/terminateJob.spec.js +0 -61
- package/lib/job-runner/utils.d.ts +0 -19
- package/lib/job-runner/utils.js +0 -145
- package/lib/job-runner/utils.spec.d.ts +0 -1
- package/lib/job-runner/utils.spec.js +0 -116
- package/lib/migration/create/create.d.ts +0 -3
- package/lib/migration/create/create.js +0 -56
- package/lib/migration/create/create.spec.d.ts +0 -1
- package/lib/migration/create/create.spec.js +0 -280
- package/lib/migration/get/get.d.ts +0 -3
- package/lib/migration/get/get.js +0 -46
- package/lib/migration/get/get.spec.d.ts +0 -1
- package/lib/migration/get/get.spec.js +0 -287
- package/lib/migration/index.d.ts +0 -3
- package/lib/migration/index.js +0 -24
- package/lib/migration/list/list.d.ts +0 -3
- package/lib/migration/list/list.js +0 -45
- package/lib/migration/list/list.spec.d.ts +0 -1
- package/lib/migration/list/list.spec.js +0 -138
- package/lib/migration/next/next.d.ts +0 -3
- package/lib/migration/next/next.js +0 -75
- package/lib/migration/next/next.spec.d.ts +0 -1
- package/lib/migration/next/next.spec.js +0 -253
- package/lib/migration/pre/pre.d.ts +0 -3
- package/lib/migration/pre/pre.js +0 -54
- package/lib/migration/pre/pre.spec.d.ts +0 -1
- package/lib/migration/pre/pre.spec.js +0 -269
- package/lib/migration/revert/revert.d.ts +0 -3
- package/lib/migration/revert/revert.js +0 -47
- package/lib/migration/revert/revert.spec.d.ts +0 -1
- package/lib/migration/revert/revert.spec.js +0 -153
- package/lib/migration/settings/settings.d.ts +0 -3
- package/lib/migration/settings/settings.js +0 -63
- package/lib/migration/settings/settings.spec.d.ts +0 -1
- package/lib/migration/settings/settings.spec.js +0 -339
- package/lib/migration/types/common.types.d.ts +0 -29
- package/lib/migration/types/common.types.js +0 -2
- package/lib/migration/types/createMigration.types.d.ts +0 -10
- package/lib/migration/types/createMigration.types.js +0 -2
- package/lib/migration/types/getMigration.types.d.ts +0 -5
- package/lib/migration/types/getMigration.types.js +0 -2
- package/lib/migration/types/index.d.ts +0 -7
- package/lib/migration/types/index.js +0 -23
- package/lib/migration/types/listMigrations.types.d.ts +0 -2
- package/lib/migration/types/listMigrations.types.js +0 -2
- package/lib/migration/types/nextStage.types.d.ts +0 -10
- package/lib/migration/types/nextStage.types.js +0 -2
- package/lib/migration/types/preMigration.types.d.ts +0 -10
- package/lib/migration/types/preMigration.types.js +0 -2
- package/lib/migration/types/revert.types.d.ts +0 -6
- package/lib/migration/types/revert.types.js +0 -2
- package/lib/migration/types/settings.types.d.ts +0 -15
- package/lib/migration/types/settings.types.js +0 -2
- package/lib/migration/utils/common.d.ts +0 -39
- package/lib/migration/utils/common.js +0 -134
- package/lib/migration/utils/common.spec.d.ts +0 -1
- package/lib/migration/utils/common.spec.js +0 -165
- package/lib/migration/utils/createMigration.d.ts +0 -33
- package/lib/migration/utils/createMigration.js +0 -125
- package/lib/migration/utils/createMigration.spec.d.ts +0 -1
- package/lib/migration/utils/createMigration.spec.js +0 -259
- package/lib/migration/utils/getMigration.d.ts +0 -2
- package/lib/migration/utils/getMigration.js +0 -41
- package/lib/migration/utils/getMigration.spec.d.ts +0 -1
- package/lib/migration/utils/getMigration.spec.js +0 -156
- package/lib/migration/utils/index.d.ts +0 -9
- package/lib/migration/utils/index.js +0 -25
- package/lib/migration/utils/listMigrations.d.ts +0 -3
- package/lib/migration/utils/listMigrations.js +0 -41
- package/lib/migration/utils/listMigrations.spec.d.ts +0 -1
- package/lib/migration/utils/listMigrations.spec.js +0 -108
- package/lib/migration/utils/loadCctIdsFromFile.d.ts +0 -1
- package/lib/migration/utils/loadCctIdsFromFile.js +0 -32
- package/lib/migration/utils/loadCctIdsFromFile.spec.d.ts +0 -1
- package/lib/migration/utils/loadCctIdsFromFile.spec.js +0 -91
- package/lib/migration/utils/loadStageOptionsFromFile.d.ts +0 -1
- package/lib/migration/utils/loadStageOptionsFromFile.js +0 -32
- package/lib/migration/utils/loadStageOptionsFromFile.spec.d.ts +0 -1
- package/lib/migration/utils/loadStageOptionsFromFile.spec.js +0 -77
- package/lib/migration/utils/nextStage.d.ts +0 -2
- package/lib/migration/utils/nextStage.js +0 -45
- package/lib/migration/utils/nextStage.spec.d.ts +0 -1
- package/lib/migration/utils/nextStage.spec.js +0 -151
- package/lib/migration/utils/options.d.ts +0 -15
- package/lib/migration/utils/options.js +0 -106
- package/lib/migration/utils/options.spec.d.ts +0 -1
- package/lib/migration/utils/options.spec.js +0 -115
- package/lib/migration/utils/promptForMorphConfirmation.d.ts +0 -5
- package/lib/migration/utils/promptForMorphConfirmation.js +0 -55
- package/lib/migration/utils/promptForMorphConfirmation.spec.d.ts +0 -1
- package/lib/migration/utils/promptForMorphConfirmation.spec.js +0 -101
- package/lib/migration/utils/revertMigration.d.ts +0 -2
- package/lib/migration/utils/revertMigration.js +0 -38
- package/lib/migration/utils/revertMigration.spec.d.ts +0 -1
- package/lib/migration/utils/revertMigration.spec.js +0 -95
- package/lib/migration/utils/setMigrationSettings.d.ts +0 -2
- package/lib/migration/utils/setMigrationSettings.js +0 -52
- package/lib/migration/utils/setMigrationSettings.spec.d.ts +0 -1
- package/lib/migration/utils/setMigrationSettings.spec.js +0 -163
- package/lib/page/index.d.ts +0 -3
- package/lib/page/index.js +0 -12
- package/lib/page/layouts/deploy/deploy.d.ts +0 -5
- package/lib/page/layouts/deploy/deploy.js +0 -157
- package/lib/page/layouts/deploy/deploy.spec.d.ts +0 -1
- package/lib/page/layouts/deploy/deploy.spec.js +0 -319
- package/lib/page/layouts/dev/dev.d.ts +0 -5
- package/lib/page/layouts/dev/dev.js +0 -84
- package/lib/page/layouts/dev/dev.spec.d.ts +0 -1
- package/lib/page/layouts/dev/dev.spec.js +0 -271
- package/lib/page/layouts/layouts.d.ts +0 -3
- package/lib/page/layouts/layouts.js +0 -17
- package/lib/page/layouts/layouts.spec.d.ts +0 -1
- package/lib/page/layouts/layouts.spec.js +0 -29
- package/lib/page/layouts/validation/index.d.ts +0 -3
- package/lib/page/layouts/validation/index.js +0 -9
- package/lib/page/layouts/validation/property-consistency.d.ts +0 -7
- package/lib/page/layouts/validation/property-consistency.js +0 -92
- package/lib/page/layouts/validation/property-consistency.spec.d.ts +0 -1
- package/lib/page/layouts/validation/property-consistency.spec.js +0 -305
- package/lib/page/layouts/validation/validateLayoutFormat.d.ts +0 -2
- package/lib/page/layouts/validation/validateLayoutFormat.js +0 -27
- package/lib/page/layouts/validation/validateLayoutFormat.spec.d.ts +0 -1
- package/lib/page/layouts/validation/validateLayoutFormat.spec.js +0 -42
- package/lib/page/layouts/validation/zone-consistency.d.ts +0 -7
- package/lib/page/layouts/validation/zone-consistency.js +0 -50
- package/lib/page/layouts/validation/zone-consistency.spec.d.ts +0 -1
- package/lib/page/layouts/validation/zone-consistency.spec.js +0 -99
- package/lib/page/templates/validation.d.ts +0 -11
- package/lib/page/templates/validation.js +0 -30
- package/lib/page/templates/validation.spec.d.ts +0 -1
- package/lib/page/templates/validation.spec.js +0 -89
- package/lib/page/utils/definitions.d.ts +0 -552
- package/lib/page/utils/definitions.js +0 -241
- package/lib/page/utils/definitions.spec.d.ts +0 -1
- package/lib/page/utils/definitions.spec.js +0 -749
- package/lib/page/utils/normalize.d.ts +0 -8
- package/lib/page/utils/normalize.js +0 -54
- package/lib/page/utils/normalize.spec.d.ts +0 -1
- package/lib/page/utils/normalize.spec.js +0 -315
- package/lib/page/utils/parse-args.d.ts +0 -44
- package/lib/page/utils/parse-args.js +0 -119
- package/lib/page/utils/parse-args.spec.d.ts +0 -1
- package/lib/page/utils/parse-args.spec.js +0 -284
- package/lib/page/utils/render.d.ts +0 -51
- package/lib/page/utils/render.js +0 -112
- package/lib/page/utils/render.spec.d.ts +0 -1
- package/lib/page/utils/render.spec.js +0 -134
- package/lib/page/utils/server.d.ts +0 -12
- package/lib/page/utils/server.js +0 -201
- package/lib/page/utils/server.spec.d.ts +0 -1
- package/lib/page/utils/server.spec.js +0 -275
- package/lib/porter/constants.d.ts +0 -11
- package/lib/porter/constants.js +0 -14
- package/lib/porter/index.d.ts +0 -3
- package/lib/porter/index.js +0 -24
- package/lib/porter/port/abort/abort.d.ts +0 -3
- package/lib/porter/port/abort/abort.js +0 -80
- package/lib/porter/port/abort/abort.spec.d.ts +0 -1
- package/lib/porter/port/abort/abort.spec.js +0 -182
- package/lib/porter/port/get/get.d.ts +0 -3
- package/lib/porter/port/get/get.js +0 -96
- package/lib/porter/port/get/get.spec.d.ts +0 -1
- package/lib/porter/port/get/get.spec.js +0 -277
- package/lib/porter/port/start/start.d.ts +0 -3
- package/lib/porter/port/start/start.js +0 -82
- package/lib/porter/port/start/start.spec.d.ts +0 -1
- package/lib/porter/port/start/start.spec.js +0 -198
- package/lib/porter/project/add/add.d.ts +0 -3
- package/lib/porter/project/add/add.js +0 -138
- package/lib/porter/project/add/add.spec.d.ts +0 -1
- package/lib/porter/project/add/add.spec.js +0 -269
- package/lib/porter/project/get/get.d.ts +0 -3
- package/lib/porter/project/get/get.js +0 -65
- package/lib/porter/project/get/get.spec.d.ts +0 -1
- package/lib/porter/project/get/get.spec.js +0 -185
- package/lib/porter/project/remove/remove.d.ts +0 -3
- package/lib/porter/project/remove/remove.js +0 -69
- package/lib/porter/project/remove/remove.spec.d.ts +0 -1
- package/lib/porter/project/remove/remove.spec.js +0 -201
- package/lib/porter/types.d.ts +0 -5
- package/lib/porter/types.js +0 -2
- package/lib/porter/utils/BuildDXPUrl/BuildDXPUrl.d.ts +0 -4
- package/lib/porter/utils/BuildDXPUrl/BuildDXPUrl.js +0 -34
- package/lib/porter/utils/BuildPorterUrl/BuildPorterUrl.d.ts +0 -1
- package/lib/porter/utils/BuildPorterUrl/BuildPorterUrl.js +0 -21
- package/lib/porter/utils/BuildPorterUrl/BuildPorterUrl.spec.d.ts +0 -1
- package/lib/porter/utils/BuildPorterUrl/BuildPorterUrl.spec.js +0 -52
- package/lib/porter/utils/CoreUtils/CoreUtils.d.ts +0 -2
- package/lib/porter/utils/CoreUtils/CoreUtils.js +0 -13
- package/lib/porter/utils/CoreUtils/CoreUtils.spec.d.ts +0 -1
- package/lib/porter/utils/CoreUtils/CoreUtils.spec.js +0 -36
- package/lib/porter/utils/DoesPathExist/DoesPathExist.d.ts +0 -1
- package/lib/porter/utils/DoesPathExist/DoesPathExist.js +0 -27
- package/lib/porter/utils/DoesPathExist/DoesPathExist.spec.d.ts +0 -1
- package/lib/porter/utils/DoesPathExist/DoesPathExist.spec.js +0 -40
- package/lib/porter/utils/ErrorUtils/ErrorUtils.d.ts +0 -4
- package/lib/porter/utils/ErrorUtils/ErrorUtils.js +0 -66
- package/lib/porter/utils/ErrorUtils/ErrorUtils.spec.d.ts +0 -1
- package/lib/porter/utils/ErrorUtils/ErrorUtils.spec.js +0 -176
- package/lib/porter/utils/GetProjectConfig/GetProjectConfig.d.ts +0 -2
- package/lib/porter/utils/GetProjectConfig/GetProjectConfig.js +0 -33
- package/lib/porter/utils/GetProjectConfig/GetProjectConfig.spec.d.ts +0 -1
- package/lib/porter/utils/GetProjectConfig/GetProjectConfig.spec.js +0 -50
- package/lib/porter/utils/GetProjectName/GetProjectName.d.ts +0 -4
- package/lib/porter/utils/GetProjectName/GetProjectName.js +0 -30
- package/lib/porter/utils/GetProjectName/GetProjectName.spec.d.ts +0 -1
- package/lib/porter/utils/GetProjectName/GetProjectName.spec.js +0 -91
- package/lib/porter/utils/index.d.ts +0 -7
- package/lib/porter/utils/index.js +0 -23
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const nock_1 = __importDefault(require("nock"));
|
|
39
|
-
const create_1 = __importDefault(require("./create"));
|
|
40
|
-
const utils = __importStar(require("../utils/common"));
|
|
41
|
-
const createMigration = __importStar(require("../utils/createMigration"));
|
|
42
|
-
jest.mock('../utils/common');
|
|
43
|
-
jest.mock('../utils/createMigration');
|
|
44
|
-
const mockUtils = utils;
|
|
45
|
-
const mockCreateMigration = createMigration;
|
|
46
|
-
describe('createMigrationCommand', () => {
|
|
47
|
-
let logSpy;
|
|
48
|
-
let mockCreateMigrationResponse;
|
|
49
|
-
beforeEach(() => {
|
|
50
|
-
nock_1.default.cleanAll();
|
|
51
|
-
jest.clearAllMocks();
|
|
52
|
-
jest.resetAllMocks();
|
|
53
|
-
logSpy = jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
54
|
-
mockUtils.throwErrorIfNotLoggedIn.mockResolvedValue(undefined);
|
|
55
|
-
mockUtils.buildMigrationSuccessMessage.mockReturnValue('Migration created successfully');
|
|
56
|
-
mockCreateMigrationResponse = {
|
|
57
|
-
assetMigration: {
|
|
58
|
-
migrationId: 'migration-123',
|
|
59
|
-
assetId: 'asset-456',
|
|
60
|
-
stage: 'pending',
|
|
61
|
-
status: 'created',
|
|
62
|
-
xmlFilePath: '/path/to/xml',
|
|
63
|
-
matrixUrl: 'https://matrix.example.com',
|
|
64
|
-
previewAssetId: 'preview-789',
|
|
65
|
-
created: 1234567890,
|
|
66
|
-
updated: 1234567890,
|
|
67
|
-
migrationIdAssetId: 'migration-123-asset-456',
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
mockCreateMigration.createMigration.mockResolvedValue(mockCreateMigrationResponse);
|
|
71
|
-
});
|
|
72
|
-
afterEach(() => {
|
|
73
|
-
logSpy.mockRestore();
|
|
74
|
-
});
|
|
75
|
-
describe('successful migration creation', () => {
|
|
76
|
-
it('should create migration successfully with all required options', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
-
const program = (0, create_1.default)();
|
|
78
|
-
yield program.parseAsync([
|
|
79
|
-
'node',
|
|
80
|
-
'dxp-cli',
|
|
81
|
-
'--asset-id',
|
|
82
|
-
'asset-123',
|
|
83
|
-
'--preview-asset-id',
|
|
84
|
-
'preview-456',
|
|
85
|
-
'--matrix-url',
|
|
86
|
-
'https://matrix.example.com',
|
|
87
|
-
]);
|
|
88
|
-
expect(mockUtils.throwErrorIfNotLoggedIn).toHaveBeenCalledWith(program);
|
|
89
|
-
expect(mockCreateMigration.createMigration).toHaveBeenCalledWith({
|
|
90
|
-
assetId: 'asset-123',
|
|
91
|
-
previewAssetId: 'preview-456',
|
|
92
|
-
matrixUrl: 'https://matrix.example.com',
|
|
93
|
-
});
|
|
94
|
-
expect(mockCreateMigration.createMigration).toHaveBeenCalledTimes(1);
|
|
95
|
-
expect(mockUtils.handleCommandError).not.toHaveBeenCalled();
|
|
96
|
-
}));
|
|
97
|
-
it('should create migration with tenant option', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
-
const program = (0, create_1.default)();
|
|
99
|
-
yield program.parseAsync([
|
|
100
|
-
'node',
|
|
101
|
-
'dxp-cli',
|
|
102
|
-
'--asset-id',
|
|
103
|
-
'asset-123',
|
|
104
|
-
'--preview-asset-id',
|
|
105
|
-
'preview-456',
|
|
106
|
-
'--matrix-url',
|
|
107
|
-
'https://matrix.example.com',
|
|
108
|
-
'--tenant',
|
|
109
|
-
'test-tenant',
|
|
110
|
-
]);
|
|
111
|
-
expect(mockCreateMigration.createMigration).toHaveBeenCalledWith({
|
|
112
|
-
assetId: 'asset-123',
|
|
113
|
-
previewAssetId: 'preview-456',
|
|
114
|
-
matrixUrl: 'https://matrix.example.com',
|
|
115
|
-
tenant: 'test-tenant',
|
|
116
|
-
});
|
|
117
|
-
}));
|
|
118
|
-
it('should create migration with override URL when environment variable is set', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
119
|
-
const originalEnv = process.env.ENABLE_OVERRIDE_MIGRATION_URL;
|
|
120
|
-
process.env.ENABLE_OVERRIDE_MIGRATION_URL = 'true';
|
|
121
|
-
const program = (0, create_1.default)();
|
|
122
|
-
yield program.parseAsync([
|
|
123
|
-
'node',
|
|
124
|
-
'dxp-cli',
|
|
125
|
-
'--asset-id',
|
|
126
|
-
'asset-123',
|
|
127
|
-
'--preview-asset-id',
|
|
128
|
-
'preview-456',
|
|
129
|
-
'--matrix-url',
|
|
130
|
-
'https://matrix.example.com',
|
|
131
|
-
'--overrideUrl',
|
|
132
|
-
'https://custom.migration.url',
|
|
133
|
-
]);
|
|
134
|
-
expect(mockCreateMigration.createMigration).toHaveBeenCalledWith({
|
|
135
|
-
assetId: 'asset-123',
|
|
136
|
-
previewAssetId: 'preview-456',
|
|
137
|
-
matrixUrl: 'https://matrix.example.com',
|
|
138
|
-
overrideUrl: 'https://custom.migration.url',
|
|
139
|
-
});
|
|
140
|
-
process.env.ENABLE_OVERRIDE_MIGRATION_URL = originalEnv;
|
|
141
|
-
}));
|
|
142
|
-
});
|
|
143
|
-
describe('error scenarios', () => {
|
|
144
|
-
it('should handle migration creation failure', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
145
|
-
mockCreateMigration.createMigration.mockResolvedValue(null);
|
|
146
|
-
mockUtils.handleCommandError.mockImplementation(() => { });
|
|
147
|
-
const program = (0, create_1.default)();
|
|
148
|
-
yield program.parseAsync([
|
|
149
|
-
'node',
|
|
150
|
-
'dxp-cli',
|
|
151
|
-
'--asset-id',
|
|
152
|
-
'asset-123',
|
|
153
|
-
'--preview-asset-id',
|
|
154
|
-
'preview-456',
|
|
155
|
-
'--matrix-url',
|
|
156
|
-
'https://matrix.example.com',
|
|
157
|
-
]);
|
|
158
|
-
expect(mockUtils.handleCommandError).toHaveBeenCalledWith(program, new Error('Migration creation failed'));
|
|
159
|
-
}));
|
|
160
|
-
it('should handle migration API error', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
161
|
-
const apiError = new Error('Migration API failed');
|
|
162
|
-
mockCreateMigration.createMigration.mockRejectedValue(apiError);
|
|
163
|
-
mockUtils.handleCommandError.mockImplementation(() => { });
|
|
164
|
-
const program = (0, create_1.default)();
|
|
165
|
-
yield program.parseAsync([
|
|
166
|
-
'node',
|
|
167
|
-
'dxp-cli',
|
|
168
|
-
'--asset-id',
|
|
169
|
-
'asset-123',
|
|
170
|
-
'--preview-asset-id',
|
|
171
|
-
'preview-456',
|
|
172
|
-
'--matrix-url',
|
|
173
|
-
'https://matrix.example.com',
|
|
174
|
-
]);
|
|
175
|
-
expect(mockUtils.handleCommandError).toHaveBeenCalledWith(program, apiError);
|
|
176
|
-
}));
|
|
177
|
-
it('should handle not being logged in', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
178
|
-
const loginError = new Error('Not logged in');
|
|
179
|
-
mockUtils.throwErrorIfNotLoggedIn.mockImplementation(() => {
|
|
180
|
-
throw loginError;
|
|
181
|
-
});
|
|
182
|
-
const program = (0, create_1.default)();
|
|
183
|
-
yield expect(program.parseAsync([
|
|
184
|
-
'node',
|
|
185
|
-
'dxp-cli',
|
|
186
|
-
'--asset-id',
|
|
187
|
-
'asset-123',
|
|
188
|
-
'--preview-asset-id',
|
|
189
|
-
'preview-456',
|
|
190
|
-
'--matrix-url',
|
|
191
|
-
'https://matrix.example.com',
|
|
192
|
-
])).rejects.toThrow('Not logged in');
|
|
193
|
-
expect(mockCreateMigration.createMigration).not.toHaveBeenCalled();
|
|
194
|
-
}));
|
|
195
|
-
});
|
|
196
|
-
describe('required options validation', () => {
|
|
197
|
-
it('should require assetid option', () => {
|
|
198
|
-
const program = (0, create_1.default)().exitOverride();
|
|
199
|
-
expect(() => {
|
|
200
|
-
program.parse([
|
|
201
|
-
'node',
|
|
202
|
-
'dxp-cli',
|
|
203
|
-
'--preview-asset-id',
|
|
204
|
-
'preview-456',
|
|
205
|
-
'--matrix-url',
|
|
206
|
-
'https://matrix.example.com',
|
|
207
|
-
]);
|
|
208
|
-
}).toThrow();
|
|
209
|
-
});
|
|
210
|
-
it('should require previewAssetid option', () => {
|
|
211
|
-
const program = (0, create_1.default)().exitOverride();
|
|
212
|
-
expect(() => {
|
|
213
|
-
program.parse([
|
|
214
|
-
'node',
|
|
215
|
-
'dxp-cli',
|
|
216
|
-
'--asset-id',
|
|
217
|
-
'asset-123',
|
|
218
|
-
'--matrix-url',
|
|
219
|
-
'https://matrix.example.com',
|
|
220
|
-
]);
|
|
221
|
-
}).toThrow();
|
|
222
|
-
});
|
|
223
|
-
it('should require matrixUrl option', () => {
|
|
224
|
-
const program = (0, create_1.default)().exitOverride();
|
|
225
|
-
expect(() => {
|
|
226
|
-
program.parse([
|
|
227
|
-
'node',
|
|
228
|
-
'dxp-cli',
|
|
229
|
-
'--asset-id',
|
|
230
|
-
'asset-123',
|
|
231
|
-
'--preview-asset-id',
|
|
232
|
-
'preview-456',
|
|
233
|
-
]);
|
|
234
|
-
}).toThrow();
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
describe('command configuration', () => {
|
|
238
|
-
it('should have correct command name and description', () => {
|
|
239
|
-
const program = (0, create_1.default)();
|
|
240
|
-
expect(program.name()).toBe('create');
|
|
241
|
-
expect(program.description()).toBe('Create a new migration using the AI Page Migration service');
|
|
242
|
-
});
|
|
243
|
-
it('should parse options correctly', () => {
|
|
244
|
-
const program = (0, create_1.default)();
|
|
245
|
-
program.parse([
|
|
246
|
-
'node',
|
|
247
|
-
'dxp-cli',
|
|
248
|
-
'--asset-id',
|
|
249
|
-
'asset-123',
|
|
250
|
-
'--preview-asset-id',
|
|
251
|
-
'preview-456',
|
|
252
|
-
'--matrix-url',
|
|
253
|
-
'https://matrix.example.com',
|
|
254
|
-
'--tenant',
|
|
255
|
-
'test-tenant',
|
|
256
|
-
]);
|
|
257
|
-
const opts = program.opts();
|
|
258
|
-
expect(opts.assetId).toBe('asset-123');
|
|
259
|
-
expect(opts.previewAssetId).toBe('preview-456');
|
|
260
|
-
expect(opts.matrixUrl).toBe('https://matrix.example.com');
|
|
261
|
-
expect(opts.tenant).toBe('test-tenant');
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
describe('spinner and output behavior', () => {
|
|
265
|
-
it('should display appropriate spinner messages during execution', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
266
|
-
const program = (0, create_1.default)();
|
|
267
|
-
yield program.parseAsync([
|
|
268
|
-
'node',
|
|
269
|
-
'dxp-cli',
|
|
270
|
-
'--asset-id',
|
|
271
|
-
'asset-123',
|
|
272
|
-
'--preview-asset-id',
|
|
273
|
-
'preview-456',
|
|
274
|
-
'--matrix-url',
|
|
275
|
-
'https://matrix.example.com',
|
|
276
|
-
]);
|
|
277
|
-
expect(mockCreateMigration.createMigration).toHaveBeenCalled();
|
|
278
|
-
}));
|
|
279
|
-
});
|
|
280
|
-
});
|
package/lib/migration/get/get.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
16
|
-
const commander_1 = require("commander");
|
|
17
|
-
const utils_1 = require("../utils");
|
|
18
|
-
const ora_1 = __importDefault(require("ora"));
|
|
19
|
-
const getMigrationCommand = () => {
|
|
20
|
-
const getCommand = new commander_1.Command('get')
|
|
21
|
-
.name('get')
|
|
22
|
-
.description('Get a migration using the AI Page migration service')
|
|
23
|
-
.addOption((0, utils_1.getParamOption)(utils_1.OptionName.MIGRATION_ID))
|
|
24
|
-
.addOption((0, utils_1.getParamOption)(utils_1.OptionName.ASSET_ID, false))
|
|
25
|
-
.addOption((0, utils_1.getParamOption)(utils_1.OptionName.TENANT, false))
|
|
26
|
-
.configureOutput({
|
|
27
|
-
outputError(str, write) {
|
|
28
|
-
write(chalk_1.default.red(str));
|
|
29
|
-
},
|
|
30
|
-
})
|
|
31
|
-
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
const spinner = (0, ora_1.default)('Getting migration').start();
|
|
33
|
-
yield (0, utils_1.throwErrorIfNotLoggedIn)(getCommand);
|
|
34
|
-
try {
|
|
35
|
-
const response = yield (0, utils_1.getMigration)(options);
|
|
36
|
-
spinner.succeed(`Migration details: ${JSON.stringify(response, null, 2)}`);
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
spinner.fail();
|
|
40
|
-
(0, utils_1.handleCommandError)(getCommand, error);
|
|
41
|
-
}
|
|
42
|
-
}));
|
|
43
|
-
(0, utils_1.addOverrideUrlOption)(getCommand);
|
|
44
|
-
return getCommand;
|
|
45
|
-
};
|
|
46
|
-
exports.default = getMigrationCommand;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const nock_1 = __importDefault(require("nock"));
|
|
39
|
-
const get_1 = __importDefault(require("./get"));
|
|
40
|
-
const utils = __importStar(require("../utils/common"));
|
|
41
|
-
const ApplicationStore = __importStar(require("../../ApplicationStore"));
|
|
42
|
-
const getMigration = __importStar(require("../utils/getMigration"));
|
|
43
|
-
jest.mock('../utils/common');
|
|
44
|
-
jest.mock('../utils/getMigration');
|
|
45
|
-
jest.mock('../../ApplicationStore');
|
|
46
|
-
const mockUtils = utils;
|
|
47
|
-
const mockGetMigration = getMigration;
|
|
48
|
-
const mockApplicationStore = ApplicationStore;
|
|
49
|
-
describe('getMigrationCommand', () => {
|
|
50
|
-
let logSpy;
|
|
51
|
-
let mockGetMigrationResponse;
|
|
52
|
-
beforeEach(() => {
|
|
53
|
-
nock_1.default.cleanAll();
|
|
54
|
-
jest.clearAllMocks();
|
|
55
|
-
jest.resetAllMocks();
|
|
56
|
-
logSpy = jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
57
|
-
mockApplicationStore.getApplicationFile.mockResolvedValue('session-cookie');
|
|
58
|
-
mockUtils.throwErrorIfNotLoggedIn.mockResolvedValue(undefined);
|
|
59
|
-
mockGetMigrationResponse = {
|
|
60
|
-
migrationId: 'migration-123',
|
|
61
|
-
assetId: 'asset-456',
|
|
62
|
-
xmlFilePath: 'https://download.example.com/xml.zip',
|
|
63
|
-
matrixUrl: 'https://matrix.example.com',
|
|
64
|
-
previewAssetId: 'preview-789',
|
|
65
|
-
created: 1718230800,
|
|
66
|
-
updated: 1718230800,
|
|
67
|
-
migrationIdAssetId: 'migration-123-asset-456',
|
|
68
|
-
stage: 'completed',
|
|
69
|
-
status: 'success',
|
|
70
|
-
stageDetails: 'Migration completed successfully',
|
|
71
|
-
previewPageAssetId: 'preview-789',
|
|
72
|
-
componentsTarDownloadUrl: 'https://download.example.com/components.zip',
|
|
73
|
-
};
|
|
74
|
-
mockGetMigration.getMigration.mockResolvedValue(mockGetMigrationResponse);
|
|
75
|
-
});
|
|
76
|
-
afterEach(() => {
|
|
77
|
-
logSpy.mockRestore();
|
|
78
|
-
});
|
|
79
|
-
describe('successful migration retrieval', () => {
|
|
80
|
-
it('should get migration successfully with required options', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
const program = (0, get_1.default)();
|
|
82
|
-
yield program.parseAsync([
|
|
83
|
-
'node',
|
|
84
|
-
'dxp-cli',
|
|
85
|
-
'--migration-id',
|
|
86
|
-
'migration-123',
|
|
87
|
-
'--asset-id',
|
|
88
|
-
'asset-456',
|
|
89
|
-
]);
|
|
90
|
-
expect(mockUtils.throwErrorIfNotLoggedIn).toHaveBeenCalledWith(program);
|
|
91
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalledWith({
|
|
92
|
-
migrationId: 'migration-123',
|
|
93
|
-
assetId: 'asset-456',
|
|
94
|
-
});
|
|
95
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalledTimes(1);
|
|
96
|
-
expect(mockUtils.handleCommandError).not.toHaveBeenCalled();
|
|
97
|
-
}));
|
|
98
|
-
it('should get migration with tenant option', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
-
const program = (0, get_1.default)();
|
|
100
|
-
yield program.parseAsync([
|
|
101
|
-
'node',
|
|
102
|
-
'dxp-cli',
|
|
103
|
-
'--migration-id',
|
|
104
|
-
'migration-123',
|
|
105
|
-
'--asset-id',
|
|
106
|
-
'asset-456',
|
|
107
|
-
'--tenant',
|
|
108
|
-
'test-tenant',
|
|
109
|
-
]);
|
|
110
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalledWith({
|
|
111
|
-
migrationId: 'migration-123',
|
|
112
|
-
assetId: 'asset-456',
|
|
113
|
-
tenant: 'test-tenant',
|
|
114
|
-
});
|
|
115
|
-
}));
|
|
116
|
-
it('should get migration with override URL when environment variable is set', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
117
|
-
const originalEnv = process.env.ENABLE_OVERRIDE_MIGRATION_URL;
|
|
118
|
-
process.env.ENABLE_OVERRIDE_MIGRATION_URL = 'true';
|
|
119
|
-
const program = (0, get_1.default)();
|
|
120
|
-
yield program.parseAsync([
|
|
121
|
-
'node',
|
|
122
|
-
'dxp-cli',
|
|
123
|
-
'--migration-id',
|
|
124
|
-
'migration-123',
|
|
125
|
-
'--asset-id',
|
|
126
|
-
'asset-456',
|
|
127
|
-
'--overrideUrl',
|
|
128
|
-
'https://custom.migration.url',
|
|
129
|
-
]);
|
|
130
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalledWith({
|
|
131
|
-
migrationId: 'migration-123',
|
|
132
|
-
assetId: 'asset-456',
|
|
133
|
-
overrideUrl: 'https://custom.migration.url',
|
|
134
|
-
});
|
|
135
|
-
process.env.ENABLE_OVERRIDE_MIGRATION_URL = originalEnv;
|
|
136
|
-
}));
|
|
137
|
-
it('should get migration without asset-id option', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
138
|
-
const program = (0, get_1.default)();
|
|
139
|
-
yield program.parseAsync([
|
|
140
|
-
'node',
|
|
141
|
-
'dxp-cli',
|
|
142
|
-
'--migration-id',
|
|
143
|
-
'migration-123',
|
|
144
|
-
]);
|
|
145
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalledWith({
|
|
146
|
-
migrationId: 'migration-123',
|
|
147
|
-
});
|
|
148
|
-
}));
|
|
149
|
-
});
|
|
150
|
-
describe('error scenarios', () => {
|
|
151
|
-
it('should handle getMigration API error', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
152
|
-
const apiError = new Error('Migration not found');
|
|
153
|
-
mockGetMigration.getMigration.mockRejectedValue(apiError);
|
|
154
|
-
mockUtils.handleCommandError.mockImplementation(() => { });
|
|
155
|
-
const program = (0, get_1.default)();
|
|
156
|
-
yield program.parseAsync([
|
|
157
|
-
'node',
|
|
158
|
-
'dxp-cli',
|
|
159
|
-
'--migration-id',
|
|
160
|
-
'migration-123',
|
|
161
|
-
'--asset-id',
|
|
162
|
-
'asset-456',
|
|
163
|
-
]);
|
|
164
|
-
expect(mockUtils.handleCommandError).toHaveBeenCalledWith(program, apiError);
|
|
165
|
-
}));
|
|
166
|
-
it('should handle network error', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
167
|
-
const networkError = new Error('Network connection failed');
|
|
168
|
-
mockGetMigration.getMigration.mockRejectedValue(networkError);
|
|
169
|
-
mockUtils.handleCommandError.mockImplementation(() => { });
|
|
170
|
-
const program = (0, get_1.default)();
|
|
171
|
-
yield program.parseAsync([
|
|
172
|
-
'node',
|
|
173
|
-
'dxp-cli',
|
|
174
|
-
'--migration-id',
|
|
175
|
-
'migration-123',
|
|
176
|
-
'--asset-id',
|
|
177
|
-
'asset-456',
|
|
178
|
-
]);
|
|
179
|
-
expect(mockUtils.handleCommandError).toHaveBeenCalledWith(program, networkError);
|
|
180
|
-
}));
|
|
181
|
-
});
|
|
182
|
-
describe('required options validation', () => {
|
|
183
|
-
it('should require migration-id option', () => {
|
|
184
|
-
const program = (0, get_1.default)().exitOverride();
|
|
185
|
-
expect(() => {
|
|
186
|
-
program.parse(['node', 'dxp-cli', '--asset-id', 'asset-456']);
|
|
187
|
-
}).toThrow();
|
|
188
|
-
});
|
|
189
|
-
it('should not require asset-id option', () => {
|
|
190
|
-
const program = (0, get_1.default)().exitOverride();
|
|
191
|
-
expect(() => {
|
|
192
|
-
program.parse(['node', 'dxp-cli', '--migration-id', 'migration-123']);
|
|
193
|
-
}).not.toThrow();
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
describe('command configuration', () => {
|
|
197
|
-
it('should have correct command name and description', () => {
|
|
198
|
-
const program = (0, get_1.default)();
|
|
199
|
-
expect(program.name()).toBe('get');
|
|
200
|
-
expect(program.description()).toBe('Get a migration using the AI Page migration service');
|
|
201
|
-
});
|
|
202
|
-
it('should parse options correctly', () => {
|
|
203
|
-
const program = (0, get_1.default)();
|
|
204
|
-
program.parse([
|
|
205
|
-
'node',
|
|
206
|
-
'dxp-cli',
|
|
207
|
-
'--migration-id',
|
|
208
|
-
'migration-123',
|
|
209
|
-
'--asset-id',
|
|
210
|
-
'asset-456',
|
|
211
|
-
'--tenant',
|
|
212
|
-
'test-tenant',
|
|
213
|
-
]);
|
|
214
|
-
const opts = program.opts();
|
|
215
|
-
expect(opts.migrationId).toBe('migration-123');
|
|
216
|
-
expect(opts.assetId).toBe('asset-456');
|
|
217
|
-
expect(opts.tenant).toBe('test-tenant');
|
|
218
|
-
});
|
|
219
|
-
it('should parse options with kebab-case to camelCase conversion', () => {
|
|
220
|
-
const program = (0, get_1.default)();
|
|
221
|
-
program.parse([
|
|
222
|
-
'node',
|
|
223
|
-
'dxp-cli',
|
|
224
|
-
'--migration-id',
|
|
225
|
-
'migration-123',
|
|
226
|
-
'--asset-id',
|
|
227
|
-
'asset-456',
|
|
228
|
-
]);
|
|
229
|
-
const opts = program.opts();
|
|
230
|
-
expect(opts.migrationId).toBe('migration-123');
|
|
231
|
-
expect(opts.assetId).toBe('asset-456');
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
describe('spinner and output behavior', () => {
|
|
235
|
-
it('should display appropriate spinner messages during execution', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
236
|
-
const program = (0, get_1.default)();
|
|
237
|
-
yield program.parseAsync([
|
|
238
|
-
'node',
|
|
239
|
-
'dxp-cli',
|
|
240
|
-
'--migration-id',
|
|
241
|
-
'migration-123',
|
|
242
|
-
'--asset-id',
|
|
243
|
-
'asset-456',
|
|
244
|
-
]);
|
|
245
|
-
expect(mockUtils.throwErrorIfNotLoggedIn).toHaveBeenCalledWith(program);
|
|
246
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalled();
|
|
247
|
-
}));
|
|
248
|
-
it('should format output correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
249
|
-
const program = (0, get_1.default)();
|
|
250
|
-
yield program.parseAsync([
|
|
251
|
-
'node',
|
|
252
|
-
'dxp-cli',
|
|
253
|
-
'--migration-id',
|
|
254
|
-
'migration-123',
|
|
255
|
-
'--asset-id',
|
|
256
|
-
'asset-456',
|
|
257
|
-
]);
|
|
258
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalledWith({
|
|
259
|
-
migrationId: 'migration-123',
|
|
260
|
-
assetId: 'asset-456',
|
|
261
|
-
});
|
|
262
|
-
}));
|
|
263
|
-
});
|
|
264
|
-
describe('override URL configuration', () => {
|
|
265
|
-
it('should work with override URL when environment variable is set', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
266
|
-
const originalEnv = process.env.ENABLE_OVERRIDE_MIGRATION_URL;
|
|
267
|
-
process.env.ENABLE_OVERRIDE_MIGRATION_URL = 'true';
|
|
268
|
-
const program = (0, get_1.default)();
|
|
269
|
-
yield program.parseAsync([
|
|
270
|
-
'node',
|
|
271
|
-
'dxp-cli',
|
|
272
|
-
'--migration-id',
|
|
273
|
-
'migration-123',
|
|
274
|
-
'--asset-id',
|
|
275
|
-
'asset-456',
|
|
276
|
-
'--overrideUrl',
|
|
277
|
-
'https://custom.migration.url',
|
|
278
|
-
]);
|
|
279
|
-
expect(mockGetMigration.getMigration).toHaveBeenCalledWith({
|
|
280
|
-
migrationId: 'migration-123',
|
|
281
|
-
assetId: 'asset-456',
|
|
282
|
-
overrideUrl: 'https://custom.migration.url',
|
|
283
|
-
});
|
|
284
|
-
process.env.ENABLE_OVERRIDE_MIGRATION_URL = originalEnv;
|
|
285
|
-
}));
|
|
286
|
-
});
|
|
287
|
-
});
|
package/lib/migration/index.d.ts
DELETED
package/lib/migration/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const commander_1 = require("commander");
|
|
7
|
-
const create_1 = __importDefault(require("./create/create"));
|
|
8
|
-
const get_1 = __importDefault(require("./get/get"));
|
|
9
|
-
const next_1 = __importDefault(require("./next/next"));
|
|
10
|
-
const pre_1 = __importDefault(require("./pre/pre"));
|
|
11
|
-
const settings_1 = __importDefault(require("./settings/settings"));
|
|
12
|
-
const revert_1 = __importDefault(require("./revert/revert"));
|
|
13
|
-
const list_1 = __importDefault(require("./list/list"));
|
|
14
|
-
const migrationCommand = new commander_1.Command('migration');
|
|
15
|
-
migrationCommand
|
|
16
|
-
.description('AI Page Migration Service Commands')
|
|
17
|
-
.addCommand((0, create_1.default)())
|
|
18
|
-
.addCommand((0, get_1.default)())
|
|
19
|
-
.addCommand((0, list_1.default)())
|
|
20
|
-
.addCommand((0, next_1.default)())
|
|
21
|
-
.addCommand((0, pre_1.default)())
|
|
22
|
-
.addCommand((0, settings_1.default)())
|
|
23
|
-
.addCommand((0, revert_1.default)());
|
|
24
|
-
exports.default = migrationCommand;
|