@dcupl/cli 1.3.1 → 1.4.0-beta.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 +107 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +1247 -0
- package/dist/cli.js.map +1 -0
- package/dist/functions/app/app-id.d.ts +1 -0
- package/dist/functions/app/app-id.js +13 -0
- package/dist/functions/app/app-id.js.map +1 -0
- package/dist/functions/app/client/daemon-client.d.ts +16 -0
- package/dist/functions/app/client/daemon-client.js +67 -0
- package/dist/functions/app/client/daemon-client.js.map +1 -0
- package/dist/functions/app/commands/build.d.ts +10 -0
- package/dist/functions/app/commands/build.js +23 -0
- package/dist/functions/app/commands/build.js.map +1 -0
- package/dist/functions/app/commands/create.d.ts +35 -0
- package/dist/functions/app/commands/create.js +130 -0
- package/dist/functions/app/commands/create.js.map +1 -0
- package/dist/functions/app/commands/data/_data-helpers.d.ts +23 -0
- package/dist/functions/app/commands/data/_data-helpers.js +32 -0
- package/dist/functions/app/commands/data/_data-helpers.js.map +1 -0
- package/dist/functions/app/commands/data/remove.d.ts +3 -0
- package/dist/functions/app/commands/data/remove.js +9 -0
- package/dist/functions/app/commands/data/remove.js.map +1 -0
- package/dist/functions/app/commands/data/render.d.ts +34 -0
- package/dist/functions/app/commands/data/render.js +36 -0
- package/dist/functions/app/commands/data/render.js.map +1 -0
- package/dist/functions/app/commands/data/reset.d.ts +12 -0
- package/dist/functions/app/commands/data/reset.js +15 -0
- package/dist/functions/app/commands/data/reset.js.map +1 -0
- package/dist/functions/app/commands/data/set.d.ts +3 -0
- package/dist/functions/app/commands/data/set.js +9 -0
- package/dist/functions/app/commands/data/set.js.map +1 -0
- package/dist/functions/app/commands/data/update.d.ts +3 -0
- package/dist/functions/app/commands/data/update.js +9 -0
- package/dist/functions/app/commands/data/update.js.map +1 -0
- package/dist/functions/app/commands/data/upsert.d.ts +3 -0
- package/dist/functions/app/commands/data/upsert.js +9 -0
- package/dist/functions/app/commands/data/upsert.js.map +1 -0
- package/dist/functions/app/commands/destroy.d.ts +18 -0
- package/dist/functions/app/commands/destroy.js +55 -0
- package/dist/functions/app/commands/destroy.js.map +1 -0
- package/dist/functions/app/commands/detect-serve.d.ts +34 -0
- package/dist/functions/app/commands/detect-serve.js +169 -0
- package/dist/functions/app/commands/detect-serve.js.map +1 -0
- package/dist/functions/app/commands/fn/_fn-helpers.d.ts +13 -0
- package/dist/functions/app/commands/fn/_fn-helpers.js +11 -0
- package/dist/functions/app/commands/fn/_fn-helpers.js.map +1 -0
- package/dist/functions/app/commands/fn/aggregate.d.ts +11 -0
- package/dist/functions/app/commands/fn/aggregate.js +34 -0
- package/dist/functions/app/commands/fn/aggregate.js.map +1 -0
- package/dist/functions/app/commands/fn/facets.d.ts +15 -0
- package/dist/functions/app/commands/fn/facets.js +35 -0
- package/dist/functions/app/commands/fn/facets.js.map +1 -0
- package/dist/functions/app/commands/fn/group-by.d.ts +10 -0
- package/dist/functions/app/commands/fn/group-by.js +38 -0
- package/dist/functions/app/commands/fn/group-by.js.map +1 -0
- package/dist/functions/app/commands/fn/metadata.d.ts +8 -0
- package/dist/functions/app/commands/fn/metadata.js +13 -0
- package/dist/functions/app/commands/fn/metadata.js.map +1 -0
- package/dist/functions/app/commands/list.d.ts +7 -0
- package/dist/functions/app/commands/list.js +24 -0
- package/dist/functions/app/commands/list.js.map +1 -0
- package/dist/functions/app/commands/loader-hash.d.ts +2 -0
- package/dist/functions/app/commands/loader-hash.js +39 -0
- package/dist/functions/app/commands/loader-hash.js.map +1 -0
- package/dist/functions/app/commands/loaders/add.d.ts +15 -0
- package/dist/functions/app/commands/loaders/add.js +27 -0
- package/dist/functions/app/commands/loaders/add.js.map +1 -0
- package/dist/functions/app/commands/loaders/get.d.ts +12 -0
- package/dist/functions/app/commands/loaders/get.js +16 -0
- package/dist/functions/app/commands/loaders/get.js.map +1 -0
- package/dist/functions/app/commands/loaders/list.d.ts +11 -0
- package/dist/functions/app/commands/loaders/list.js +14 -0
- package/dist/functions/app/commands/loaders/list.js.map +1 -0
- package/dist/functions/app/commands/loaders/process-flags.d.ts +8 -0
- package/dist/functions/app/commands/loaders/process-flags.js +31 -0
- package/dist/functions/app/commands/loaders/process-flags.js.map +1 -0
- package/dist/functions/app/commands/loaders/process.d.ts +14 -0
- package/dist/functions/app/commands/loaders/process.js +23 -0
- package/dist/functions/app/commands/loaders/process.js.map +1 -0
- package/dist/functions/app/commands/loaders/remove.d.ts +12 -0
- package/dist/functions/app/commands/loaders/remove.js +16 -0
- package/dist/functions/app/commands/loaders/remove.js.map +1 -0
- package/dist/functions/app/commands/loaders/resolve-key.d.ts +6 -0
- package/dist/functions/app/commands/loaders/resolve-key.js +26 -0
- package/dist/functions/app/commands/loaders/resolve-key.js.map +1 -0
- package/dist/functions/app/commands/logs.d.ts +10 -0
- package/dist/functions/app/commands/logs.js +25 -0
- package/dist/functions/app/commands/logs.js.map +1 -0
- package/dist/functions/app/commands/models/get.d.ts +11 -0
- package/dist/functions/app/commands/models/get.js +12 -0
- package/dist/functions/app/commands/models/get.js.map +1 -0
- package/dist/functions/app/commands/models/keys.d.ts +10 -0
- package/dist/functions/app/commands/models/keys.js +12 -0
- package/dist/functions/app/commands/models/keys.js.map +1 -0
- package/dist/functions/app/commands/models/remove.d.ts +11 -0
- package/dist/functions/app/commands/models/remove.js +12 -0
- package/dist/functions/app/commands/models/remove.js.map +1 -0
- package/dist/functions/app/commands/models/set.d.ts +12 -0
- package/dist/functions/app/commands/models/set.js +23 -0
- package/dist/functions/app/commands/models/set.js.map +1 -0
- package/dist/functions/app/commands/query/execute.d.ts +19 -0
- package/dist/functions/app/commands/query/execute.js +88 -0
- package/dist/functions/app/commands/query/execute.js.map +1 -0
- package/dist/functions/app/commands/query/one.d.ts +13 -0
- package/dist/functions/app/commands/query/one.js +14 -0
- package/dist/functions/app/commands/query/one.js.map +1 -0
- package/dist/functions/app/commands/query-input.d.ts +1 -0
- package/dist/functions/app/commands/query-input.js +12 -0
- package/dist/functions/app/commands/query-input.js.map +1 -0
- package/dist/functions/app/commands/render.d.ts +44 -0
- package/dist/functions/app/commands/render.js +139 -0
- package/dist/functions/app/commands/render.js.map +1 -0
- package/dist/functions/app/commands/resolve-app.d.ts +12 -0
- package/dist/functions/app/commands/resolve-app.js +34 -0
- package/dist/functions/app/commands/resolve-app.js.map +1 -0
- package/dist/functions/app/commands/resolve-source.d.ts +31 -0
- package/dist/functions/app/commands/resolve-source.js +82 -0
- package/dist/functions/app/commands/resolve-source.js.map +1 -0
- package/dist/functions/app/commands/status.d.ts +12 -0
- package/dist/functions/app/commands/status.js +30 -0
- package/dist/functions/app/commands/status.js.map +1 -0
- package/dist/functions/app/commands/validate-report.d.ts +89 -0
- package/dist/functions/app/commands/validate-report.js +65 -0
- package/dist/functions/app/commands/validate-report.js.map +1 -0
- package/dist/functions/app/commands/validate.d.ts +32 -0
- package/dist/functions/app/commands/validate.js +91 -0
- package/dist/functions/app/commands/validate.js.map +1 -0
- package/dist/functions/app/commands/warn-if-pending.d.ts +3 -0
- package/dist/functions/app/commands/warn-if-pending.js +9 -0
- package/dist/functions/app/commands/warn-if-pending.js.map +1 -0
- package/dist/functions/app/daemon/app-server.module.d.ts +7 -0
- package/dist/functions/app/daemon/app-server.module.js +41 -0
- package/dist/functions/app/daemon/app-server.module.js.map +1 -0
- package/dist/functions/app/daemon/controllers/data.controller.d.ts +94 -0
- package/dist/functions/app/daemon/controllers/data.controller.js +134 -0
- package/dist/functions/app/daemon/controllers/data.controller.js.map +1 -0
- package/dist/functions/app/daemon/controllers/fn.controller.d.ts +21 -0
- package/dist/functions/app/daemon/controllers/fn.controller.js +59 -0
- package/dist/functions/app/daemon/controllers/fn.controller.js.map +1 -0
- package/dist/functions/app/daemon/controllers/lifecycle.controller.d.ts +29 -0
- package/dist/functions/app/daemon/controllers/lifecycle.controller.js +65 -0
- package/dist/functions/app/daemon/controllers/lifecycle.controller.js.map +1 -0
- package/dist/functions/app/daemon/controllers/loaders.controller.d.ts +31 -0
- package/dist/functions/app/daemon/controllers/loaders.controller.js +72 -0
- package/dist/functions/app/daemon/controllers/loaders.controller.js.map +1 -0
- package/dist/functions/app/daemon/controllers/models.controller.d.ts +30 -0
- package/dist/functions/app/daemon/controllers/models.controller.js +80 -0
- package/dist/functions/app/daemon/controllers/models.controller.js.map +1 -0
- package/dist/functions/app/daemon/controllers/query.controller.d.ts +22 -0
- package/dist/functions/app/daemon/controllers/query.controller.js +43 -0
- package/dist/functions/app/daemon/controllers/query.controller.js.map +1 -0
- package/dist/functions/app/daemon/daemon-args.d.ts +13 -0
- package/dist/functions/app/daemon/daemon-args.js +38 -0
- package/dist/functions/app/daemon/daemon-args.js.map +1 -0
- package/dist/functions/app/daemon/filters/envelope-exception.filter.d.ts +4 -0
- package/dist/functions/app/daemon/filters/envelope-exception.filter.js +58 -0
- package/dist/functions/app/daemon/filters/envelope-exception.filter.js.map +1 -0
- package/dist/functions/app/daemon/guards/api-key.guard.d.ts +7 -0
- package/dist/functions/app/daemon/guards/api-key.guard.js +26 -0
- package/dist/functions/app/daemon/guards/api-key.guard.js.map +1 -0
- package/dist/functions/app/daemon/interceptors/pending-changes.interceptor.d.ts +8 -0
- package/dist/functions/app/daemon/interceptors/pending-changes.interceptor.js +25 -0
- package/dist/functions/app/daemon/interceptors/pending-changes.interceptor.js.map +1 -0
- package/dist/functions/app/daemon/main.d.ts +1 -0
- package/dist/functions/app/daemon/main.js +86 -0
- package/dist/functions/app/daemon/main.js.map +1 -0
- package/dist/functions/app/daemon/services/auto-gen.d.ts +7 -0
- package/dist/functions/app/daemon/services/auto-gen.js +18 -0
- package/dist/functions/app/daemon/services/auto-gen.js.map +1 -0
- package/dist/functions/app/daemon/services/dcupl-host.service.d.ts +69 -0
- package/dist/functions/app/daemon/services/dcupl-host.service.js +267 -0
- package/dist/functions/app/daemon/services/dcupl-host.service.js.map +1 -0
- package/dist/functions/app/daemon/services/idle-watchdog.service.d.ts +12 -0
- package/dist/functions/app/daemon/services/idle-watchdog.service.js +38 -0
- package/dist/functions/app/daemon/services/idle-watchdog.service.js.map +1 -0
- package/dist/functions/app/daemon/services/ingest.service.d.ts +12 -0
- package/dist/functions/app/daemon/services/ingest.service.js +126 -0
- package/dist/functions/app/daemon/services/ingest.service.js.map +1 -0
- package/dist/functions/app/daemon/services/init-options.d.ts +16 -0
- package/dist/functions/app/daemon/services/init-options.js +56 -0
- package/dist/functions/app/daemon/services/init-options.js.map +1 -0
- package/dist/functions/app/daemon/services/loaders.service.d.ts +27 -0
- package/dist/functions/app/daemon/services/loaders.service.js +169 -0
- package/dist/functions/app/daemon/services/loaders.service.js.map +1 -0
- package/dist/functions/app/daemon/services/normalize-query.d.ts +11 -0
- package/dist/functions/app/daemon/services/normalize-query.js +29 -0
- package/dist/functions/app/daemon/services/normalize-query.js.map +1 -0
- package/dist/functions/app/e2e/port-lock.d.ts +2 -0
- package/dist/functions/app/e2e/port-lock.js +53 -0
- package/dist/functions/app/e2e/port-lock.js.map +1 -0
- package/dist/functions/app/registry/daemon-log.d.ts +3 -0
- package/dist/functions/app/registry/daemon-log.js +32 -0
- package/dist/functions/app/registry/daemon-log.js.map +1 -0
- package/dist/functions/app/registry/registry.d.ts +15 -0
- package/dist/functions/app/registry/registry.js +111 -0
- package/dist/functions/app/registry/registry.js.map +1 -0
- package/dist/functions/app/registry/serve-registry.d.ts +16 -0
- package/dist/functions/app/registry/serve-registry.js +93 -0
- package/dist/functions/app/registry/serve-registry.js.map +1 -0
- package/dist/functions/app/types.d.ts +124 -0
- package/dist/functions/app/types.js +3 -0
- package/dist/functions/app/types.js.map +1 -0
- package/dist/functions/config/commands/get.d.ts +14 -0
- package/dist/functions/config/commands/get.js +46 -0
- package/dist/functions/config/commands/get.js.map +1 -0
- package/dist/functions/config/commands/set.d.ts +7 -0
- package/dist/functions/config/commands/set.js +66 -0
- package/dist/functions/config/commands/set.js.map +1 -0
- package/dist/functions/config/io.d.ts +6 -0
- package/dist/functions/config/io.js +35 -0
- package/dist/functions/config/io.js.map +1 -0
- package/dist/functions/config/prompts.d.ts +7 -0
- package/dist/functions/config/prompts.js +51 -0
- package/dist/functions/config/prompts.js.map +1 -0
- package/dist/functions/files/commands/copy.d.ts +22 -0
- package/dist/functions/files/commands/copy.js +21 -0
- package/dist/functions/files/commands/copy.js.map +1 -0
- package/dist/functions/files/commands/create-folder.d.ts +19 -0
- package/dist/functions/files/commands/create-folder.js +19 -0
- package/dist/functions/files/commands/create-folder.js.map +1 -0
- package/dist/functions/files/commands/delete.d.ts +21 -0
- package/dist/functions/files/commands/delete.js +37 -0
- package/dist/functions/files/commands/delete.js.map +1 -0
- package/dist/functions/files/commands/list.d.ts +20 -0
- package/dist/functions/files/commands/list.js +29 -0
- package/dist/functions/files/commands/list.js.map +1 -0
- package/dist/functions/files/commands/move.d.ts +24 -0
- package/dist/functions/files/commands/move.js +37 -0
- package/dist/functions/files/commands/move.js.map +1 -0
- package/dist/functions/files/commands/pull.d.ts +31 -0
- package/dist/functions/files/commands/pull.js +132 -0
- package/dist/functions/files/commands/pull.js.map +1 -0
- package/dist/functions/files/commands/push.d.ts +30 -0
- package/dist/functions/files/commands/push.js +116 -0
- package/dist/functions/files/commands/push.js.map +1 -0
- package/dist/functions/files/commands/read.d.ts +19 -0
- package/dist/functions/files/commands/read.js +25 -0
- package/dist/functions/files/commands/read.js.map +1 -0
- package/dist/functions/files/commands/render.d.ts +89 -0
- package/dist/functions/files/commands/render.js +229 -0
- package/dist/functions/files/commands/render.js.map +1 -0
- package/dist/functions/files/commands/status.d.ts +23 -0
- package/dist/functions/files/commands/status.js +58 -0
- package/dist/functions/files/commands/status.js.map +1 -0
- package/dist/functions/files/commands/versions/copy.d.ts +8 -0
- package/dist/functions/files/commands/versions/copy.js +34 -0
- package/dist/functions/files/commands/versions/copy.js.map +1 -0
- package/dist/functions/files/commands/versions/delete.d.ts +7 -0
- package/dist/functions/files/commands/versions/delete.js +35 -0
- package/dist/functions/files/commands/versions/delete.js.map +1 -0
- package/dist/functions/files/commands/versions/list.d.ts +3 -0
- package/dist/functions/files/commands/versions/list.js +10 -0
- package/dist/functions/files/commands/versions/list.js.map +1 -0
- package/dist/functions/files/commands/write.d.ts +24 -0
- package/dist/functions/files/commands/write.js +36 -0
- package/dist/functions/files/commands/write.js.map +1 -0
- package/dist/functions/files/files-pull.d.ts +26 -2
- package/dist/functions/files/files-pull.js +100 -30
- package/dist/functions/files/files-pull.js.map +1 -1
- package/dist/functions/files/files-push.d.ts +3 -1
- package/dist/functions/files/files-push.js +64 -48
- package/dist/functions/files/files-push.js.map +1 -1
- package/dist/functions/files/helper/confirm.d.ts +5 -0
- package/dist/functions/files/helper/confirm.js +14 -0
- package/dist/functions/files/helper/confirm.js.map +1 -0
- package/dist/functions/files/helper/resolve-version.d.ts +5 -0
- package/dist/functions/files/helper/resolve-version.js +15 -0
- package/dist/functions/files/helper/resolve-version.js.map +1 -0
- package/dist/functions/files/sync/baseline-derive.d.ts +3 -0
- package/dist/functions/files/sync/baseline-derive.js +49 -0
- package/dist/functions/files/sync/baseline-derive.js.map +1 -0
- package/dist/functions/files/sync/diff.d.ts +9 -0
- package/dist/functions/files/sync/diff.js +80 -0
- package/dist/functions/files/sync/diff.js.map +1 -0
- package/dist/functions/files/sync/manifest.d.ts +12 -0
- package/dist/functions/files/sync/manifest.js +74 -0
- package/dist/functions/files/sync/manifest.js.map +1 -0
- package/dist/functions/files/sync/scope.d.ts +4 -0
- package/dist/functions/files/sync/scope.js +44 -0
- package/dist/functions/files/sync/scope.js.map +1 -0
- package/dist/functions/files/sync/state.d.ts +8 -0
- package/dist/functions/files/sync/state.js +74 -0
- package/dist/functions/files/sync/state.js.map +1 -0
- package/dist/functions/files/sync/transfer.d.ts +47 -0
- package/dist/functions/files/sync/transfer.js +132 -0
- package/dist/functions/files/sync/transfer.js.map +1 -0
- package/dist/functions/files/sync/types.d.ts +41 -0
- package/dist/functions/files/sync/types.js +3 -0
- package/dist/functions/files/sync/types.js.map +1 -0
- package/dist/functions/files/test-helpers.d.ts +13 -0
- package/dist/functions/files/test-helpers.js +34 -0
- package/dist/functions/files/test-helpers.js.map +1 -0
- package/dist/functions/generate/files/generate-code.d.ts +3 -1
- package/dist/functions/generate/files/generate-code.js +2 -0
- package/dist/functions/generate/files/generate-code.js.map +1 -1
- package/dist/functions/generate/files/generate-files.d.ts +12 -2
- package/dist/functions/generate/files/generate-files.js +155 -224
- package/dist/functions/generate/files/generate-files.js.map +1 -1
- package/dist/functions/generate/files/generate.helper.d.ts +2 -2
- package/dist/functions/generate/files/generate.helper.js +5 -7
- package/dist/functions/generate/files/generate.helper.js.map +1 -1
- package/dist/functions/generate/model-from-data/generate-model-from-data.d.ts +10 -0
- package/dist/functions/generate/model-from-data/generate-model-from-data.js +184 -0
- package/dist/functions/generate/model-from-data/generate-model-from-data.js.map +1 -0
- package/dist/functions/generate/model-from-data/infer-key.d.ts +19 -0
- package/dist/functions/generate/model-from-data/infer-key.js +54 -0
- package/dist/functions/generate/model-from-data/infer-key.js.map +1 -0
- package/dist/functions/generate/model-from-data/infer-to-model.d.ts +6 -0
- package/dist/functions/generate/model-from-data/infer-to-model.js +59 -0
- package/dist/functions/generate/model-from-data/infer-to-model.js.map +1 -0
- package/dist/functions/generate/projects/generate-project.d.ts +12 -1
- package/dist/functions/generate/projects/generate-project.js +338 -65
- package/dist/functions/generate/projects/generate-project.js.map +1 -1
- package/dist/functions/helper/api-client.d.ts +18 -0
- package/dist/functions/helper/api-client.js +88 -0
- package/dist/functions/helper/api-client.js.map +1 -0
- package/dist/functions/helper/config.helper.d.ts +16 -2
- package/dist/functions/helper/config.helper.js +25 -4
- package/dist/functions/helper/config.helper.js.map +1 -1
- package/dist/functions/helper/output.d.ts +9 -0
- package/dist/functions/helper/output.js +71 -0
- package/dist/functions/helper/output.js.map +1 -0
- package/dist/functions/helper/parse-fail.d.ts +11 -0
- package/dist/functions/helper/parse-fail.js +106 -0
- package/dist/functions/helper/parse-fail.js.map +1 -0
- package/dist/functions/schemas/command.d.ts +21 -0
- package/dist/functions/schemas/command.js +57 -0
- package/dist/functions/schemas/command.js.map +1 -0
- package/dist/functions/schemas/examples/AppLoaderConfiguration.example.json +18 -0
- package/dist/functions/schemas/examples/DataMapperStepConfig.example.json +1 -0
- package/dist/functions/schemas/examples/ModelDefinition.example.json +21 -0
- package/dist/functions/schemas/examples/RequestStepConfig.example.json +1 -0
- package/dist/functions/schemas/examples/ResponseScriptConfig.example.json +1 -0
- package/dist/functions/schemas/examples/ScriptStepConfig.example.json +1 -0
- package/dist/functions/schemas/examples/TemplateV3.example.json +62 -0
- package/dist/functions/schemas/examples/TriggerRequestConfig.example.json +1 -0
- package/dist/functions/schemas/examples/WorkflowConfigV3.example.json +53 -0
- package/dist/functions/schemas/extract.d.ts +2 -0
- package/dist/functions/schemas/extract.js +68 -0
- package/dist/functions/schemas/extract.js.map +1 -0
- package/dist/functions/schemas/format.d.ts +8 -0
- package/dist/functions/schemas/format.js +53 -0
- package/dist/functions/schemas/format.js.map +1 -0
- package/dist/functions/schemas/registry.d.ts +15 -0
- package/dist/functions/schemas/registry.js +179 -0
- package/dist/functions/schemas/registry.js.map +1 -0
- package/dist/functions/schemas/resolve.d.ts +10 -0
- package/dist/functions/schemas/resolve.js +28 -0
- package/dist/functions/schemas/resolve.js.map +1 -0
- package/dist/functions/serve/commands/list.d.ts +9 -0
- package/dist/functions/serve/commands/list.js +44 -0
- package/dist/functions/serve/commands/list.js.map +1 -0
- package/dist/functions/serve/commands/stop.d.ts +11 -0
- package/dist/functions/serve/commands/stop.js +34 -0
- package/dist/functions/serve/commands/stop.js.map +1 -0
- package/dist/functions/serve/dev-server/dev-server.controller.d.ts +12 -8
- package/dist/functions/serve/dev-server/dev-server.controller.js +20 -10
- package/dist/functions/serve/dev-server/dev-server.controller.js.map +1 -1
- package/dist/functions/serve/dev-server/dev-server.module.js +2 -2
- package/dist/functions/serve/dev-server/dev-server.module.js.map +1 -1
- package/dist/functions/serve/dev-server/dev-server.service.d.ts +9 -7
- package/dist/functions/serve/dev-server/dev-server.service.js +35 -23
- package/dist/functions/serve/dev-server/dev-server.service.js.map +1 -1
- package/dist/functions/serve/main.d.ts +1 -0
- package/dist/functions/serve/main.js +37 -15
- package/dist/functions/serve/main.js.map +1 -1
- package/dist/functions/serve/serve-self-register.d.ts +9 -0
- package/dist/functions/serve/serve-self-register.js +30 -0
- package/dist/functions/serve/serve-self-register.js.map +1 -0
- package/dist/functions/testing/testing-helper.d.ts +1 -1
- package/dist/functions/testing/testing-helper.js.map +1 -1
- package/dist/functions/testing/testing.d.ts +2 -1
- package/dist/functions/testing/testing.js +7 -6
- package/dist/functions/testing/testing.js.map +1 -1
- package/dist/functions/version/command.d.ts +17 -0
- package/dist/functions/version/command.js +54 -0
- package/dist/functions/version/command.js.map +1 -0
- package/dist/functions/welcome.js.map +1 -1
- package/dist/functions/workflow/commands/deploy.d.ts +29 -0
- package/dist/functions/workflow/commands/deploy.js +54 -0
- package/dist/functions/workflow/commands/deploy.js.map +1 -0
- package/dist/functions/workflow/commands/get.d.ts +10 -0
- package/dist/functions/workflow/commands/get.js +10 -0
- package/dist/functions/workflow/commands/get.js.map +1 -0
- package/dist/functions/workflow/commands/history.d.ts +10 -0
- package/dist/functions/workflow/commands/history.js +25 -0
- package/dist/functions/workflow/commands/history.js.map +1 -0
- package/dist/functions/workflow/commands/list.d.ts +7 -0
- package/dist/functions/workflow/commands/list.js +11 -0
- package/dist/functions/workflow/commands/list.js.map +1 -0
- package/dist/functions/workflow/commands/runners-get.d.ts +10 -0
- package/dist/functions/workflow/commands/runners-get.js +10 -0
- package/dist/functions/workflow/commands/runners-get.js.map +1 -0
- package/dist/functions/workflow/commands/runners.d.ts +7 -0
- package/dist/functions/workflow/commands/runners.js +11 -0
- package/dist/functions/workflow/commands/runners.js.map +1 -0
- package/dist/functions/workflow/commands/status.d.ts +10 -0
- package/dist/functions/workflow/commands/status.js +10 -0
- package/dist/functions/workflow/commands/status.js.map +1 -0
- package/dist/functions/workflow/commands/template.d.ts +9 -0
- package/dist/functions/workflow/commands/template.js +10 -0
- package/dist/functions/workflow/commands/template.js.map +1 -0
- package/dist/functions/workflow/commands/test.d.ts +36 -0
- package/dist/functions/workflow/commands/test.js +158 -0
- package/dist/functions/workflow/commands/test.js.map +1 -0
- package/dist/functions/workflow/commands/trace.d.ts +11 -0
- package/dist/functions/workflow/commands/trace.js +24 -0
- package/dist/functions/workflow/commands/trace.js.map +1 -0
- package/dist/functions/workflow/commands/undeploy.d.ts +13 -0
- package/dist/functions/workflow/commands/undeploy.js +17 -0
- package/dist/functions/workflow/commands/undeploy.js.map +1 -0
- package/dist/functions/workflow/commands/validate.d.ts +18 -0
- package/dist/functions/workflow/commands/validate.js +35 -0
- package/dist/functions/workflow/commands/validate.js.map +1 -0
- package/dist/functions/workflow/template-io.d.ts +2 -0
- package/dist/functions/workflow/template-io.js +25 -0
- package/dist/functions/workflow/template-io.js.map +1 -0
- package/dist/functions/workflow/trace.d.ts +20 -0
- package/dist/functions/workflow/trace.js +82 -0
- package/dist/functions/workflow/trace.js.map +1 -0
- package/dist/functions/workflow/types.d.ts +27 -0
- package/dist/functions/workflow/types.js +3 -0
- package/dist/functions/workflow/types.js.map +1 -0
- package/dist/functions/workflow/validate.d.ts +2 -0
- package/dist/functions/workflow/validate.js +37 -0
- package/dist/functions/workflow/validate.js.map +1 -0
- package/dist/functions/workflow/wait-for-swap.d.ts +27 -0
- package/dist/functions/workflow/wait-for-swap.js +33 -0
- package/dist/functions/workflow/wait-for-swap.js.map +1 -0
- package/dist/functions/workflow/workflow-api.d.ts +27 -0
- package/dist/functions/workflow/workflow-api.js +68 -0
- package/dist/functions/workflow/workflow-api.js.map +1 -0
- package/dist/index.js +9 -102
- package/dist/index.js.map +1 -1
- package/files/common/dcupl.config.json +3 -2
- package/files/common/readme.md +5 -2
- package/files/dev-server/index.html +108 -14
- package/files/starters/starter_empty/dcupl/api/.gitkeep +0 -0
- package/files/starters/starter_empty/dcupl/data/.gitkeep +0 -0
- package/files/starters/starter_empty/dcupl/dcupl.lc.json +10 -0
- package/files/starters/starter_empty/dcupl/models/.gitkeep +0 -0
- package/files/starters/starter_empty/dcupl/workflows/.gitkeep +0 -0
- package/files/starters/starter_empty/dcupl.config.json +11 -0
- package/files/starters/starter_empty/package.json +14 -0
- package/package.json +60 -36
- package/dist/functions/files/files-copy.d.ts +0 -5
- package/dist/functions/files/files-copy.js +0 -43
- package/dist/functions/files/files-copy.js.map +0 -1
- package/dist/functions/files/files-list-versions.d.ts +0 -2
- package/dist/functions/files/files-list-versions.js +0 -39
- package/dist/functions/files/files-list-versions.js.map +0 -1
- package/dist/functions/start-dcupl/start-dcupl.d.ts +0 -7
- package/dist/functions/start-dcupl/start-dcupl.js +0 -51
- package/dist/functions/start-dcupl/start-dcupl.js.map +0 -1
- package/dist/functions/testing/tests/generated-completeness.spec.d.ts +0 -1
- package/dist/functions/testing/tests/generated-completeness.spec.js +0 -143
- package/dist/functions/testing/tests/generated-completeness.spec.js.map +0 -1
- package/dist/functions/testing/tests/model_tests.spec.d.ts +0 -1
- package/dist/functions/testing/tests/model_tests.spec.js +0 -92
- package/dist/functions/testing/tests/model_tests.spec.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployCommand = deployCommand;
|
|
4
|
+
const template_io_js_1 = require("../template-io.js");
|
|
5
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
6
|
+
const confirm_js_1 = require("../../files/helper/confirm.js");
|
|
7
|
+
const wait_for_swap_js_1 = require("../wait-for-swap.js");
|
|
8
|
+
async function deployCommand(output, client, opts, deps = {}) {
|
|
9
|
+
const load = deps.loadTemplate ?? template_io_js_1.loadTemplate;
|
|
10
|
+
const validate = deps.validateRemote ?? workflow_api_js_1.validateRemote;
|
|
11
|
+
const doDeploy = deps.deploy ?? workflow_api_js_1.deploy;
|
|
12
|
+
const confirm = deps.confirm ?? confirm_js_1.confirmDestructive;
|
|
13
|
+
const wait = deps.waitForSwap ?? wait_for_swap_js_1.waitForSwap;
|
|
14
|
+
const template = load(opts.file);
|
|
15
|
+
const result = await validate(client, { runnerUid: opts.runner, template });
|
|
16
|
+
if (!result.valid) {
|
|
17
|
+
const summary = (result.errors ?? []).map((e) => `✗ ${e.type}: ${e.message}`).join('\n');
|
|
18
|
+
output.error(summary, 'WORKFLOW_INVALID');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const decision = await confirm(`Deploy workflow "${template.key}" to runner ${opts.runner}? This goes live immediately.`, { yes: !!opts.yes });
|
|
22
|
+
if (decision !== 'execute') {
|
|
23
|
+
output.error('Deploy aborted (not confirmed).', 'WORKFLOW_DEPLOY_ABORTED');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const deployed = await doDeploy(client, [{ runnerUid: opts.runner, template }]);
|
|
27
|
+
const head = deployed[0];
|
|
28
|
+
if (!head) {
|
|
29
|
+
output.error('Deploy returned no workflow; check the runner uid.', 'DEPLOY_EMPTY_RESPONSE');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
let liveNote = '';
|
|
33
|
+
if (opts.wait !== false) {
|
|
34
|
+
const swap = await wait(client, head.uid, head.v, {}, { timeoutMs: opts.swapTimeout });
|
|
35
|
+
if (swap.outcome === 'error') {
|
|
36
|
+
output.error(`runner reported an error during swap: ${swap.message}`, 'WORKFLOW_SWAP_ERROR');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (swap.outcome === 'timeout') {
|
|
40
|
+
const secs = (opts.swapTimeout ?? wait_for_swap_js_1.DEFAULT_SWAP_TIMEOUT_MS) / 1000;
|
|
41
|
+
output.error(`swap not confirmed after ${secs}s; deployed v=${swap.deployedV}, runner still serving v=${swap.liveV ?? 'unknown'}`, 'WORKFLOW_SWAP_TIMEOUT');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (swap.outcome === 'skipped') {
|
|
45
|
+
output.warn('runner does not report a live version — skipping swap confirmation');
|
|
46
|
+
liveNote = ' — live ?';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
liveNote = ' — live ✓';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
output.success(deployed, () => deployed.map((d) => `✓ deployed ${d.key} (uid ${d.uid}, v ${d.v})${liveNote}`).join('\n'));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/deploy.ts"],"names":[],"mappings":";;AAwBA,sCAyDC;AA9ED,sDAAgE;AAChE,wDAAsG;AACtG,8DAAmE;AACnE,0DAAkH;AAkB3G,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAmB,EAAE,OAAmB,EAAE;IAC/G,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,IAAI,6BAAW,CAAC;IAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,IAAI,gCAAqB,CAAC;IAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,IAAI,wBAAa,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,+BAAkB,CAAC;IACnD,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,IAAI,8BAAkB,CAAC;IAEpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5E,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAA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ACT,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,0CAAuB,CAAC,GAAG,IAAI,CAAC;YAClE,MAAM,CAAC,KAAK,CACV,4BAA4B,IAAI,iBAAiB,IAAI,CAAC,SAAS,4BAA4B,IAAI,CAAC,KAAK,IAAI,SAAS,EAAE,EACpH,uBAAuB,CACxB,CAAC;YACF,OAAO;QACT,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;YAClF,QAAQ,GAAG,WAAW,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,WAAW,CAAC;QACzB,CAAC;IACH,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5H,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { DeployedWorkflowV3 } from '../types.js';
|
|
4
|
+
export interface GetOptions {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GetDeps {
|
|
8
|
+
getWorkflow?: (client: ApiClient, id: string) => Promise<DeployedWorkflowV3>;
|
|
9
|
+
}
|
|
10
|
+
export declare function getCommand(output: Output, client: ApiClient, opts: GetOptions, deps?: GetDeps): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCommand = getCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function getCommand(output, client, opts, deps = {}) {
|
|
6
|
+
const get = deps.getWorkflow ?? workflow_api_js_1.getWorkflow;
|
|
7
|
+
const workflow = await get(client, opts.id);
|
|
8
|
+
output.success(workflow);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/get.ts"],"names":[],"mappings":";;AAaA,gCAIC;AAdD,wDAAuE;AAUhE,KAAK,UAAU,UAAU,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAgB,EAAE,OAAgB,EAAE;IACtG,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,IAAI,6BAAkB,CAAC;IACnD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { WorkflowHistoryResponse } from '../types.js';
|
|
4
|
+
export interface HistoryOptions {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HistoryDeps {
|
|
8
|
+
getHistory?: (client: ApiClient, id: string) => Promise<WorkflowHistoryResponse>;
|
|
9
|
+
}
|
|
10
|
+
export declare function historyCommand(output: Output, client: ApiClient, opts: HistoryOptions, deps?: HistoryDeps): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.historyCommand = historyCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function historyCommand(output, client, opts, deps = {}) {
|
|
6
|
+
const get = deps.getHistory ?? workflow_api_js_1.getHistory;
|
|
7
|
+
const history = await get(client, opts.id);
|
|
8
|
+
if (output.isJson()) {
|
|
9
|
+
output.success(history);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const rows = (history.executions ?? []).map((e) => ({
|
|
13
|
+
executionId: e.executionId,
|
|
14
|
+
status: e.status,
|
|
15
|
+
startedAt: e.startedAt ? new Date(e.startedAt).toISOString() : '',
|
|
16
|
+
durationMs: e.duration ?? '',
|
|
17
|
+
error: e.error?.message ?? '',
|
|
18
|
+
}));
|
|
19
|
+
if (rows.length === 0) {
|
|
20
|
+
output.success(rows, () => 'No executions yet.');
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
output.success(rows);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/history.ts"],"names":[],"mappings":";;AAaA,wCAqBC;AA/BD,wDAAqE;AAU9D,KAAK,UAAU,cAAc,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAoB,EAAE,OAAoB,EAAE;IAClH,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,IAAI,4BAAiB,CAAC;IACjD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAG3C,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO;IACT,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAClD,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;QACjE,UAAU,EAAE,CAAC,CAAC,QAAQ,IAAI,EAAE;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE;KAC9B,CAAC,CAAC,CAAC;IACJ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,CAAC;QACjD,OAAO;IACT,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { DeployedWorkflowV3 } from '../types.js';
|
|
4
|
+
export interface ListDeps {
|
|
5
|
+
listWorkflows?: (client: ApiClient) => Promise<DeployedWorkflowV3[]>;
|
|
6
|
+
}
|
|
7
|
+
export declare function listCommand(output: Output, client: ApiClient, deps?: ListDeps): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listCommand = listCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function listCommand(output, client, deps = {}) {
|
|
6
|
+
const list = deps.listWorkflows ?? workflow_api_js_1.listWorkflows;
|
|
7
|
+
const workflows = await list(client);
|
|
8
|
+
const rows = workflows.map((w) => ({ uid: w.uid, key: w.key, runnerUid: w.runnerUid, version: w.version }));
|
|
9
|
+
output.success(rows);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/list.ts"],"names":[],"mappings":";;AASA,kCAKC;AAXD,wDAA2E;AAMpE,KAAK,UAAU,WAAW,CAAC,MAAc,EAAE,MAAiB,EAAE,OAAiB,EAAE;IACtF,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,IAAI,+BAAoB,CAAC;IACxD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC5G,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { RunnerInfo } from '../types.js';
|
|
4
|
+
export interface RunnerGetOptions {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RunnerGetDeps {
|
|
8
|
+
getRunner?: (client: ApiClient, uid: string) => Promise<RunnerInfo>;
|
|
9
|
+
}
|
|
10
|
+
export declare function runnerGetCommand(output: Output, client: ApiClient, opts: RunnerGetOptions, deps?: RunnerGetDeps): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runnerGetCommand = runnerGetCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function runnerGetCommand(output, client, opts, deps = {}) {
|
|
6
|
+
const get = deps.getRunner ?? workflow_api_js_1.getRunner;
|
|
7
|
+
const runner = await get(client, opts.id);
|
|
8
|
+
output.success(runner);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=runners-get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runners-get.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/runners-get.ts"],"names":[],"mappings":";;AAaA,4CAIC;AAdD,wDAAmE;AAU5D,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAsB,EAAE,OAAsB,EAAE;IACxH,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,IAAI,2BAAgB,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { RunnerInfo } from '../types.js';
|
|
4
|
+
export interface RunnersDeps {
|
|
5
|
+
listRunners?: (client: ApiClient) => Promise<RunnerInfo[]>;
|
|
6
|
+
}
|
|
7
|
+
export declare function runnersCommand(output: Output, client: ApiClient, deps?: RunnersDeps): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runnersCommand = runnersCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function runnersCommand(output, client, deps = {}) {
|
|
6
|
+
const list = deps.listRunners ?? workflow_api_js_1.listRunners;
|
|
7
|
+
const runners = await list(client);
|
|
8
|
+
const rows = runners.map((r) => ({ uid: r.uid, runnerKey: r.runnerKey, type: r.type, url: r.url }));
|
|
9
|
+
output.success(rows);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=runners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runners.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/runners.ts"],"names":[],"mappings":";;AASA,wCAKC;AAXD,wDAAuE;AAMhE,KAAK,UAAU,cAAc,CAAC,MAAc,EAAE,MAAiB,EAAE,OAAoB,EAAE;IAC5F,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,IAAI,6BAAkB,CAAC;IACpD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACpG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { WorkflowStatusResponse } from '../types.js';
|
|
4
|
+
export interface StatusOptions {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface StatusDeps {
|
|
8
|
+
getStatus?: (client: ApiClient, id: string) => Promise<WorkflowStatusResponse>;
|
|
9
|
+
}
|
|
10
|
+
export declare function statusCommand(output: Output, client: ApiClient, opts: StatusOptions, deps?: StatusDeps): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusCommand = statusCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function statusCommand(output, client, opts, deps = {}) {
|
|
6
|
+
const get = deps.getStatus ?? workflow_api_js_1.getStatus;
|
|
7
|
+
const status = await get(client, opts.id);
|
|
8
|
+
output.success(status, (s) => `${s.key}: ${s.status}${s.error ? ` — ${s.error}` : ''}`);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/status.ts"],"names":[],"mappings":";;AAaA,sCAIC;AAdD,wDAAmE;AAU5D,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAmB,EAAE,OAAmB,EAAE;IAC/G,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,IAAI,2BAAgB,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
export interface TemplateOptions {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TemplateDeps {
|
|
7
|
+
getDeployedTemplate?: (client: ApiClient, id: string) => Promise<unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare function templateCommand(output: Output, client: ApiClient, opts: TemplateOptions, deps?: TemplateDeps): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.templateCommand = templateCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function templateCommand(output, client, opts, deps = {}) {
|
|
6
|
+
const get = deps.getDeployedTemplate ?? workflow_api_js_1.getDeployedTemplate;
|
|
7
|
+
const template = await get(client, opts.id);
|
|
8
|
+
output.success(template);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/template.ts"],"names":[],"mappings":";;AAYA,0CAIC;AAdD,wDAAuF;AAUhF,KAAK,UAAU,eAAe,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAqB,EAAE,OAAqB,EAAE;IACrH,MAAM,GAAG,GAAG,IAAI,CAAC,mBAAmB,IAAI,qCAA0B,CAAC;IACnE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { DeployedWorkflow, RunnerInfo, TemplateV3, ValidationResult } from '../types.js';
|
|
4
|
+
import { type SwapResult } from '../wait-for-swap.js';
|
|
5
|
+
export interface TestOptions {
|
|
6
|
+
file: string;
|
|
7
|
+
runner: string;
|
|
8
|
+
node?: string;
|
|
9
|
+
input?: string;
|
|
10
|
+
state?: string;
|
|
11
|
+
triggerKey?: string;
|
|
12
|
+
wait?: boolean;
|
|
13
|
+
swapTimeout?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface TestDeps {
|
|
16
|
+
loadTemplate?: (file: string) => TemplateV3;
|
|
17
|
+
validateLocal?: (t: TemplateV3) => ValidationResult;
|
|
18
|
+
listRunners?: (client: ApiClient) => Promise<RunnerInfo[]>;
|
|
19
|
+
deploy?: (client: ApiClient, items: {
|
|
20
|
+
runnerUid: string;
|
|
21
|
+
template: TemplateV3;
|
|
22
|
+
}[]) => Promise<DeployedWorkflow[]>;
|
|
23
|
+
testNode?: (client: ApiClient, workflowId: string, nodeId: string, body: unknown) => Promise<unknown>;
|
|
24
|
+
triggerRun?: (args: {
|
|
25
|
+
runnerUrl: string;
|
|
26
|
+
key: string;
|
|
27
|
+
triggerPath: string;
|
|
28
|
+
method: string;
|
|
29
|
+
body?: unknown;
|
|
30
|
+
triggerKey?: string;
|
|
31
|
+
}) => Promise<unknown>;
|
|
32
|
+
waitForSwap?: (client: ApiClient, id: string, deployedV: string, deps?: object, opts?: {
|
|
33
|
+
timeoutMs?: number;
|
|
34
|
+
}) => Promise<SwapResult>;
|
|
35
|
+
}
|
|
36
|
+
export declare function testCommand(output: Output, client: ApiClient, opts: TestOptions, deps?: TestDeps): Promise<void>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testCommand = testCommand;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const comment_json_1 = require("comment-json");
|
|
7
|
+
const template_io_js_1 = require("../template-io.js");
|
|
8
|
+
const validate_js_1 = require("../validate.js");
|
|
9
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
10
|
+
const trace_js_1 = require("../trace.js");
|
|
11
|
+
const wait_for_swap_js_1 = require("../wait-for-swap.js");
|
|
12
|
+
function readJson(file) {
|
|
13
|
+
if (!file)
|
|
14
|
+
return undefined;
|
|
15
|
+
return (0, comment_json_1.parse)(fs.readFileSync(file, 'utf-8'));
|
|
16
|
+
}
|
|
17
|
+
function errorBody(err) {
|
|
18
|
+
const e = err;
|
|
19
|
+
return e.response?.data ?? e.responseData;
|
|
20
|
+
}
|
|
21
|
+
function errorStatus(err) {
|
|
22
|
+
const e = err;
|
|
23
|
+
return e.response?.status ?? e.statusCode;
|
|
24
|
+
}
|
|
25
|
+
function errorMessage(err) {
|
|
26
|
+
return err.message ?? String(err);
|
|
27
|
+
}
|
|
28
|
+
function nodeTypeById(template, nodeId) {
|
|
29
|
+
if (!nodeId)
|
|
30
|
+
return undefined;
|
|
31
|
+
const nodes = (template.config?.nodes ?? []);
|
|
32
|
+
return nodes.find((n) => n.id === nodeId)?.type;
|
|
33
|
+
}
|
|
34
|
+
function hasFilesNode(template) {
|
|
35
|
+
const nodes = (template.config?.nodes ?? []);
|
|
36
|
+
return nodes.some((n) => n.type === 'dcupl-files');
|
|
37
|
+
}
|
|
38
|
+
function looks403(status, runError) {
|
|
39
|
+
if (status === 403)
|
|
40
|
+
return true;
|
|
41
|
+
const hay = `${runError?.message ?? ''} ${runError?.errorType ?? ''} ${runError?.detail ?? ''}`.toLowerCase();
|
|
42
|
+
return /\b403\b|forbidden|unauthor/.test(hay);
|
|
43
|
+
}
|
|
44
|
+
const FILES_AUTH_HINT = 'dcupl-files auth failed (403) — check auth.apiKey (the project workflow api-key UUID)';
|
|
45
|
+
function filesAuthHint(template, status, runError, reachedRun) {
|
|
46
|
+
if (!looks403(status, runError))
|
|
47
|
+
return undefined;
|
|
48
|
+
if (nodeTypeById(template, runError?.nodeId) === 'dcupl-files')
|
|
49
|
+
return FILES_AUTH_HINT;
|
|
50
|
+
if (reachedRun && !runError?.nodeId && hasFilesNode(template))
|
|
51
|
+
return FILES_AUTH_HINT;
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
async function testCommand(output, client, opts, deps = {}) {
|
|
55
|
+
const load = deps.loadTemplate ?? template_io_js_1.loadTemplate;
|
|
56
|
+
const validateLocal = deps.validateLocal ?? validate_js_1.validateLocal;
|
|
57
|
+
const listRunners = deps.listRunners ?? workflow_api_js_1.listRunners;
|
|
58
|
+
const doDeploy = deps.deploy ?? workflow_api_js_1.deploy;
|
|
59
|
+
const doTestNode = deps.testNode ?? workflow_api_js_1.testNode;
|
|
60
|
+
const doTrigger = deps.triggerRun ?? workflow_api_js_1.triggerRun;
|
|
61
|
+
const wait = deps.waitForSwap ?? wait_for_swap_js_1.waitForSwap;
|
|
62
|
+
const template = load(opts.file);
|
|
63
|
+
const local = validateLocal(template);
|
|
64
|
+
if (!local.valid) {
|
|
65
|
+
const summary = local.errors.map((e) => `✗ ${e.type}: ${e.message}`).join('\n');
|
|
66
|
+
output.error(summary, 'WORKFLOW_INVALID');
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
let reachedRun = false;
|
|
70
|
+
try {
|
|
71
|
+
const deployedList = await doDeploy(client, [{ runnerUid: opts.runner, template }]);
|
|
72
|
+
const deployed = deployedList[0];
|
|
73
|
+
if (!deployed) {
|
|
74
|
+
output.error('Deploy returned no workflow; check the runner uid.', 'DEPLOY_EMPTY_RESPONSE');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (opts.wait !== false) {
|
|
78
|
+
const swap = await wait(client, deployed.uid, deployed.v, {}, { timeoutMs: opts.swapTimeout });
|
|
79
|
+
if (swap.outcome === 'error') {
|
|
80
|
+
output.error(`runner reported an error during swap: ${swap.message}`, 'WORKFLOW_SWAP_ERROR');
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (swap.outcome === 'timeout') {
|
|
84
|
+
const secs = (opts.swapTimeout ?? wait_for_swap_js_1.DEFAULT_SWAP_TIMEOUT_MS) / 1000;
|
|
85
|
+
output.error(`swap not confirmed after ${secs}s; deployed v=${swap.deployedV}, runner still serving v=${swap.liveV ?? 'unknown'}`, 'WORKFLOW_SWAP_TIMEOUT');
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (swap.outcome === 'skipped') {
|
|
89
|
+
output.warn('runner does not report a live version — proceeding without swap confirmation');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
let raw;
|
|
93
|
+
reachedRun = true;
|
|
94
|
+
if (opts.node) {
|
|
95
|
+
const inputData = readJson(opts.input) ?? { main: [] };
|
|
96
|
+
const state = readJson(opts.state);
|
|
97
|
+
const body = { inputData, ...(state ? { state } : {}) };
|
|
98
|
+
raw = await doTestNode(client, deployed.uid, opts.node, body);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const runners = await listRunners(client);
|
|
102
|
+
const runner = runners.find((r) => r.uid === opts.runner);
|
|
103
|
+
if (!runner) {
|
|
104
|
+
output.error(`Runner ${opts.runner} not found for this project.`, 'RUNNER_NOT_FOUND');
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const trigger = template.config.nodes.find((n) => n.type === 'trigger-request');
|
|
108
|
+
if (!trigger) {
|
|
109
|
+
output.error('No trigger-request node found; cannot run the full workflow.', 'NO_REQUEST_TRIGGER');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const method = (trigger.config.methods?.[0] ?? 'POST');
|
|
113
|
+
raw = await doTrigger({
|
|
114
|
+
runnerUrl: runner.url,
|
|
115
|
+
key: deployed.key,
|
|
116
|
+
triggerPath: trigger.config.path,
|
|
117
|
+
method,
|
|
118
|
+
body: readJson(opts.input),
|
|
119
|
+
triggerKey: opts.triggerKey,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const trace = (0, trace_js_1.toTrace)(raw);
|
|
123
|
+
output.success(trace, () => (0, trace_js_1.renderTrace)(trace));
|
|
124
|
+
if ((0, trace_js_1.hasErrors)(trace)) {
|
|
125
|
+
output.error('Workflow run reported node errors (see trace above).', 'WORKFLOW_RUN_ERROR');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
const body = errorBody(err);
|
|
130
|
+
const status = errorStatus(err);
|
|
131
|
+
const trace = (0, trace_js_1.toTrace)(body);
|
|
132
|
+
if (Object.keys(trace.nodes ?? {}).length > 0 || trace.status === 'failed') {
|
|
133
|
+
output.success(trace, () => (0, trace_js_1.renderTrace)(trace));
|
|
134
|
+
output.error('Workflow run failed on the runner (see trace above).', 'WORKFLOW_RUN_ERROR');
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const runError = (0, trace_js_1.toRunError)(body);
|
|
138
|
+
if (runError) {
|
|
139
|
+
output.success(runError, () => (0, trace_js_1.renderRunError)(runError));
|
|
140
|
+
const hint = filesAuthHint(template, status, runError, reachedRun);
|
|
141
|
+
if (hint) {
|
|
142
|
+
output.error(hint, 'WORKFLOW_FILES_AUTH');
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const where = runError.nodeId ? ` @ nodeId: ${runError.nodeId}` : '';
|
|
146
|
+
output.error(`${runError.message}${where}`, 'WORKFLOW_RUN_ERROR');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const hint = filesAuthHint(template, status, undefined, reachedRun);
|
|
150
|
+
if (hint) {
|
|
151
|
+
output.error(hint, 'WORKFLOW_FILES_AUTH');
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const suffix = status ? ` (HTTP ${status})` : '';
|
|
155
|
+
output.error(`${errorMessage(err)}${suffix}`, 'WORKFLOW_TEST_FAILED');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/test.ts"],"names":[],"mappings":";;AA6FA,kCA2HC;;AAxND,+CAAyB;AACzB,+CAAqC;AAIrC,sDAAgE;AAChE,gDAAuE;AACvE,wDAK4B;AAC5B,0CAA6H;AAC7H,0DAAkH;AAuBlH,SAAS,QAAQ,CAAC,IAAa;IAC7B,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,IAAA,oBAAK,EAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,O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AAE,EAAE,sBAAsB,CAAC,CAAC;IACxE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { GraphStateResponse } from '../types.js';
|
|
4
|
+
export interface TraceOptions {
|
|
5
|
+
id: string;
|
|
6
|
+
run: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TraceDeps {
|
|
9
|
+
getGraphState?: (client: ApiClient, id: string, runId: string) => Promise<GraphStateResponse>;
|
|
10
|
+
}
|
|
11
|
+
export declare function traceCommand(output: Output, client: ApiClient, opts: TraceOptions, deps?: TraceDeps): Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.traceCommand = traceCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
async function traceCommand(output, client, opts, deps = {}) {
|
|
6
|
+
const get = deps.getGraphState ?? workflow_api_js_1.getGraphState;
|
|
7
|
+
const state = await get(client, opts.id, opts.run);
|
|
8
|
+
if (output.isJson()) {
|
|
9
|
+
output.success(state);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const rows = Object.entries(state.nodes ?? {}).map(([nodeId, n]) => ({
|
|
13
|
+
nodeId,
|
|
14
|
+
status: n.status,
|
|
15
|
+
durationMs: n.duration ?? '',
|
|
16
|
+
error: n.error ?? '',
|
|
17
|
+
}));
|
|
18
|
+
if (rows.length === 0) {
|
|
19
|
+
output.success(rows, () => `run ${state.executionId}: ${state.status} (no node states)`);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
output.success(rows);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/trace.ts"],"names":[],"mappings":";;AAcA,oCAoBC;AA/BD,wDAA2E;AAWpE,KAAK,UAAU,YAAY,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAkB,EAAE,OAAkB,EAAE;IAC5G,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,IAAI,+BAAoB,CAAC;IACvD,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAGnD,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtB,OAAO;IACT,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnE,MAAM;QACN,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,UAAU,EAAE,CAAC,CAAC,QAAQ,IAAI,EAAE;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;KACrB,CAAC,CAAC,CAAC;IACJ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,MAAM,mBAAmB,CAAC,CAAC;QACzF,OAAO;IACT,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
export interface UndeployOptions {
|
|
4
|
+
workflowId: string;
|
|
5
|
+
yes?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface UndeployDeps {
|
|
8
|
+
undeploy?: (client: ApiClient, workflowId: string) => Promise<unknown>;
|
|
9
|
+
confirm?: (message: string, opts: {
|
|
10
|
+
yes: boolean;
|
|
11
|
+
}) => Promise<'execute' | 'aborted'>;
|
|
12
|
+
}
|
|
13
|
+
export declare function undeployCommand(output: Output, client: ApiClient, opts: UndeployOptions, deps?: UndeployDeps): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.undeployCommand = undeployCommand;
|
|
4
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
5
|
+
const confirm_js_1 = require("../../files/helper/confirm.js");
|
|
6
|
+
async function undeployCommand(output, client, opts, deps = {}) {
|
|
7
|
+
const doUndeploy = deps.undeploy ?? workflow_api_js_1.undeploy;
|
|
8
|
+
const confirm = deps.confirm ?? confirm_js_1.confirmDestructive;
|
|
9
|
+
const decision = await confirm(`Undeploy workflow ${opts.workflowId}? It stops running immediately.`, { yes: !!opts.yes });
|
|
10
|
+
if (decision !== 'execute') {
|
|
11
|
+
output.error('Undeploy aborted (not confirmed).', 'WORKFLOW_UNDEPLOY_ABORTED');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
await doUndeploy(client, opts.workflowId);
|
|
15
|
+
output.success({ undeployed: opts.workflowId }, () => `✓ undeployed ${opts.workflowId}`);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=undeploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undeploy.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/undeploy.ts"],"names":[],"mappings":";;AAeA,0CAWC;AAxBD,wDAAiE;AACjE,8DAAmE;AAY5D,KAAK,UAAU,eAAe,CAAC,MAAc,EAAE,MAAiB,EAAE,IAAqB,EAAE,OAAqB,EAAE;IACrH,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,IAAI,0BAAe,CAAC;IACpD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,+BAAkB,CAAC;IAEnD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,qBAAqB,IAAI,CAAC,UAAU,iCAAiC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3H,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,KAAK,CAAC,mCAAmC,EAAE,2BAA2B,CAAC,CAAC;QAC/E,OAAO;IACT,CAAC;IACD,MAAM,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,gBAAgB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ApiClient } from '../../helper/api-client.js';
|
|
2
|
+
import type { Output } from '../../helper/output.js';
|
|
3
|
+
import type { TemplateV3, ValidationResult } from '../types.js';
|
|
4
|
+
export interface ValidateOptions {
|
|
5
|
+
file: string;
|
|
6
|
+
runner?: string;
|
|
7
|
+
localOnly?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ValidateDeps {
|
|
10
|
+
loadTemplate?: (file: string) => TemplateV3;
|
|
11
|
+
validateLocal?: (t: TemplateV3) => ValidationResult;
|
|
12
|
+
client?: ApiClient;
|
|
13
|
+
validateRemote?: (client: ApiClient, body: {
|
|
14
|
+
runnerUid: string;
|
|
15
|
+
template: TemplateV3;
|
|
16
|
+
}) => Promise<ValidationResult>;
|
|
17
|
+
}
|
|
18
|
+
export declare function validateCommand(output: Output, opts: ValidateOptions, deps?: ValidateDeps): Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateCommand = validateCommand;
|
|
4
|
+
const template_io_js_1 = require("../template-io.js");
|
|
5
|
+
const validate_js_1 = require("../validate.js");
|
|
6
|
+
const workflow_api_js_1 = require("../workflow-api.js");
|
|
7
|
+
function merge(a, b) {
|
|
8
|
+
return {
|
|
9
|
+
valid: a.valid && b.valid,
|
|
10
|
+
errors: [...a.errors, ...b.errors],
|
|
11
|
+
warnings: [...(a.warnings ?? []), ...(b.warnings ?? [])],
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
async function validateCommand(output, opts, deps = {}) {
|
|
15
|
+
const load = deps.loadTemplate ?? template_io_js_1.loadTemplate;
|
|
16
|
+
const local = deps.validateLocal ?? validate_js_1.validateLocal;
|
|
17
|
+
const remoteFn = deps.validateRemote ?? workflow_api_js_1.validateRemote;
|
|
18
|
+
const template = load(opts.file);
|
|
19
|
+
let result = local(template);
|
|
20
|
+
if (!opts.localOnly && opts.runner && deps.client) {
|
|
21
|
+
const remote = await remoteFn(deps.client, { runnerUid: opts.runner, template });
|
|
22
|
+
result = merge(result, {
|
|
23
|
+
valid: remote.valid,
|
|
24
|
+
errors: remote.errors ?? [],
|
|
25
|
+
warnings: remote.warnings ?? [],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (!result.valid) {
|
|
29
|
+
const summary = result.errors.map((e) => `✗ ${e.type}: ${e.message}`).join('\n');
|
|
30
|
+
output.error(summary, 'WORKFLOW_INVALID');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
output.success(result, () => `✓ valid (${result.warnings?.length ?? 0} warning(s))`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../src/functions/workflow/commands/validate.ts"],"names":[],"mappings":";;AA4BA,0CAuBC;AAhDD,sDAAgE;AAChE,gDAAuE;AACvE,wDAA6E;AA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