@dcupl/cli 1.4.0-beta.1 → 1.4.0-beta.10
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 +34 -0
- package/dist/cli.js +724 -168
- package/dist/cli.js.map +1 -1
- package/dist/functions/app/app-id.js +34 -2
- package/dist/functions/app/app-id.js.map +1 -1
- package/dist/functions/app/client/daemon-client.js.map +1 -1
- package/dist/functions/app/commands/cdn-host.d.ts +16 -0
- package/dist/functions/app/commands/cdn-host.js +47 -0
- package/dist/functions/app/commands/cdn-host.js.map +1 -0
- package/dist/functions/app/commands/create.js +50 -34
- package/dist/functions/app/commands/create.js.map +1 -1
- package/dist/functions/app/commands/destroy.js +10 -4
- package/dist/functions/app/commands/destroy.js.map +1 -1
- package/dist/functions/app/commands/detect-serve.js +17 -6
- package/dist/functions/app/commands/detect-serve.js.map +1 -1
- package/dist/functions/app/commands/fn/_fn-helpers.js +11 -3
- package/dist/functions/app/commands/fn/_fn-helpers.js.map +1 -1
- package/dist/functions/app/commands/fn/aggregate.js +4 -1
- package/dist/functions/app/commands/fn/aggregate.js.map +1 -1
- package/dist/functions/app/commands/fn/pivot.js.map +1 -1
- package/dist/functions/app/commands/list.js +6 -2
- package/dist/functions/app/commands/list.js.map +1 -1
- package/dist/functions/app/commands/loader-hash.js.map +1 -1
- package/dist/functions/app/commands/loaders/add.js +6 -0
- package/dist/functions/app/commands/loaders/add.js.map +1 -1
- package/dist/functions/app/commands/loaders/process-flags.js +4 -1
- package/dist/functions/app/commands/loaders/process-flags.js.map +1 -1
- package/dist/functions/app/commands/loaders/process.js +3 -1
- package/dist/functions/app/commands/loaders/process.js.map +1 -1
- package/dist/functions/app/commands/models/get.js.map +1 -1
- package/dist/functions/app/commands/models/keys.js.map +1 -1
- package/dist/functions/app/commands/models/remove.js.map +1 -1
- package/dist/functions/app/commands/models/set.js +3 -1
- package/dist/functions/app/commands/models/set.js.map +1 -1
- package/dist/functions/app/commands/query/execute.js +5 -2
- package/dist/functions/app/commands/query/execute.js.map +1 -1
- package/dist/functions/app/commands/query/one.js +3 -1
- package/dist/functions/app/commands/query/one.js.map +1 -1
- package/dist/functions/app/commands/render.js +10 -4
- package/dist/functions/app/commands/render.js.map +1 -1
- package/dist/functions/app/commands/resolve-app.js.map +1 -1
- package/dist/functions/app/commands/resolve-source.d.ts +1 -0
- package/dist/functions/app/commands/resolve-source.js +20 -5
- package/dist/functions/app/commands/resolve-source.js.map +1 -1
- package/dist/functions/app/commands/validate-report.d.ts +31 -0
- package/dist/functions/app/commands/validate-report.js +20 -1
- package/dist/functions/app/commands/validate-report.js.map +1 -1
- package/dist/functions/app/commands/validate.d.ts +1 -0
- package/dist/functions/app/commands/validate.js +31 -10
- package/dist/functions/app/commands/validate.js.map +1 -1
- package/dist/functions/app/daemon/app-server.module.js +6 -1
- package/dist/functions/app/daemon/app-server.module.js.map +1 -1
- package/dist/functions/app/daemon/controllers/data.controller.js +17 -6
- package/dist/functions/app/daemon/controllers/data.controller.js.map +1 -1
- package/dist/functions/app/daemon/controllers/lifecycle.controller.js.map +1 -1
- package/dist/functions/app/daemon/controllers/query.controller.js +4 -1
- package/dist/functions/app/daemon/controllers/query.controller.js.map +1 -1
- package/dist/functions/app/daemon/daemon-args.js +2 -2
- package/dist/functions/app/daemon/daemon-args.js.map +1 -1
- package/dist/functions/app/daemon/filters/envelope-exception.filter.js +6 -1
- package/dist/functions/app/daemon/filters/envelope-exception.filter.js.map +1 -1
- package/dist/functions/app/daemon/main.js +14 -7
- package/dist/functions/app/daemon/main.js.map +1 -1
- package/dist/functions/app/daemon/services/attribute-validation.d.ts +21 -0
- package/dist/functions/app/daemon/services/attribute-validation.js +164 -0
- package/dist/functions/app/daemon/services/attribute-validation.js.map +1 -0
- package/dist/functions/app/daemon/services/dcupl-host.service.d.ts +5 -0
- package/dist/functions/app/daemon/services/dcupl-host.service.js +83 -16
- package/dist/functions/app/daemon/services/dcupl-host.service.js.map +1 -1
- package/dist/functions/app/daemon/services/idle-watchdog.service.js.map +1 -1
- package/dist/functions/app/daemon/services/ingest.service.js +8 -4
- package/dist/functions/app/daemon/services/ingest.service.js.map +1 -1
- package/dist/functions/app/daemon/services/init-options.js.map +1 -1
- package/dist/functions/app/daemon/services/loaders.service.d.ts +3 -1
- package/dist/functions/app/daemon/services/loaders.service.js +22 -6
- package/dist/functions/app/daemon/services/loaders.service.js.map +1 -1
- package/dist/functions/app/e2e/port-lock.d.ts +8 -0
- package/dist/functions/app/e2e/port-lock.js +66 -2
- package/dist/functions/app/e2e/port-lock.js.map +1 -1
- package/dist/functions/app/registry/registry.js +11 -10
- package/dist/functions/app/registry/registry.js.map +1 -1
- package/dist/functions/app/registry/serve-registry.js +13 -9
- package/dist/functions/app/registry/serve-registry.js.map +1 -1
- package/dist/functions/app/types.d.ts +2 -0
- package/dist/functions/config/commands/set.js +2 -2
- package/dist/functions/config/commands/set.js.map +1 -1
- package/dist/functions/config/io.js +1 -3
- package/dist/functions/config/io.js.map +1 -1
- package/dist/functions/config/prompts.js +1 -3
- package/dist/functions/config/prompts.js.map +1 -1
- package/dist/functions/files/commands/copy.js +1 -1
- package/dist/functions/files/commands/copy.js.map +1 -1
- package/dist/functions/files/commands/delete.js +1 -1
- package/dist/functions/files/commands/delete.js.map +1 -1
- package/dist/functions/files/commands/list.js +6 -3
- package/dist/functions/files/commands/list.js.map +1 -1
- package/dist/functions/files/commands/move.js +1 -1
- package/dist/functions/files/commands/move.js.map +1 -1
- package/dist/functions/files/commands/pull.d.ts +16 -1
- package/dist/functions/files/commands/pull.js +135 -1
- package/dist/functions/files/commands/pull.js.map +1 -1
- package/dist/functions/files/commands/push.d.ts +1 -0
- package/dist/functions/files/commands/push.js +25 -3
- package/dist/functions/files/commands/push.js.map +1 -1
- package/dist/functions/files/commands/read.js +3 -2
- package/dist/functions/files/commands/read.js.map +1 -1
- package/dist/functions/files/commands/render.d.ts +29 -0
- package/dist/functions/files/commands/render.js +8 -4
- package/dist/functions/files/commands/render.js.map +1 -1
- package/dist/functions/files/commands/status.js +1 -0
- package/dist/functions/files/commands/status.js.map +1 -1
- package/dist/functions/files/commands/versions/copy.js +1 -1
- package/dist/functions/files/commands/versions/copy.js.map +1 -1
- package/dist/functions/files/commands/versions/delete.js +1 -1
- package/dist/functions/files/commands/versions/delete.js.map +1 -1
- package/dist/functions/files/commands/versions/list.js +4 -0
- package/dist/functions/files/commands/versions/list.js.map +1 -1
- package/dist/functions/files/commands/write.js +13 -3
- package/dist/functions/files/commands/write.js.map +1 -1
- package/dist/functions/files/files-push.js +1 -1
- package/dist/functions/files/files-push.js.map +1 -1
- package/dist/functions/files/helper/text-policy.d.ts +5 -0
- package/dist/functions/files/helper/text-policy.js +31 -0
- package/dist/functions/files/helper/text-policy.js.map +1 -0
- package/dist/functions/files/sync/large-upload.d.ts +20 -0
- package/dist/functions/files/sync/large-upload.js +140 -0
- package/dist/functions/files/sync/large-upload.js.map +1 -0
- package/dist/functions/files/sync/manifest.js +2 -1
- package/dist/functions/files/sync/manifest.js.map +1 -1
- package/dist/functions/files/sync/transfer.d.ts +5 -0
- package/dist/functions/files/sync/transfer.js +47 -10
- package/dist/functions/files/sync/transfer.js.map +1 -1
- package/dist/functions/files/test-helpers.d.ts +11 -0
- package/dist/functions/files/test-helpers.js +28 -0
- package/dist/functions/files/test-helpers.js.map +1 -1
- package/dist/functions/generate/files/generate-code.d.ts +1 -1
- package/dist/functions/generate/files/generate-files.d.ts +7 -1
- package/dist/functions/generate/files/generate-files.js +63 -15
- package/dist/functions/generate/files/generate-files.js.map +1 -1
- package/dist/functions/generate/files/workflow-presets.d.ts +6 -0
- package/dist/functions/generate/files/workflow-presets.js +158 -0
- package/dist/functions/generate/files/workflow-presets.js.map +1 -0
- package/dist/functions/generate/model-from-data/generate-model-from-data.js +8 -3
- package/dist/functions/generate/model-from-data/generate-model-from-data.js.map +1 -1
- package/dist/functions/generate/model-from-data/infer-key.js +1 -4
- package/dist/functions/generate/model-from-data/infer-key.js.map +1 -1
- package/dist/functions/generate/model-from-data/infer-to-model.js +1 -2
- package/dist/functions/generate/model-from-data/infer-to-model.js.map +1 -1
- package/dist/functions/generate/projects/generate-project.d.ts +5 -0
- package/dist/functions/generate/projects/generate-project.js +29 -8
- package/dist/functions/generate/projects/generate-project.js.map +1 -1
- package/dist/functions/helper/api-client.d.ts +3 -0
- package/dist/functions/helper/api-client.js +10 -3
- package/dist/functions/helper/api-client.js.map +1 -1
- package/dist/functions/helper/config.helper.d.ts +1 -0
- package/dist/functions/helper/config.helper.js.map +1 -1
- package/dist/functions/helper/output.d.ts +1 -1
- package/dist/functions/helper/output.js +10 -12
- package/dist/functions/helper/output.js.map +1 -1
- package/dist/functions/helper/parse-fail.js +4 -1
- package/dist/functions/helper/parse-fail.js.map +1 -1
- package/dist/functions/schemas/command.js.map +1 -1
- package/dist/functions/schemas/examples/AppLoaderConfiguration.example.json +1 -3
- package/dist/functions/schemas/examples/DataMapperStepConfig.example.json +6 -1
- package/dist/functions/schemas/examples/ModelDefinition.example.json +8 -1
- package/dist/functions/schemas/examples/ScriptStepConfig.example.json +3 -1
- package/dist/functions/schemas/examples/TemplateV3.example.json +5 -1
- package/dist/functions/schemas/extract.js +1 -1
- package/dist/functions/schemas/extract.js.map +1 -1
- package/dist/functions/schemas/format.js +4 -4
- package/dist/functions/schemas/format.js.map +1 -1
- package/dist/functions/schemas/registry.d.ts +14 -0
- package/dist/functions/schemas/registry.js +103 -30
- package/dist/functions/schemas/registry.js.map +1 -1
- package/dist/functions/schemas/resolve.js +1 -2
- package/dist/functions/schemas/resolve.js.map +1 -1
- package/dist/functions/schemas/validate.d.ts +22 -0
- package/dist/functions/schemas/validate.js +67 -0
- package/dist/functions/schemas/validate.js.map +1 -0
- package/dist/functions/serve/commands/list.js +2 -1
- package/dist/functions/serve/commands/list.js.map +1 -1
- package/dist/functions/serve/commands/stop.js +10 -5
- package/dist/functions/serve/commands/stop.js.map +1 -1
- package/dist/functions/serve/dev-server/dev-server-access.guard.d.ts +11 -0
- package/dist/functions/serve/dev-server/dev-server-access.guard.js +41 -0
- package/dist/functions/serve/dev-server/dev-server-access.guard.js.map +1 -0
- package/dist/functions/serve/dev-server/dev-server.controller.d.ts +3 -0
- package/dist/functions/serve/dev-server/dev-server.controller.js +20 -0
- package/dist/functions/serve/dev-server/dev-server.controller.js.map +1 -1
- package/dist/functions/serve/dev-server/dev-server.module.d.ts +3 -0
- package/dist/functions/serve/dev-server/dev-server.module.js +34 -23
- package/dist/functions/serve/dev-server/dev-server.module.js.map +1 -1
- package/dist/functions/serve/dev-server/dev-server.options.d.ts +8 -0
- package/dist/functions/serve/dev-server/dev-server.options.js +5 -0
- package/dist/functions/serve/dev-server/dev-server.options.js.map +1 -0
- package/dist/functions/serve/dev-server/dev-server.service.d.ts +11 -3
- package/dist/functions/serve/dev-server/dev-server.service.js +72 -65
- package/dist/functions/serve/dev-server/dev-server.service.js.map +1 -1
- package/dist/functions/serve/dev-server/path-scope.d.ts +5 -0
- package/dist/functions/serve/dev-server/path-scope.js +88 -0
- package/dist/functions/serve/dev-server/path-scope.js.map +1 -0
- package/dist/functions/serve/dev-server/request-security.d.ts +34 -0
- package/dist/functions/serve/dev-server/request-security.js +145 -0
- package/dist/functions/serve/dev-server/request-security.js.map +1 -0
- package/dist/functions/serve/main.d.ts +13 -0
- package/dist/functions/serve/main.js +85 -13
- package/dist/functions/serve/main.js.map +1 -1
- package/dist/functions/serve/serve-self-register.js +2 -1
- package/dist/functions/serve/serve-self-register.js.map +1 -1
- package/dist/functions/version/command.js +1 -6
- package/dist/functions/version/command.js.map +1 -1
- package/dist/functions/workflow/commands/deploy.d.ts +9 -1
- package/dist/functions/workflow/commands/deploy.js +39 -10
- package/dist/functions/workflow/commands/deploy.js.map +1 -1
- package/dist/functions/workflow/commands/get.js.map +1 -1
- package/dist/functions/workflow/commands/history.js.map +1 -1
- package/dist/functions/workflow/commands/run.d.ts +26 -0
- package/dist/functions/workflow/commands/run.js +101 -0
- package/dist/functions/workflow/commands/run.js.map +1 -0
- package/dist/functions/workflow/commands/runners-get.js.map +1 -1
- package/dist/functions/workflow/commands/runners.d.ts +2 -0
- package/dist/functions/workflow/commands/runners.js +10 -1
- package/dist/functions/workflow/commands/runners.js.map +1 -1
- package/dist/functions/workflow/commands/status.d.ts +1 -1
- package/dist/functions/workflow/commands/status.js +7 -1
- package/dist/functions/workflow/commands/status.js.map +1 -1
- package/dist/functions/workflow/commands/template.js.map +1 -1
- package/dist/functions/workflow/commands/test.d.ts +3 -0
- package/dist/functions/workflow/commands/test.js +22 -73
- package/dist/functions/workflow/commands/test.js.map +1 -1
- package/dist/functions/workflow/commands/trace.d.ts +4 -2
- package/dist/functions/workflow/commands/trace.js +22 -1
- package/dist/functions/workflow/commands/trace.js.map +1 -1
- package/dist/functions/workflow/commands/undeploy.js +3 -1
- package/dist/functions/workflow/commands/undeploy.js.map +1 -1
- package/dist/functions/workflow/commands/validate.d.ts +2 -0
- package/dist/functions/workflow/commands/validate.js +16 -2
- package/dist/functions/workflow/commands/validate.js.map +1 -1
- package/dist/functions/workflow/resolve-runner.d.ts +17 -0
- package/dist/functions/workflow/resolve-runner.js +41 -0
- package/dist/functions/workflow/resolve-runner.js.map +1 -0
- package/dist/functions/workflow/run-failure.d.ts +11 -0
- package/dist/functions/workflow/run-failure.js +74 -0
- package/dist/functions/workflow/run-failure.js.map +1 -0
- package/dist/functions/workflow/runner-health.d.ts +16 -0
- package/dist/functions/workflow/runner-health.js +36 -0
- package/dist/functions/workflow/runner-health.js.map +1 -0
- package/dist/functions/workflow/script-lint.d.ts +10 -0
- package/dist/functions/workflow/script-lint.js +513 -0
- package/dist/functions/workflow/script-lint.js.map +1 -0
- package/dist/functions/workflow/trace.js.map +1 -1
- package/dist/functions/workflow/types.d.ts +11 -2
- package/dist/functions/workflow/types.js +4 -0
- package/dist/functions/workflow/types.js.map +1 -1
- package/dist/functions/workflow/validate.js +4 -1
- package/dist/functions/workflow/validate.js.map +1 -1
- package/dist/functions/workflow/wait-for-swap.d.ts +24 -1
- package/dist/functions/workflow/wait-for-swap.js +58 -0
- package/dist/functions/workflow/wait-for-swap.js.map +1 -1
- package/dist/functions/workflow/workflow-api.js +3 -1
- package/dist/functions/workflow/workflow-api.js.map +1 -1
- package/files/dev-server/index.html +2 -1
- package/package.json +24 -18
- package/dist/functions/serve/guards/apiKey.guard.d.ts +0 -4
- package/dist/functions/serve/guards/apiKey.guard.js +0 -23
- package/dist/functions/serve/guards/apiKey.guard.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,7 @@ const api_client_1 = require("./functions/helper/api-client");
|
|
|
7
7
|
const output_1 = require("./functions/helper/output");
|
|
8
8
|
const parse_fail_1 = require("./functions/helper/parse-fail");
|
|
9
9
|
const command_js_1 = require("./functions/schemas/command.js");
|
|
10
|
+
const workflow_presets_js_1 = require("./functions/generate/files/workflow-presets.js");
|
|
10
11
|
const command_js_2 = require("./functions/version/command.js");
|
|
11
12
|
const init_options_js_1 = require("./functions/app/daemon/services/init-options.js");
|
|
12
13
|
function parseAutoServePort(raw) {
|
|
@@ -21,9 +22,14 @@ function parseAutoServePort(raw) {
|
|
|
21
22
|
}
|
|
22
23
|
return n;
|
|
23
24
|
}
|
|
25
|
+
const CDN_BASE_URL_DESCRIBE = 'CDN base url for the remote source. Default: derived from consoleApiUrl in dcupl.config.json' +
|
|
26
|
+
' (api.dcupl.com → cdn.dcupl.com, api.dev.dcupl.com → cdn.dev.dcupl.com), else the prod CDN;' +
|
|
27
|
+
' also DCUPL_CDN_BASE_URL env or `cdnBaseUrl` in dcupl.config.json. Overrides the workspace consoleApiUrl' +
|
|
28
|
+
' even with an explicit --project-id. api-key + cache-busting only apply to dcupl CDN hosts (cdn*.dcupl.com, cdn.dev.dcupl.com);' +
|
|
29
|
+
' see docs/flows/workflow-app-remote.md';
|
|
24
30
|
function buildCli(rawArgs) {
|
|
25
31
|
const instance = (0, yargs_1.default)(rawArgs);
|
|
26
|
-
return instance
|
|
32
|
+
return (instance
|
|
27
33
|
.version(false)
|
|
28
34
|
.locale('en')
|
|
29
35
|
.strict()
|
|
@@ -53,7 +59,7 @@ function buildCli(rawArgs) {
|
|
|
53
59
|
})
|
|
54
60
|
.option('project-id', {
|
|
55
61
|
type: 'string',
|
|
56
|
-
describe: 'Console project ID (
|
|
62
|
+
describe: 'Console project ID (implies --starter existing when --starter is omitted)',
|
|
57
63
|
})
|
|
58
64
|
.option('api-key', {
|
|
59
65
|
type: 'string',
|
|
@@ -86,13 +92,25 @@ function buildCli(rawArgs) {
|
|
|
86
92
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
87
93
|
await serveListCommand(output);
|
|
88
94
|
})
|
|
89
|
-
.command('stop', 'Stop a running serve by port', (a) => a
|
|
90
|
-
|
|
95
|
+
.command('stop', 'Stop a running serve by port', (a) => a.option('port', {
|
|
96
|
+
type: 'number',
|
|
97
|
+
demandOption: true,
|
|
98
|
+
default: undefined,
|
|
99
|
+
describe: 'Port of the serve to stop',
|
|
100
|
+
}), async (argv) => {
|
|
91
101
|
const { serveStopCommand } = await import('./functions/serve/commands/stop.js');
|
|
92
102
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
93
103
|
await serveStopCommand(output, { port: argv.port });
|
|
94
104
|
})
|
|
95
105
|
.option('port', { default: '8083' })
|
|
106
|
+
.option('host', {
|
|
107
|
+
type: 'string',
|
|
108
|
+
describe: 'Address to listen on. Default 127.0.0.1 (this machine only); a bare --host listens on all interfaces (0.0.0.0). File edits from other machines need the printed token.',
|
|
109
|
+
})
|
|
110
|
+
.option('allow-origin', {
|
|
111
|
+
type: 'string',
|
|
112
|
+
describe: 'Let another browser origin read files and, from this machine, edit them without the token, like the dcupl Console (repeatable). Example: http://localhost:4200 for a locally running Console.',
|
|
113
|
+
})
|
|
96
114
|
.option('open-browser', {
|
|
97
115
|
type: 'boolean',
|
|
98
116
|
describe: 'Open the welcome screen in a browser on start. Overrides openBrowser in dcupl.config.json.',
|
|
@@ -122,17 +140,38 @@ function buildCli(rawArgs) {
|
|
|
122
140
|
'test-setup',
|
|
123
141
|
'test',
|
|
124
142
|
'test-config',
|
|
143
|
+
'workflow',
|
|
125
144
|
],
|
|
126
145
|
})
|
|
127
|
-
.option('name', {
|
|
146
|
+
.option('name', {
|
|
147
|
+
describe: 'Name for model generation, or the workflow key for `generate workflow`',
|
|
148
|
+
type: 'string',
|
|
149
|
+
})
|
|
128
150
|
.option('file-name', { describe: 'File name for generation', type: 'string' })
|
|
129
151
|
.option('operator', { describe: 'Operator name for operator generation', type: 'string' })
|
|
152
|
+
.option('template', {
|
|
153
|
+
describe: `Workflow preset (used by \`generate workflow\`, default: ${workflow_presets_js_1.WORKFLOW_PRESETS[0]})`,
|
|
154
|
+
type: 'string',
|
|
155
|
+
choices: workflow_presets_js_1.WORKFLOW_PRESETS,
|
|
156
|
+
})
|
|
130
157
|
.option('title', { describe: 'Test title (used by `generate test`)', type: 'string' })
|
|
131
158
|
.option('from', { describe: 'Data file (CSV/JSON/NDJSON) to infer a model from', type: 'string' })
|
|
132
|
-
.option('register', {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
159
|
+
.option('register', {
|
|
160
|
+
describe: 'Register the generated model + data resource in dcupl.lc.json',
|
|
161
|
+
type: 'boolean',
|
|
162
|
+
})
|
|
163
|
+
.option('sample-size', {
|
|
164
|
+
describe: 'Max rows to scan when inferring types from --from',
|
|
165
|
+
type: 'number',
|
|
166
|
+
})
|
|
167
|
+
.option('key-property', {
|
|
168
|
+
describe: 'Override inferred keyProperty for --from. Comma-separate for a composite key (a,b,c). Skips inference + prompts.',
|
|
169
|
+
type: 'string',
|
|
170
|
+
})
|
|
171
|
+
.option('dry-run', {
|
|
172
|
+
describe: 'Preview the proposed model + lc.json additions without writing.',
|
|
173
|
+
type: 'boolean',
|
|
174
|
+
});
|
|
136
175
|
}, async (argv) => {
|
|
137
176
|
const { generateFn } = await import('./functions/generate/files/generate-files.js');
|
|
138
177
|
generateFn(argv);
|
|
@@ -144,19 +183,56 @@ function buildCli(rawArgs) {
|
|
|
144
183
|
(0, command_js_1.schemasListCommand)(argv, output);
|
|
145
184
|
})
|
|
146
185
|
.command('get <name>', 'Print the source of a schema', (args) => args
|
|
147
|
-
.positional('name', {
|
|
186
|
+
.positional('name', {
|
|
187
|
+
type: 'string',
|
|
188
|
+
describe: 'Schema name (see `dcupl schemas list`)',
|
|
189
|
+
demandOption: true,
|
|
190
|
+
})
|
|
148
191
|
.option('example', { type: 'boolean', default: false, describe: 'Append a curated example payload' }), (argv) => {
|
|
149
192
|
const output = (0, output_1.createOutput)(argv.json);
|
|
150
193
|
(0, command_js_1.schemasGetCommand)({ name: argv.name, json: argv.json, example: argv.example }, output);
|
|
194
|
+
})
|
|
195
|
+
.command('validate <file>', 'Validate a JSON file against a registry schema (Zod-kind, e.g. TemplateV3)', (args) => args
|
|
196
|
+
.positional('file', {
|
|
197
|
+
type: 'string',
|
|
198
|
+
describe: 'Path to the JSON file to validate',
|
|
199
|
+
demandOption: true,
|
|
200
|
+
})
|
|
201
|
+
.option('against', {
|
|
202
|
+
type: 'string',
|
|
203
|
+
demandOption: true,
|
|
204
|
+
describe: 'Schema name to validate against (see `dcupl schemas list` — [Zod] entries only)',
|
|
205
|
+
}), async (argv) => {
|
|
206
|
+
const output = (0, output_1.createOutput)(argv.json);
|
|
207
|
+
try {
|
|
208
|
+
const { schemasValidateCommand } = await import('./functions/schemas/validate.js');
|
|
209
|
+
const valid = await schemasValidateCommand({ file: argv.file, against: argv.against, json: argv.json }, output);
|
|
210
|
+
if (!valid)
|
|
211
|
+
process.exitCode = 1;
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
output.error(err.message, err.code || 'SCHEMA_VALIDATE_FAILED');
|
|
215
|
+
}
|
|
151
216
|
})
|
|
152
217
|
.demandCommand(1);
|
|
153
218
|
}, () => { })
|
|
154
219
|
.command('workflow <subcommand>', 'Build, test, and deploy dcupl Workflow v3 templates. Auth: `dcupl config set` (projectId + apiKey).', (yy) => {
|
|
155
220
|
return yy
|
|
156
221
|
.command('validate', 'Validate a TemplateV3 file locally (and remotely if --runner is given).', (a) => a
|
|
157
|
-
.option('file', {
|
|
158
|
-
|
|
159
|
-
|
|
222
|
+
.option('file', {
|
|
223
|
+
type: 'string',
|
|
224
|
+
demandOption: true,
|
|
225
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
226
|
+
})
|
|
227
|
+
.option('runner', {
|
|
228
|
+
type: 'string',
|
|
229
|
+
describe: 'Runner uid or runnerKey for remote validation (feature limits, cycles, expressions)',
|
|
230
|
+
})
|
|
231
|
+
.option('local-only', {
|
|
232
|
+
type: 'boolean',
|
|
233
|
+
default: false,
|
|
234
|
+
describe: 'Skip remote validation even if --runner is set',
|
|
235
|
+
}), async (argv) => {
|
|
160
236
|
const { validateCommand } = await import('./functions/workflow/commands/validate.js');
|
|
161
237
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
162
238
|
try {
|
|
@@ -165,7 +241,11 @@ function buildCli(rawArgs) {
|
|
|
165
241
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
166
242
|
deps.client = mkClient();
|
|
167
243
|
}
|
|
168
|
-
await validateCommand(output, {
|
|
244
|
+
await validateCommand(output, {
|
|
245
|
+
file: argv.file,
|
|
246
|
+
runner: argv.runner,
|
|
247
|
+
localOnly: !!argv['local-only'],
|
|
248
|
+
}, deps);
|
|
169
249
|
}
|
|
170
250
|
catch (err) {
|
|
171
251
|
output.error(err.message, err.code || 'WORKFLOW_VALIDATE_FAILED');
|
|
@@ -228,20 +308,29 @@ function buildCli(rawArgs) {
|
|
|
228
308
|
})
|
|
229
309
|
.command('trace', 'Show the node-by-node execution state of a single run (debug a workflow run).', (a) => a
|
|
230
310
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
231
|
-
.option('run', { type: 'string',
|
|
311
|
+
.option('run', { type: 'string', describe: 'Execution runId (from `workflow history`)' })
|
|
312
|
+
.option('last', {
|
|
313
|
+
type: 'boolean',
|
|
314
|
+
default: false,
|
|
315
|
+
describe: 'Trace the most recent run instead of naming one with --run',
|
|
316
|
+
}), async (argv) => {
|
|
232
317
|
const { traceCommand } = await import('./functions/workflow/commands/trace.js');
|
|
233
318
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
234
319
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
235
320
|
try {
|
|
236
|
-
await traceCommand(output, mkClient(), {
|
|
321
|
+
await traceCommand(output, mkClient(), {
|
|
322
|
+
id: argv.id,
|
|
323
|
+
run: argv.run,
|
|
324
|
+
last: !!argv.last,
|
|
325
|
+
});
|
|
237
326
|
}
|
|
238
327
|
catch (err) {
|
|
239
328
|
output.error(err.message, err.code || 'WORKFLOW_TRACE_FAILED');
|
|
240
329
|
}
|
|
241
330
|
})
|
|
242
|
-
.command('runners
|
|
243
|
-
return rr
|
|
244
|
-
.command('list', 'List the runners available to this project (uid / key / type / url).', () => { }, async (argv) => {
|
|
331
|
+
.command('runners [subcommand]', 'Inspect the runners available to this project.', (rr) => {
|
|
332
|
+
return (rr
|
|
333
|
+
.command(['list', '$0'], 'List the runners available to this project (uid / key / type / url / health).', () => { }, async (argv) => {
|
|
245
334
|
const { runnersCommand } = await import('./functions/workflow/commands/runners.js');
|
|
246
335
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
247
336
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -262,44 +351,133 @@ function buildCli(rawArgs) {
|
|
|
262
351
|
catch (err) {
|
|
263
352
|
output.error(err.message, err.code || 'WORKFLOW_RUNNERS_GET_FAILED');
|
|
264
353
|
}
|
|
265
|
-
})
|
|
266
|
-
.demandCommand(1);
|
|
354
|
+
}));
|
|
267
355
|
}, () => { })
|
|
268
356
|
.command('test', 'Deploy to a (dev) runner then exercise it: --node for one node, otherwise a full run.', (a) => a
|
|
269
|
-
.option('file', {
|
|
270
|
-
|
|
357
|
+
.option('file', {
|
|
358
|
+
type: 'string',
|
|
359
|
+
demandOption: true,
|
|
360
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
361
|
+
})
|
|
362
|
+
.option('runner', {
|
|
363
|
+
type: 'string',
|
|
364
|
+
demandOption: true,
|
|
365
|
+
describe: 'Runner uid or runnerKey to deploy+run against (use a dev/test runner)',
|
|
366
|
+
})
|
|
271
367
|
.option('node', { type: 'string', describe: 'Test a single node by id (uses test-node)' })
|
|
272
|
-
.option('input', {
|
|
368
|
+
.option('input', {
|
|
369
|
+
type: 'string',
|
|
370
|
+
describe: 'Path to a JSON file: test-node inputData, or full-run request body',
|
|
371
|
+
})
|
|
273
372
|
.option('state', { type: 'string', describe: 'Path to a JSON file: $state seed for test-node' })
|
|
274
|
-
.option('trigger-key', {
|
|
275
|
-
|
|
276
|
-
|
|
373
|
+
.option('trigger-key', {
|
|
374
|
+
type: 'string',
|
|
375
|
+
describe: 'api-key to pass to the runner if the trigger requires auth',
|
|
376
|
+
})
|
|
377
|
+
.option('wait', {
|
|
378
|
+
type: 'boolean',
|
|
379
|
+
default: true,
|
|
380
|
+
describe: 'Wait for the runner to hot-swap before triggering (--no-wait to skip)',
|
|
381
|
+
})
|
|
382
|
+
.option('swap-timeout', {
|
|
383
|
+
type: 'number',
|
|
384
|
+
describe: 'Max ms to wait for swap confirmation (default 30000)',
|
|
385
|
+
}), async (argv) => {
|
|
277
386
|
const { testCommand } = await import('./functions/workflow/commands/test.js');
|
|
278
387
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
279
388
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
280
389
|
try {
|
|
281
390
|
await testCommand(output, mkClient(), {
|
|
282
|
-
file: argv.file,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
391
|
+
file: argv.file,
|
|
392
|
+
runner: argv.runner,
|
|
393
|
+
node: argv.node,
|
|
394
|
+
input: argv.input,
|
|
395
|
+
state: argv.state,
|
|
396
|
+
triggerKey: argv['trigger-key'],
|
|
397
|
+
wait: argv.wait,
|
|
398
|
+
swapTimeout: argv['swap-timeout'],
|
|
286
399
|
});
|
|
287
400
|
}
|
|
288
401
|
catch (err) {
|
|
289
402
|
output.error(err.message, err.code || 'WORKFLOW_TEST_FAILED');
|
|
290
403
|
}
|
|
404
|
+
})
|
|
405
|
+
.command('run <key>', 'Trigger an already-deployed workflow (no redeploy): --node for one node, otherwise a full run.', (a) => a
|
|
406
|
+
.positional('key', {
|
|
407
|
+
type: 'string',
|
|
408
|
+
demandOption: true,
|
|
409
|
+
describe: 'Deployed workflow key (as shown by `workflow list`; the bare template key also works)',
|
|
410
|
+
})
|
|
411
|
+
.option('runner', {
|
|
412
|
+
type: 'string',
|
|
413
|
+
demandOption: true,
|
|
414
|
+
describe: 'Runner uid or runnerKey the workflow is deployed on',
|
|
415
|
+
})
|
|
416
|
+
.option('body', {
|
|
417
|
+
type: 'string',
|
|
418
|
+
describe: 'Inline JSON: test-node inputData, or full-run request body (mutually exclusive with --input)',
|
|
419
|
+
})
|
|
420
|
+
.option('input', {
|
|
421
|
+
type: 'string',
|
|
422
|
+
describe: 'Path to a JSON file: test-node inputData, or full-run request body',
|
|
423
|
+
})
|
|
424
|
+
.option('node', {
|
|
425
|
+
type: 'string',
|
|
426
|
+
describe: 'Run a single node of the deployed workflow by id (uses test-node)',
|
|
427
|
+
})
|
|
428
|
+
.option('trigger-key', {
|
|
429
|
+
type: 'string',
|
|
430
|
+
describe: 'api-key to pass to the runner if the trigger requires auth',
|
|
431
|
+
}), async (argv) => {
|
|
432
|
+
const { runCommand } = await import('./functions/workflow/commands/run.js');
|
|
433
|
+
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
434
|
+
const output = (0, output_1.createOutput)(!!argv.json);
|
|
435
|
+
try {
|
|
436
|
+
await runCommand(output, mkClient(), {
|
|
437
|
+
key: argv.key,
|
|
438
|
+
runner: argv.runner,
|
|
439
|
+
body: argv.body,
|
|
440
|
+
input: argv.input,
|
|
441
|
+
node: argv.node,
|
|
442
|
+
triggerKey: argv['trigger-key'],
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
catch (err) {
|
|
446
|
+
output.error(err.message, err.code || 'WORKFLOW_RUN_FAILED');
|
|
447
|
+
}
|
|
291
448
|
})
|
|
292
449
|
.command('deploy', 'Validate (remote) then deploy a template to a runner. Confirms before going live.', (a) => a
|
|
293
|
-
.option('file', {
|
|
294
|
-
|
|
450
|
+
.option('file', {
|
|
451
|
+
type: 'string',
|
|
452
|
+
demandOption: true,
|
|
453
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
454
|
+
})
|
|
455
|
+
.option('runner', {
|
|
456
|
+
type: 'string',
|
|
457
|
+
demandOption: true,
|
|
458
|
+
describe: 'Runner uid or runnerKey to deploy to',
|
|
459
|
+
})
|
|
295
460
|
.option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI)' })
|
|
296
|
-
.option('wait', {
|
|
297
|
-
|
|
461
|
+
.option('wait', {
|
|
462
|
+
type: 'boolean',
|
|
463
|
+
default: true,
|
|
464
|
+
describe: 'Wait for the runner to hot-swap to this version before returning (--no-wait to skip)',
|
|
465
|
+
})
|
|
466
|
+
.option('swap-timeout', {
|
|
467
|
+
type: 'number',
|
|
468
|
+
describe: 'Max ms to wait for swap confirmation (default 30000)',
|
|
469
|
+
}), async (argv) => {
|
|
298
470
|
const { deployCommand } = await import('./functions/workflow/commands/deploy.js');
|
|
299
471
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
300
472
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
301
473
|
try {
|
|
302
|
-
await deployCommand(output, mkClient(), {
|
|
474
|
+
await deployCommand(output, mkClient(), {
|
|
475
|
+
file: argv.file,
|
|
476
|
+
runner: argv.runner,
|
|
477
|
+
yes: !!argv.yes,
|
|
478
|
+
wait: argv.wait,
|
|
479
|
+
swapTimeout: argv['swap-timeout'],
|
|
480
|
+
});
|
|
303
481
|
}
|
|
304
482
|
catch (err) {
|
|
305
483
|
output.error(err.message, err.code || 'WORKFLOW_DEPLOY_FAILED');
|
|
@@ -307,7 +485,11 @@ function buildCli(rawArgs) {
|
|
|
307
485
|
})
|
|
308
486
|
.command('undeploy', 'Undeploy (stop + remove) a deployed workflow by its uid.', (a) => a
|
|
309
487
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
310
|
-
.option('yes', {
|
|
488
|
+
.option('yes', {
|
|
489
|
+
type: 'boolean',
|
|
490
|
+
default: false,
|
|
491
|
+
describe: 'Skip the confirmation prompt (for CI)',
|
|
492
|
+
}), async (argv) => {
|
|
311
493
|
const { undeployCommand } = await import('./functions/workflow/commands/undeploy.js');
|
|
312
494
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
313
495
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -361,13 +543,29 @@ function buildCli(rawArgs) {
|
|
|
361
543
|
describe: 'Version id (defaults to HEAD, then "draft"). "production" is rejected.',
|
|
362
544
|
})
|
|
363
545
|
.option('name', { type: 'string', hidden: true })
|
|
364
|
-
.option('strict', {
|
|
365
|
-
|
|
366
|
-
|
|
546
|
+
.option('strict', {
|
|
547
|
+
type: 'boolean',
|
|
548
|
+
default: false,
|
|
549
|
+
describe: 'Delete server files no longer present locally. Default (additive) never deletes on the server.',
|
|
550
|
+
})
|
|
551
|
+
.option('yes', {
|
|
552
|
+
type: 'boolean',
|
|
553
|
+
default: false,
|
|
554
|
+
describe: 'Skip the deletion confirmation prompt (for CI).',
|
|
555
|
+
})
|
|
556
|
+
.option('force', {
|
|
557
|
+
type: 'boolean',
|
|
558
|
+
default: false,
|
|
559
|
+
describe: 'Resolve conflicts by uploading the local copy.',
|
|
560
|
+
})
|
|
367
561
|
.option('path', {
|
|
368
562
|
type: 'array',
|
|
369
563
|
string: true,
|
|
370
564
|
describe: 'Restrict the push to one or more files / folders / globs (relative to baseFolder). Repeatable. With --strict, deletion is also confined to the scope. Example: --path models/ --path data/products.csv',
|
|
565
|
+
})
|
|
566
|
+
.option('concurrency', {
|
|
567
|
+
type: 'number',
|
|
568
|
+
describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
|
|
371
569
|
}), async (argv) => {
|
|
372
570
|
const { pushCommand } = await import('./functions/files/commands/push.js');
|
|
373
571
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
@@ -386,6 +584,9 @@ function buildCli(rawArgs) {
|
|
|
386
584
|
yes: argv.yes,
|
|
387
585
|
force: argv.force,
|
|
388
586
|
paths: argv.path,
|
|
587
|
+
concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
|
|
588
|
+
? Math.floor(argv.concurrency)
|
|
589
|
+
: undefined,
|
|
389
590
|
});
|
|
390
591
|
}
|
|
391
592
|
catch (err) {
|
|
@@ -399,13 +600,33 @@ function buildCli(rawArgs) {
|
|
|
399
600
|
describe: 'Version id (defaults to HEAD, then "draft"). Switching versions requires a clean workspace or --force.',
|
|
400
601
|
})
|
|
401
602
|
.option('name', { type: 'string', hidden: true })
|
|
402
|
-
.option('strict', {
|
|
403
|
-
|
|
404
|
-
|
|
603
|
+
.option('strict', {
|
|
604
|
+
type: 'boolean',
|
|
605
|
+
default: false,
|
|
606
|
+
describe: 'Delete local files no longer present on the server. Default (additive) never deletes locally.',
|
|
607
|
+
})
|
|
608
|
+
.option('yes', {
|
|
609
|
+
type: 'boolean',
|
|
610
|
+
default: false,
|
|
611
|
+
describe: 'Skip the deletion confirmation prompt (for CI).',
|
|
612
|
+
})
|
|
613
|
+
.option('force', {
|
|
614
|
+
type: 'boolean',
|
|
615
|
+
default: false,
|
|
616
|
+
describe: 'Resolve conflicts by overwriting local with server. Also overrides the dirty-workspace switch refusal.',
|
|
617
|
+
})
|
|
405
618
|
.option('path', {
|
|
406
619
|
type: 'array',
|
|
407
620
|
string: true,
|
|
408
621
|
describe: 'Restrict the pull to one or more files / folders / globs (relative to baseFolder). Repeatable. With --strict, local deletion is also confined to the scope. Example: --path models/ --path data/products.csv',
|
|
622
|
+
})
|
|
623
|
+
.option('dest', {
|
|
624
|
+
type: 'string',
|
|
625
|
+
describe: 'Sandbox fetch: write the pulled files to this path instead of the workspace — no baseline/HEAD update, no conflict checks. An existing directory, a path ending in "/", or any multi-file match mirrors remote paths beneath it; with exactly one matching file, a plain file path is written as-is. Example: --path customers.csv --dest pulled/',
|
|
626
|
+
})
|
|
627
|
+
.option('concurrency', {
|
|
628
|
+
type: 'number',
|
|
629
|
+
describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
|
|
409
630
|
}), async (argv) => {
|
|
410
631
|
const { pullCommand } = await import('./functions/files/commands/pull.js');
|
|
411
632
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
@@ -424,6 +645,10 @@ function buildCli(rawArgs) {
|
|
|
424
645
|
yes: argv.yes,
|
|
425
646
|
force: argv.force,
|
|
426
647
|
paths: argv.path,
|
|
648
|
+
dest: argv.dest,
|
|
649
|
+
concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
|
|
650
|
+
? Math.floor(argv.concurrency)
|
|
651
|
+
: undefined,
|
|
427
652
|
});
|
|
428
653
|
}
|
|
429
654
|
catch (err) {
|
|
@@ -431,9 +656,17 @@ function buildCli(rawArgs) {
|
|
|
431
656
|
}
|
|
432
657
|
})
|
|
433
658
|
.command('list', 'List files in a version', (a) => a
|
|
434
|
-
.option('version', {
|
|
659
|
+
.option('version', {
|
|
660
|
+
alias: 'v',
|
|
661
|
+
type: 'string',
|
|
662
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
663
|
+
})
|
|
435
664
|
.option('search', { type: 'string', describe: 'Filter files by search query' })
|
|
436
|
-
.option('tree', {
|
|
665
|
+
.option('tree', {
|
|
666
|
+
type: 'boolean',
|
|
667
|
+
default: false,
|
|
668
|
+
describe: 'Render a nested directory tree instead of a flat list. Ignored when --json is set.',
|
|
669
|
+
}), async (argv) => {
|
|
437
670
|
const { listFilesCommand } = await import('./functions/files/commands/list.js');
|
|
438
671
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
439
672
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -450,9 +683,11 @@ function buildCli(rawArgs) {
|
|
|
450
683
|
output.error(err.error || err.message, err.code || 'LIST_FAILED');
|
|
451
684
|
}
|
|
452
685
|
})
|
|
453
|
-
.command('read', 'Read a single file from a version', (a) => a
|
|
454
|
-
|
|
455
|
-
|
|
686
|
+
.command('read', 'Read a single file from a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'File path' }).option('version', {
|
|
687
|
+
alias: 'v',
|
|
688
|
+
type: 'string',
|
|
689
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
690
|
+
}), async (argv) => {
|
|
456
691
|
const { readFileCommand } = await import('./functions/files/commands/read.js');
|
|
457
692
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
458
693
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -472,7 +707,11 @@ function buildCli(rawArgs) {
|
|
|
472
707
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
473
708
|
.option('content', { type: 'string', describe: 'Inline content to write' })
|
|
474
709
|
.option('file', { type: 'string', describe: 'Path to local file to upload' })
|
|
475
|
-
.option('version', {
|
|
710
|
+
.option('version', {
|
|
711
|
+
alias: 'v',
|
|
712
|
+
type: 'string',
|
|
713
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
714
|
+
}), async (argv) => {
|
|
476
715
|
const { writeFileCommand } = await import('./functions/files/commands/write.js');
|
|
477
716
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
478
717
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -492,9 +731,21 @@ function buildCli(rawArgs) {
|
|
|
492
731
|
})
|
|
493
732
|
.command('delete', 'Delete a single file from a version', (a) => a
|
|
494
733
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
495
|
-
.option('version', {
|
|
496
|
-
|
|
497
|
-
|
|
734
|
+
.option('version', {
|
|
735
|
+
alias: 'v',
|
|
736
|
+
type: 'string',
|
|
737
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
738
|
+
})
|
|
739
|
+
.option('yes', {
|
|
740
|
+
type: 'boolean',
|
|
741
|
+
default: false,
|
|
742
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
743
|
+
})
|
|
744
|
+
.option('dry-run', {
|
|
745
|
+
type: 'boolean',
|
|
746
|
+
default: false,
|
|
747
|
+
describe: 'Preview the delete without executing it.',
|
|
748
|
+
}), async (argv) => {
|
|
498
749
|
const { deleteFileCommand } = await import('./functions/files/commands/delete.js');
|
|
499
750
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
500
751
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -515,9 +766,21 @@ function buildCli(rawArgs) {
|
|
|
515
766
|
.command('move', 'Move/rename a file within a version (remote — does not touch local files).', (a) => a
|
|
516
767
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
517
768
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
518
|
-
.option('version', {
|
|
519
|
-
|
|
520
|
-
|
|
769
|
+
.option('version', {
|
|
770
|
+
alias: 'v',
|
|
771
|
+
type: 'string',
|
|
772
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
773
|
+
})
|
|
774
|
+
.option('yes', {
|
|
775
|
+
type: 'boolean',
|
|
776
|
+
default: false,
|
|
777
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
778
|
+
})
|
|
779
|
+
.option('dry-run', {
|
|
780
|
+
type: 'boolean',
|
|
781
|
+
default: false,
|
|
782
|
+
describe: 'Preview the move without executing it.',
|
|
783
|
+
}), async (argv) => {
|
|
521
784
|
const { moveFileCommand } = await import('./functions/files/commands/move.js');
|
|
522
785
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
523
786
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -539,7 +802,11 @@ function buildCli(rawArgs) {
|
|
|
539
802
|
.command('copy', 'Copy a single file within a version (remote — does not touch local files).', (a) => a
|
|
540
803
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
541
804
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
542
|
-
.option('version', {
|
|
805
|
+
.option('version', {
|
|
806
|
+
alias: 'v',
|
|
807
|
+
type: 'string',
|
|
808
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
809
|
+
}), async (argv) => {
|
|
543
810
|
const { copyFileCommand } = await import('./functions/files/commands/copy.js');
|
|
544
811
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
545
812
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -556,9 +823,11 @@ function buildCli(rawArgs) {
|
|
|
556
823
|
output.error(err.error || err.message, err.code || 'COPY_FAILED');
|
|
557
824
|
}
|
|
558
825
|
})
|
|
559
|
-
.command('create-folder', 'Create a folder in a version', (a) => a
|
|
560
|
-
|
|
561
|
-
|
|
826
|
+
.command('create-folder', 'Create a folder in a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'Folder path' }).option('version', {
|
|
827
|
+
alias: 'v',
|
|
828
|
+
type: 'string',
|
|
829
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
830
|
+
}), async (argv) => {
|
|
562
831
|
const { createFolderCommand } = await import('./functions/files/commands/create-folder.js');
|
|
563
832
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
564
833
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -588,10 +857,26 @@ function buildCli(rawArgs) {
|
|
|
588
857
|
}
|
|
589
858
|
})
|
|
590
859
|
.command('copy', 'Snapshot all files from one version into another (creates the target, or replaces its contents if it already exists)', (a) => a
|
|
591
|
-
.option('from', {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
860
|
+
.option('from', {
|
|
861
|
+
type: 'string',
|
|
862
|
+
demandOption: true,
|
|
863
|
+
describe: 'Source version to copy files from',
|
|
864
|
+
})
|
|
865
|
+
.option('to', {
|
|
866
|
+
type: 'string',
|
|
867
|
+
demandOption: true,
|
|
868
|
+
describe: 'Target version id — created if new, otherwise its contents are replaced',
|
|
869
|
+
})
|
|
870
|
+
.option('yes', {
|
|
871
|
+
type: 'boolean',
|
|
872
|
+
default: false,
|
|
873
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
874
|
+
})
|
|
875
|
+
.option('dry-run', {
|
|
876
|
+
type: 'boolean',
|
|
877
|
+
default: false,
|
|
878
|
+
describe: 'Preview the copy without executing it.',
|
|
879
|
+
}), async (argv) => {
|
|
595
880
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
596
881
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
597
882
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -610,8 +895,16 @@ function buildCli(rawArgs) {
|
|
|
610
895
|
})
|
|
611
896
|
.command('delete <id>', 'Delete a version', (a) => a
|
|
612
897
|
.positional('id', { type: 'string', demandOption: true, describe: 'Version id to delete' })
|
|
613
|
-
.option('yes', {
|
|
614
|
-
|
|
898
|
+
.option('yes', {
|
|
899
|
+
type: 'boolean',
|
|
900
|
+
default: false,
|
|
901
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
902
|
+
})
|
|
903
|
+
.option('dry-run', {
|
|
904
|
+
type: 'boolean',
|
|
905
|
+
default: false,
|
|
906
|
+
describe: 'Preview the delete without executing it.',
|
|
907
|
+
}), async (argv) => {
|
|
615
908
|
const { deleteVersionCommand } = await import('./functions/files/commands/versions/delete.js');
|
|
616
909
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
617
910
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -634,8 +927,15 @@ function buildCli(rawArgs) {
|
|
|
634
927
|
.command('set', 'Create or update dcupl.config.json + dcupl.secrets.json. Interactive by default; flags skip prompts.', (a) => a
|
|
635
928
|
.option('project-id', { type: 'string', describe: 'dcupl Console project id' })
|
|
636
929
|
.option('api-key', { type: 'string', describe: 'dcupl Console API key' })
|
|
637
|
-
.option('console-api-url', {
|
|
638
|
-
|
|
930
|
+
.option('console-api-url', {
|
|
931
|
+
type: 'string',
|
|
932
|
+
describe: 'Override console API URL (for self-hosted / internal dev; leave unset for default)',
|
|
933
|
+
})
|
|
934
|
+
.option('yes', {
|
|
935
|
+
type: 'boolean',
|
|
936
|
+
default: false,
|
|
937
|
+
describe: 'Non-interactive mode. Requires --project-id and --api-key (or existing values in the files).',
|
|
938
|
+
}), async (argv) => {
|
|
639
939
|
const { configSetCommand } = await import('./functions/config/commands/set.js');
|
|
640
940
|
try {
|
|
641
941
|
await configSetCommand({
|
|
@@ -646,12 +946,14 @@ function buildCli(rawArgs) {
|
|
|
646
946
|
});
|
|
647
947
|
}
|
|
648
948
|
catch (err) {
|
|
649
|
-
|
|
650
|
-
process.exit(1);
|
|
949
|
+
(0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_SET_FAILED');
|
|
651
950
|
}
|
|
652
951
|
})
|
|
653
|
-
.command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a
|
|
654
|
-
|
|
952
|
+
.command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a.option('show-secrets', {
|
|
953
|
+
type: 'boolean',
|
|
954
|
+
default: false,
|
|
955
|
+
describe: 'Reveal apiKey instead of ***last4',
|
|
956
|
+
}), async (argv) => {
|
|
655
957
|
const { configGetCommand } = await import('./functions/config/commands/get.js');
|
|
656
958
|
try {
|
|
657
959
|
await configGetCommand({
|
|
@@ -660,26 +962,51 @@ function buildCli(rawArgs) {
|
|
|
660
962
|
});
|
|
661
963
|
}
|
|
662
964
|
catch (err) {
|
|
663
|
-
|
|
664
|
-
process.exit(1);
|
|
965
|
+
(0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_GET_FAILED');
|
|
665
966
|
}
|
|
666
967
|
})
|
|
667
968
|
.demandCommand(1);
|
|
668
969
|
})
|
|
669
970
|
.command('validate', 'Load a whole project (local workspace or remote) and report its health — errors, empty models, auto-generated models. Exits 0 whenever a report is produced.', (a) => a
|
|
670
|
-
.option('source', {
|
|
971
|
+
.option('source', {
|
|
972
|
+
type: 'string',
|
|
973
|
+
choices: ['local', 'remote'],
|
|
974
|
+
describe: 'Project source (inferred when omitted)',
|
|
975
|
+
})
|
|
671
976
|
.option('lc-json', { type: 'string', describe: 'Loader config path (local source)' })
|
|
672
|
-
.option('auto-serve', {
|
|
977
|
+
.option('auto-serve', {
|
|
978
|
+
type: 'boolean',
|
|
979
|
+
describe: 'Auto-spawn dcupl serve for local source (default: on; throwaway, auto-cleaned). Use --no-auto-serve to opt out.',
|
|
980
|
+
})
|
|
673
981
|
.option('project-id', { type: 'string', describe: 'Console project id (remote source)' })
|
|
674
982
|
.option('api-key', { type: 'string', describe: 'Console API key (remote source)' })
|
|
675
983
|
.option('version', { type: 'string', describe: 'Console version id (remote source, default: draft)' })
|
|
984
|
+
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
676
985
|
.option('app-key', { type: 'string', describe: 'Application key for the process step' })
|
|
677
|
-
.option('env', {
|
|
986
|
+
.option('env', {
|
|
987
|
+
type: 'array',
|
|
988
|
+
string: true,
|
|
989
|
+
describe: 'Environment keys for the process step (repeatable)',
|
|
990
|
+
})
|
|
678
991
|
.option('tag', { type: 'array', string: true, describe: 'Resource tags for the process step (repeatable)' })
|
|
679
|
-
.option('var', {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
992
|
+
.option('var', {
|
|
993
|
+
type: 'array',
|
|
994
|
+
string: true,
|
|
995
|
+
describe: 'Variables KEY=VALUE for the process step (repeatable)',
|
|
996
|
+
})
|
|
997
|
+
.option('limit', {
|
|
998
|
+
type: 'number',
|
|
999
|
+
default: 10,
|
|
1000
|
+
describe: 'Max error records in the report (top findings)',
|
|
1001
|
+
})
|
|
1002
|
+
.option('quality', {
|
|
1003
|
+
type: 'boolean',
|
|
1004
|
+
describe: 'Enable model & data quality checks incl. error tracking (default: true). Use --quality false for a structural-only load.',
|
|
1005
|
+
})
|
|
1006
|
+
.option('max-memory', {
|
|
1007
|
+
type: 'number',
|
|
1008
|
+
describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
|
|
1009
|
+
}), async (argv) => {
|
|
683
1010
|
const { validateCommand } = await import('./functions/app/commands/validate.js');
|
|
684
1011
|
const output = (0, output_1.createOutput)(argv.json);
|
|
685
1012
|
try {
|
|
@@ -690,6 +1017,7 @@ function buildCli(rawArgs) {
|
|
|
690
1017
|
projectId: argv['project-id'],
|
|
691
1018
|
apiKey: argv['api-key'],
|
|
692
1019
|
version: argv.version,
|
|
1020
|
+
cdnBaseUrl: argv['cdn-base-url'],
|
|
693
1021
|
appKey: argv['app-key'],
|
|
694
1022
|
env: argv.env,
|
|
695
1023
|
tag: argv.tag,
|
|
@@ -704,40 +1032,123 @@ function buildCli(rawArgs) {
|
|
|
704
1032
|
}
|
|
705
1033
|
})
|
|
706
1034
|
.command('app <subcommand>', 'Run local dcupl daemons to query and analyze tabular data', (yy) => {
|
|
707
|
-
return yy
|
|
1035
|
+
return (yy
|
|
708
1036
|
.command('create', 'Start a new daemon and register an app', (a) => a
|
|
709
1037
|
.option('app', { type: 'string', describe: 'App id (auto-generated if omitted)' })
|
|
710
1038
|
.option('idle-timeout', { type: 'number', default: 30, describe: 'Idle timeout in minutes' })
|
|
711
|
-
.option('auto-update', {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
1039
|
+
.option('auto-update', {
|
|
1040
|
+
type: 'boolean',
|
|
1041
|
+
default: false,
|
|
1042
|
+
describe: 'Auto-run update() after every mutation. Default (off): mutations stage changes, run `dcupl app build` to apply (mirrors the SDK).',
|
|
1043
|
+
})
|
|
1044
|
+
.option('auto-generate-properties', {
|
|
1045
|
+
type: 'boolean',
|
|
1046
|
+
default: false,
|
|
1047
|
+
describe: 'Infer model schema from the data on first ingest. Daemon-wide default; override per call on `app data <verb>`.',
|
|
1048
|
+
})
|
|
1049
|
+
.option('auto-generate-deep', {
|
|
1050
|
+
type: 'boolean',
|
|
1051
|
+
default: false,
|
|
1052
|
+
describe: 'When inferring model schema, walk every row and reconcile types (handles row-1 blanks). Implies --auto-generate-properties.',
|
|
1053
|
+
})
|
|
1054
|
+
.option('auto-generate-sample-size', {
|
|
1055
|
+
type: 'number',
|
|
1056
|
+
describe: 'When inferring model schema, sample at most N rows (implies deep). Useful for large CSVs where row 1 may not represent the schema.',
|
|
1057
|
+
})
|
|
1058
|
+
.option('quality', {
|
|
1059
|
+
type: 'boolean',
|
|
1060
|
+
describe: 'Enable model & data quality checks (default: true). Use `--quality false` to opt out.',
|
|
1061
|
+
})
|
|
716
1062
|
.option('cache', { type: 'boolean', describe: 'Enable internal API caching (default: true)' })
|
|
717
|
-
.option('clone', {
|
|
718
|
-
|
|
719
|
-
|
|
1063
|
+
.option('clone', {
|
|
1064
|
+
type: 'boolean',
|
|
1065
|
+
describe: 'Enable deep data clones to avoid mutation side-effects (default: false)',
|
|
1066
|
+
})
|
|
1067
|
+
.option('analytics', {
|
|
1068
|
+
type: 'boolean',
|
|
1069
|
+
describe: 'Enable analytics instrumentation (default: true)',
|
|
1070
|
+
})
|
|
1071
|
+
.option('reference-metadata', {
|
|
1072
|
+
type: 'boolean',
|
|
1073
|
+
describe: 'Enable reference metadata resolution (default: true)',
|
|
1074
|
+
})
|
|
720
1075
|
.option('logging-level', { type: 'string', choices: init_options_js_1.LOG_LEVELS, describe: 'Minimum SDK log level' })
|
|
721
|
-
.option('logging-format', {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
1076
|
+
.option('logging-format', {
|
|
1077
|
+
type: 'string',
|
|
1078
|
+
choices: [...init_options_js_1.LOG_FORMATS],
|
|
1079
|
+
describe: 'SDK log output format',
|
|
1080
|
+
})
|
|
1081
|
+
.option('max-memory', {
|
|
1082
|
+
type: 'number',
|
|
1083
|
+
describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
|
|
1084
|
+
})
|
|
1085
|
+
.option('max-body', {
|
|
1086
|
+
type: 'string',
|
|
1087
|
+
default: '2gb',
|
|
1088
|
+
describe: 'Max request body size, e.g. 2gb, 500mb',
|
|
1089
|
+
})
|
|
1090
|
+
.option('load', {
|
|
1091
|
+
type: 'boolean',
|
|
1092
|
+
describe: 'After creating the daemon, register, process, and build a loader so the app is immediately queryable',
|
|
1093
|
+
})
|
|
725
1094
|
.option('key', { type: 'string', describe: 'Loader key for --load (auto-generated if omitted)' })
|
|
726
|
-
.option('source', {
|
|
727
|
-
|
|
728
|
-
|
|
1095
|
+
.option('source', {
|
|
1096
|
+
type: 'string',
|
|
1097
|
+
choices: ['local', 'remote', 'url'],
|
|
1098
|
+
describe: 'Loader source for --load (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
|
|
1099
|
+
})
|
|
1100
|
+
.option('workspace', {
|
|
1101
|
+
type: 'boolean',
|
|
1102
|
+
describe: 'Use local dcupl workspace as loader source (--load)',
|
|
1103
|
+
})
|
|
1104
|
+
.option('project-id', {
|
|
1105
|
+
type: 'string',
|
|
1106
|
+
describe: 'dcupl Console project id (cdn loader source, --load). CDN host: see --cdn-base-url',
|
|
1107
|
+
})
|
|
729
1108
|
.option('api-key', { type: 'string', describe: 'Console API key (--load)' })
|
|
730
|
-
.option('version', {
|
|
1109
|
+
.option('version', {
|
|
1110
|
+
type: 'string',
|
|
1111
|
+
describe: 'Console version id (cdn loader source, default: draft)',
|
|
1112
|
+
})
|
|
1113
|
+
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
731
1114
|
.option('base-url', { type: 'string', describe: 'Custom base URL loader source (--load)' })
|
|
732
|
-
.option('loader-file', {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
.option('
|
|
1115
|
+
.option('loader-file', {
|
|
1116
|
+
type: 'string',
|
|
1117
|
+
describe: 'Loader file name for base-url source (--load)',
|
|
1118
|
+
})
|
|
1119
|
+
.option('header', {
|
|
1120
|
+
type: 'array',
|
|
1121
|
+
string: true,
|
|
1122
|
+
describe: 'HTTP headers for base-url source KEY=VALUE (repeatable, --load)',
|
|
1123
|
+
})
|
|
1124
|
+
.option('lc-json', {
|
|
1125
|
+
type: 'string',
|
|
1126
|
+
describe: 'Path to loader config file (workspace source, --load)',
|
|
1127
|
+
})
|
|
1128
|
+
.option('auto-serve', {
|
|
1129
|
+
type: 'boolean',
|
|
1130
|
+
describe: 'Auto-spawn dcupl serve if not running (workspace source, --load)',
|
|
1131
|
+
})
|
|
1132
|
+
.option('auto-serve-port', {
|
|
1133
|
+
type: 'string',
|
|
1134
|
+
describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned (--load)',
|
|
1135
|
+
})
|
|
737
1136
|
.option('app-key', { type: 'string', describe: 'Application key for process step (--load)' })
|
|
738
|
-
.option('env', {
|
|
739
|
-
|
|
740
|
-
|
|
1137
|
+
.option('env', {
|
|
1138
|
+
type: 'array',
|
|
1139
|
+
string: true,
|
|
1140
|
+
describe: 'Environment keys for process step (repeatable, --load)',
|
|
1141
|
+
})
|
|
1142
|
+
.option('tag', {
|
|
1143
|
+
type: 'array',
|
|
1144
|
+
string: true,
|
|
1145
|
+
describe: 'Resource tags for process step (repeatable, comma-separate for AND, --load)',
|
|
1146
|
+
})
|
|
1147
|
+
.option('var', {
|
|
1148
|
+
type: 'array',
|
|
1149
|
+
string: true,
|
|
1150
|
+
describe: 'Variables KEY=VALUE for process step (repeatable, --load)',
|
|
1151
|
+
}), async (argv) => {
|
|
741
1152
|
const { createCommand } = await import('./functions/app/commands/create.js');
|
|
742
1153
|
const output = (0, output_1.createOutput)(argv.json);
|
|
743
1154
|
try {
|
|
@@ -765,6 +1176,7 @@ function buildCli(rawArgs) {
|
|
|
765
1176
|
projectId: argv['project-id'],
|
|
766
1177
|
apiKey: argv['api-key'],
|
|
767
1178
|
version: argv.version,
|
|
1179
|
+
cdnBaseUrl: argv['cdn-base-url'],
|
|
768
1180
|
baseUrl: argv['base-url'],
|
|
769
1181
|
loaderFile: argv['loader-file'],
|
|
770
1182
|
header: argv.header,
|
|
@@ -781,12 +1193,14 @@ function buildCli(rawArgs) {
|
|
|
781
1193
|
});
|
|
782
1194
|
}
|
|
783
1195
|
catch (err) {
|
|
784
|
-
output.error(err.message, err.code || 'CREATE_FAILED');
|
|
1196
|
+
output.error(err.message, err.code || 'CREATE_FAILED', err.details === undefined ? undefined : { details: err.details });
|
|
785
1197
|
}
|
|
786
1198
|
})
|
|
787
|
-
.command('destroy', 'Stop a daemon', (a) => a
|
|
788
|
-
|
|
789
|
-
|
|
1199
|
+
.command('destroy', 'Stop a daemon', (a) => a.option('app', { type: 'string' }).option('keep-logs', {
|
|
1200
|
+
type: 'boolean',
|
|
1201
|
+
default: false,
|
|
1202
|
+
describe: 'Keep the daemon log file after destroy',
|
|
1203
|
+
}), async (argv) => {
|
|
790
1204
|
const { destroyCommand } = await import('./functions/app/commands/destroy.js');
|
|
791
1205
|
const output = (0, output_1.createOutput)(argv.json);
|
|
792
1206
|
try {
|
|
@@ -862,12 +1276,17 @@ function buildCli(rawArgs) {
|
|
|
862
1276
|
.command('set', 'Set a model from a JSON file or inline content', (a) => a
|
|
863
1277
|
.option('app', { type: 'string' })
|
|
864
1278
|
.option('file', { type: 'string', describe: 'Path to model JSON file' })
|
|
865
|
-
.option('content', {
|
|
1279
|
+
.option('content', {
|
|
1280
|
+
type: 'string',
|
|
1281
|
+
describe: 'Inline JSON model definition (use "-" to read from stdin)',
|
|
1282
|
+
}), async (argv) => {
|
|
866
1283
|
const { setCommand } = await import('./functions/app/commands/models/set.js');
|
|
867
1284
|
const output = (0, output_1.createOutput)(argv.json);
|
|
868
1285
|
try {
|
|
869
1286
|
const content = argv.content !== undefined
|
|
870
|
-
?
|
|
1287
|
+
? argv.content === '' && argv._.includes('-')
|
|
1288
|
+
? '-'
|
|
1289
|
+
: argv.content
|
|
871
1290
|
: undefined;
|
|
872
1291
|
await setCommand(output, { appId: argv.app, file: argv.file, content });
|
|
873
1292
|
}
|
|
@@ -889,26 +1308,46 @@ function buildCli(rawArgs) {
|
|
|
889
1308
|
.command('data <verb>', 'Ingest data', (yyy) => {
|
|
890
1309
|
const dataOpts = (a) => a
|
|
891
1310
|
.option('app', { type: 'string' })
|
|
892
|
-
.option('file', {
|
|
1311
|
+
.option('file', {
|
|
1312
|
+
type: 'string',
|
|
1313
|
+
describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest',
|
|
1314
|
+
})
|
|
893
1315
|
.option('url', { type: 'string', describe: 'Remote URL to fetch the data payload from' })
|
|
894
1316
|
.option('content', { type: 'string', describe: 'Inline payload (use "-" to read from stdin)' })
|
|
895
1317
|
.option('format', { type: 'string', choices: ['csv', 'json', 'ndjson'] })
|
|
896
1318
|
.option('model', { type: 'string', demandOption: true })
|
|
897
1319
|
.option('key-property', { type: 'string' })
|
|
898
1320
|
.option('auto-generate-key', { type: 'boolean', default: false })
|
|
899
|
-
.option('auto-generate-properties', {
|
|
900
|
-
|
|
901
|
-
|
|
1321
|
+
.option('auto-generate-properties', {
|
|
1322
|
+
type: 'boolean',
|
|
1323
|
+
describe: 'Override daemon default for this call (use --no-auto-generate-properties to force off)',
|
|
1324
|
+
})
|
|
1325
|
+
.option('auto-generate-deep', {
|
|
1326
|
+
type: 'boolean',
|
|
1327
|
+
describe: 'Walk every row when inferring (implies --auto-generate-properties)',
|
|
1328
|
+
})
|
|
1329
|
+
.option('auto-generate-sample-size', {
|
|
1330
|
+
type: 'number',
|
|
1331
|
+
describe: 'Sample N rows when inferring (implies deep)',
|
|
1332
|
+
});
|
|
902
1333
|
const handler = (mod, exportName, code) => async (argv) => {
|
|
903
1334
|
const m = await import(`./functions/app/commands/data/${mod}.js`);
|
|
904
1335
|
const output = (0, output_1.createOutput)(argv.json);
|
|
905
1336
|
try {
|
|
906
1337
|
const content = argv.content !== undefined
|
|
907
|
-
?
|
|
1338
|
+
? argv.content === '' && argv._.includes('-')
|
|
1339
|
+
? '-'
|
|
1340
|
+
: argv.content
|
|
908
1341
|
: undefined;
|
|
909
1342
|
await m[exportName](output, {
|
|
910
|
-
appId: argv.app,
|
|
911
|
-
|
|
1343
|
+
appId: argv.app,
|
|
1344
|
+
file: argv.file,
|
|
1345
|
+
url: argv.url,
|
|
1346
|
+
content,
|
|
1347
|
+
format: argv.format,
|
|
1348
|
+
model: argv.model,
|
|
1349
|
+
keyProperty: argv.keyProperty,
|
|
1350
|
+
autoGenerateKey: argv.autoGenerateKey,
|
|
912
1351
|
autoGenerateProperties: argv.autoGenerateProperties,
|
|
913
1352
|
autoGenerateDeep: argv.autoGenerateDeep,
|
|
914
1353
|
autoGenerateSampleSize: argv.autoGenerateSampleSize,
|
|
@@ -936,7 +1375,10 @@ function buildCli(rawArgs) {
|
|
|
936
1375
|
.demandCommand(1);
|
|
937
1376
|
})
|
|
938
1377
|
.command('query <verb>', 'Query records', (yyy) => yyy
|
|
939
|
-
.command('one', 'Fetch single record', (a) => a
|
|
1378
|
+
.command('one', 'Fetch single record', (a) => a
|
|
1379
|
+
.option('app', { type: 'string' })
|
|
1380
|
+
.option('model', { type: 'string', demandOption: true })
|
|
1381
|
+
.option('item-key', { type: 'string', demandOption: true }), async (argv) => {
|
|
940
1382
|
const { oneCommand } = await import('./functions/app/commands/query/one.js');
|
|
941
1383
|
const output = (0, output_1.createOutput)(argv.json);
|
|
942
1384
|
try {
|
|
@@ -959,9 +1401,13 @@ function buildCli(rawArgs) {
|
|
|
959
1401
|
const output = (0, output_1.createOutput)(argv.json);
|
|
960
1402
|
try {
|
|
961
1403
|
await executeCommand(output, {
|
|
962
|
-
appId: argv.app,
|
|
963
|
-
|
|
964
|
-
|
|
1404
|
+
appId: argv.app,
|
|
1405
|
+
model: argv.model,
|
|
1406
|
+
query: argv.query,
|
|
1407
|
+
queryFile: argv.queryFile,
|
|
1408
|
+
sort: argv.sort,
|
|
1409
|
+
limit: argv.limit,
|
|
1410
|
+
start: argv.start,
|
|
965
1411
|
projection: argv.projection,
|
|
966
1412
|
});
|
|
967
1413
|
}
|
|
@@ -986,15 +1432,32 @@ function buildCli(rawArgs) {
|
|
|
986
1432
|
choices: ['size-desc', 'size-asc', 'value-asc', 'value-desc'],
|
|
987
1433
|
describe: 'Deterministic ordering (opt-in; walks all keys). Use size-desc for top-N-by-count.',
|
|
988
1434
|
})
|
|
989
|
-
.option('full', {
|
|
990
|
-
|
|
1435
|
+
.option('full', {
|
|
1436
|
+
type: 'boolean',
|
|
1437
|
+
default: false,
|
|
1438
|
+
describe: 'Return full SDK facet shape (resultKeys, entry, enabled, selected)',
|
|
1439
|
+
})
|
|
1440
|
+
.option('include-results', {
|
|
1441
|
+
type: 'boolean',
|
|
1442
|
+
default: false,
|
|
1443
|
+
describe: 'Keep resultKeys in compact output',
|
|
1444
|
+
}), async (argv) => {
|
|
991
1445
|
const { facetsCommand } = await import('./functions/app/commands/fn/facets.js');
|
|
992
1446
|
const output = (0, output_1.createOutput)(argv.json);
|
|
993
1447
|
try {
|
|
994
1448
|
await facetsCommand(output, {
|
|
995
|
-
appId: argv.app,
|
|
996
|
-
|
|
997
|
-
|
|
1449
|
+
appId: argv.app,
|
|
1450
|
+
model: argv.model,
|
|
1451
|
+
attribute: argv.attribute,
|
|
1452
|
+
excludeZeros: argv.excludeZeros,
|
|
1453
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1454
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1455
|
+
query: argv.query,
|
|
1456
|
+
queryFile: argv.queryFile,
|
|
1457
|
+
limit: argv.limit,
|
|
1458
|
+
sort: argv.sort,
|
|
1459
|
+
full: argv.full,
|
|
1460
|
+
includeResults: argv.includeResults,
|
|
998
1461
|
});
|
|
999
1462
|
}
|
|
1000
1463
|
catch (err) {
|
|
@@ -1005,11 +1468,21 @@ function buildCli(rawArgs) {
|
|
|
1005
1468
|
.option('app', { type: 'string' })
|
|
1006
1469
|
.option('model', { type: 'string', demandOption: true })
|
|
1007
1470
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1008
|
-
.option('types', {
|
|
1471
|
+
.option('types', {
|
|
1472
|
+
type: 'string',
|
|
1473
|
+
describe: 'Comma-separated: distinct,count,sum,avg,min,max,group. Optional when --bins/--group-options supply grouping.',
|
|
1474
|
+
})
|
|
1009
1475
|
.option('query', { type: 'string' })
|
|
1010
1476
|
.option('query-file', { type: 'string' })
|
|
1011
|
-
.option('include-keys', {
|
|
1012
|
-
|
|
1477
|
+
.option('include-keys', {
|
|
1478
|
+
type: 'boolean',
|
|
1479
|
+
default: false,
|
|
1480
|
+
describe: 'Include row keys in distinct results',
|
|
1481
|
+
})
|
|
1482
|
+
.option('bins', {
|
|
1483
|
+
type: 'string',
|
|
1484
|
+
describe: 'Numeric ranges for grouping, e.g. 0-100,100-200,200-',
|
|
1485
|
+
})
|
|
1013
1486
|
.option('group-options', { type: 'string', describe: 'Full groupOptions JSON' })
|
|
1014
1487
|
.option('group-options-file', { type: 'string', describe: 'Path to groupOptions JSON' })
|
|
1015
1488
|
.option('distinct-limit', { type: 'number', describe: 'Cap distinct values' })
|
|
@@ -1020,10 +1493,20 @@ function buildCli(rawArgs) {
|
|
|
1020
1493
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1021
1494
|
try {
|
|
1022
1495
|
await aggregateCommand(output, {
|
|
1023
|
-
appId: argv.app,
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1496
|
+
appId: argv.app,
|
|
1497
|
+
model: argv.model,
|
|
1498
|
+
attribute: argv.attribute,
|
|
1499
|
+
types: argv.types,
|
|
1500
|
+
query: argv.query,
|
|
1501
|
+
queryFile: argv.queryFile,
|
|
1502
|
+
includeKeys: argv.includeKeys,
|
|
1503
|
+
bins: argv.bins,
|
|
1504
|
+
groupOptions: argv.groupOptions,
|
|
1505
|
+
groupOptionsFile: argv.groupOptionsFile,
|
|
1506
|
+
distinctLimit: argv.distinctLimit,
|
|
1507
|
+
excludeZeros: argv.excludeZeros,
|
|
1508
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1509
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1027
1510
|
});
|
|
1028
1511
|
}
|
|
1029
1512
|
catch (err) {
|
|
@@ -1036,7 +1519,10 @@ function buildCli(rawArgs) {
|
|
|
1036
1519
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1037
1520
|
.option('query', { type: 'string' })
|
|
1038
1521
|
.option('query-file', { type: 'string' })
|
|
1039
|
-
.option('aggregate', {
|
|
1522
|
+
.option('aggregate', {
|
|
1523
|
+
type: 'array',
|
|
1524
|
+
describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.',
|
|
1525
|
+
})
|
|
1040
1526
|
.option('exclude-zeros', { type: 'boolean' })
|
|
1041
1527
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1042
1528
|
.option('exclude-unresolved', { type: 'boolean' })
|
|
@@ -1047,9 +1533,18 @@ function buildCli(rawArgs) {
|
|
|
1047
1533
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1048
1534
|
try {
|
|
1049
1535
|
await groupByCommand(output, {
|
|
1050
|
-
appId: argv.app,
|
|
1051
|
-
|
|
1052
|
-
|
|
1536
|
+
appId: argv.app,
|
|
1537
|
+
model: argv.model,
|
|
1538
|
+
attribute: argv.attribute,
|
|
1539
|
+
query: argv.query,
|
|
1540
|
+
queryFile: argv.queryFile,
|
|
1541
|
+
aggregate: argv.aggregate,
|
|
1542
|
+
excludeZeros: argv.excludeZeros,
|
|
1543
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1544
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1545
|
+
sort: argv.sort,
|
|
1546
|
+
limit: argv.limit,
|
|
1547
|
+
start: argv.start,
|
|
1053
1548
|
});
|
|
1054
1549
|
}
|
|
1055
1550
|
catch (err) {
|
|
@@ -1064,7 +1559,12 @@ function buildCli(rawArgs) {
|
|
|
1064
1559
|
const { metadataCommand } = await import('./functions/app/commands/fn/metadata.js');
|
|
1065
1560
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1066
1561
|
try {
|
|
1067
|
-
await metadataCommand(output, {
|
|
1562
|
+
await metadataCommand(output, {
|
|
1563
|
+
appId: argv.app,
|
|
1564
|
+
model: argv.model,
|
|
1565
|
+
query: argv.query,
|
|
1566
|
+
queryFile: argv.queryFile,
|
|
1567
|
+
});
|
|
1068
1568
|
}
|
|
1069
1569
|
catch (err) {
|
|
1070
1570
|
output.error(err.message, err.code || 'FN_METADATA_FAILED');
|
|
@@ -1073,11 +1573,20 @@ function buildCli(rawArgs) {
|
|
|
1073
1573
|
.command('pivot', 'Multi-dimensional cross-tab (rows x columns x values)', (a) => a
|
|
1074
1574
|
.option('app', { type: 'string' })
|
|
1075
1575
|
.option('model', { type: 'string', demandOption: true })
|
|
1076
|
-
.option('rows', {
|
|
1077
|
-
|
|
1576
|
+
.option('rows', {
|
|
1577
|
+
type: 'array',
|
|
1578
|
+
describe: 'Row attribute(s); append :totals for row totals. Repeatable.',
|
|
1579
|
+
})
|
|
1580
|
+
.option('columns', {
|
|
1581
|
+
type: 'array',
|
|
1582
|
+
describe: 'Column attribute(s); append :totals. Repeatable.',
|
|
1583
|
+
})
|
|
1078
1584
|
.option('values', { type: 'array', describe: 'Aggregations <attr>:<type[,type]>. Repeatable.' })
|
|
1079
1585
|
.option('totals', { type: 'boolean', describe: 'Compute grand totals' })
|
|
1080
|
-
.option('spec', {
|
|
1586
|
+
.option('spec', {
|
|
1587
|
+
type: 'string',
|
|
1588
|
+
describe: 'Full PivotOptions JSON (mutually exclusive with shorthand flags)',
|
|
1589
|
+
})
|
|
1081
1590
|
.option('spec-file', { type: 'string', describe: 'Path to PivotOptions JSON' })
|
|
1082
1591
|
.option('query', { type: 'string' })
|
|
1083
1592
|
.option('query-file', { type: 'string' }), async (argv) => {
|
|
@@ -1085,10 +1594,16 @@ function buildCli(rawArgs) {
|
|
|
1085
1594
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1086
1595
|
try {
|
|
1087
1596
|
await pivotCommand(output, {
|
|
1088
|
-
appId: argv.app,
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1597
|
+
appId: argv.app,
|
|
1598
|
+
model: argv.model,
|
|
1599
|
+
rows: argv.rows,
|
|
1600
|
+
columns: argv.columns,
|
|
1601
|
+
values: argv.values,
|
|
1602
|
+
totals: argv.totals,
|
|
1603
|
+
spec: argv.spec,
|
|
1604
|
+
specFile: argv.specFile,
|
|
1605
|
+
query: argv.query,
|
|
1606
|
+
queryFile: argv.queryFile,
|
|
1092
1607
|
});
|
|
1093
1608
|
}
|
|
1094
1609
|
catch (err) {
|
|
@@ -1101,7 +1616,10 @@ function buildCli(rawArgs) {
|
|
|
1101
1616
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1102
1617
|
.option('value', { type: 'string', demandOption: true })
|
|
1103
1618
|
.option('max', { type: 'number' })
|
|
1104
|
-
.option('relevant-data', {
|
|
1619
|
+
.option('relevant-data', {
|
|
1620
|
+
type: 'string',
|
|
1621
|
+
choices: ['filtered', 'all', 'excludeQuery'],
|
|
1622
|
+
})
|
|
1105
1623
|
.option('calculate-result-keys', { type: 'boolean' })
|
|
1106
1624
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1107
1625
|
.option('exclude-nulls', { type: 'boolean' })
|
|
@@ -1113,11 +1631,19 @@ function buildCli(rawArgs) {
|
|
|
1113
1631
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1114
1632
|
try {
|
|
1115
1633
|
await suggestCommand(output, {
|
|
1116
|
-
appId: argv.app,
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1634
|
+
appId: argv.app,
|
|
1635
|
+
model: argv.model,
|
|
1636
|
+
attribute: argv.attribute,
|
|
1637
|
+
value: argv.value,
|
|
1638
|
+
max: argv.max,
|
|
1639
|
+
relevantData: argv.relevantData,
|
|
1640
|
+
calculateResultKeys: argv.calculateResultKeys,
|
|
1641
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1642
|
+
excludeNulls: argv.excludeNulls,
|
|
1643
|
+
excludeQuery: argv.excludeQuery,
|
|
1644
|
+
excludeQueryFile: argv.excludeQueryFile,
|
|
1645
|
+
query: argv.query,
|
|
1646
|
+
queryFile: argv.queryFile,
|
|
1121
1647
|
});
|
|
1122
1648
|
}
|
|
1123
1649
|
catch (err) {
|
|
@@ -1129,17 +1655,38 @@ function buildCli(rawArgs) {
|
|
|
1129
1655
|
.command('add', 'Register a loader source', (a) => a
|
|
1130
1656
|
.option('app', { type: 'string', describe: 'App id' })
|
|
1131
1657
|
.option('key', { type: 'string', describe: 'Loader key (auto-generated if omitted)' })
|
|
1132
|
-
.option('source', {
|
|
1658
|
+
.option('source', {
|
|
1659
|
+
type: 'string',
|
|
1660
|
+
choices: ['local', 'remote', 'url'],
|
|
1661
|
+
describe: 'Loader source (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
|
|
1662
|
+
})
|
|
1133
1663
|
.option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as source' })
|
|
1134
|
-
.option('project-id', {
|
|
1664
|
+
.option('project-id', {
|
|
1665
|
+
type: 'string',
|
|
1666
|
+
describe: 'dcupl Console project id (cdn source). CDN host: see --cdn-base-url',
|
|
1667
|
+
})
|
|
1135
1668
|
.option('api-key', { type: 'string', describe: 'Console API key' })
|
|
1136
|
-
.option('version', {
|
|
1669
|
+
.option('version', {
|
|
1670
|
+
type: 'string',
|
|
1671
|
+
describe: 'Console version id (cdn source, default: draft)',
|
|
1672
|
+
})
|
|
1673
|
+
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
1137
1674
|
.option('base-url', { type: 'string', describe: 'Custom base URL source' })
|
|
1138
1675
|
.option('loader-file', { type: 'string', describe: 'Loader file name for base-url source' })
|
|
1139
|
-
.option('header', {
|
|
1676
|
+
.option('header', {
|
|
1677
|
+
type: 'array',
|
|
1678
|
+
string: true,
|
|
1679
|
+
describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)',
|
|
1680
|
+
})
|
|
1140
1681
|
.option('lc-json', { type: 'string', describe: 'Path to loader config (workspace source)' })
|
|
1141
|
-
.option('auto-serve', {
|
|
1142
|
-
|
|
1682
|
+
.option('auto-serve', {
|
|
1683
|
+
type: 'boolean',
|
|
1684
|
+
describe: 'Auto-spawn dcupl serve if not running (workspace source)',
|
|
1685
|
+
})
|
|
1686
|
+
.option('auto-serve-port', {
|
|
1687
|
+
type: 'string',
|
|
1688
|
+
describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned',
|
|
1689
|
+
}), async (argv) => {
|
|
1143
1690
|
const { addLoaderCommand } = await import('./functions/app/commands/loaders/add.js');
|
|
1144
1691
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1145
1692
|
try {
|
|
@@ -1152,6 +1699,7 @@ function buildCli(rawArgs) {
|
|
|
1152
1699
|
projectId: argv['project-id'],
|
|
1153
1700
|
apiKey: argv['api-key'],
|
|
1154
1701
|
version: argv.version,
|
|
1702
|
+
cdnBaseUrl: argv['cdn-base-url'],
|
|
1155
1703
|
baseUrl: argv['base-url'],
|
|
1156
1704
|
loaderFile: argv['loader-file'],
|
|
1157
1705
|
header: argv.header,
|
|
@@ -1162,7 +1710,7 @@ function buildCli(rawArgs) {
|
|
|
1162
1710
|
});
|
|
1163
1711
|
}
|
|
1164
1712
|
catch (err) {
|
|
1165
|
-
output.error(err.message, err.code || 'LOADERS_ADD_FAILED');
|
|
1713
|
+
output.error(err.message, err.code || 'LOADERS_ADD_FAILED', err.details === undefined ? undefined : { details: err.details });
|
|
1166
1714
|
}
|
|
1167
1715
|
})
|
|
1168
1716
|
.command('process', 'Process (re-load) a loader', (a) => a
|
|
@@ -1170,7 +1718,11 @@ function buildCli(rawArgs) {
|
|
|
1170
1718
|
.option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' })
|
|
1171
1719
|
.option('app-key', { type: 'string', describe: 'Application key' })
|
|
1172
1720
|
.option('env', { type: 'array', string: true, describe: 'Environment keys (repeatable)' })
|
|
1173
|
-
.option('tag', {
|
|
1721
|
+
.option('tag', {
|
|
1722
|
+
type: 'array',
|
|
1723
|
+
string: true,
|
|
1724
|
+
describe: 'Resource tags (repeatable, comma-separate for AND)',
|
|
1725
|
+
})
|
|
1174
1726
|
.option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE (repeatable)' }), async (argv) => {
|
|
1175
1727
|
const { processLoaderCommand } = await import('./functions/app/commands/loaders/process.js');
|
|
1176
1728
|
const output = (0, output_1.createOutput)(argv.json);
|
|
@@ -1225,7 +1777,7 @@ function buildCli(rawArgs) {
|
|
|
1225
1777
|
}
|
|
1226
1778
|
})
|
|
1227
1779
|
.demandCommand(1))
|
|
1228
|
-
.demandCommand(1);
|
|
1780
|
+
.demandCommand(1));
|
|
1229
1781
|
}, () => { })
|
|
1230
1782
|
.command('version', 'Print the CLI version and the resolved @dcupl/* package versions', () => { }, (argv) => {
|
|
1231
1783
|
(0, command_js_2.versionCommand)((0, output_1.createOutput)(argv.json));
|
|
@@ -1263,8 +1815,8 @@ function buildCli(rawArgs) {
|
|
|
1263
1815
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1264
1816
|
if (!output.isJson()) {
|
|
1265
1817
|
process.stderr.write(`⚠️ Deprecation: 'dcupl files:push' is deprecated and will be removed in a future release.\n` +
|
|
1266
|
-
` Use 'dcupl files push' (sync-aware
|
|
1267
|
-
`
|
|
1818
|
+
` Use 'dcupl files push' (sync-aware, changed-only; accepts .csv, .json, .txt, .md, .js).\n` +
|
|
1819
|
+
` This legacy zip upload keeps only .csv, .json and .js and silently drops everything else.\n`);
|
|
1268
1820
|
}
|
|
1269
1821
|
const { pushFiles } = await import('./functions/files/files-push.js');
|
|
1270
1822
|
pushFiles(argv, output);
|
|
@@ -1278,9 +1830,8 @@ function buildCli(rawArgs) {
|
|
|
1278
1830
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1279
1831
|
if (!output.isJson()) {
|
|
1280
1832
|
process.stderr.write(`⚠️ Deprecation: 'dcupl files:pull' is deprecated and will be removed in a future release.\n` +
|
|
1281
|
-
` Use 'dcupl files pull' (sync-aware) instead.
|
|
1282
|
-
`
|
|
1283
|
-
` via 'files:push' should continue using 'files:pull' to stay in lockstep.\n`);
|
|
1833
|
+
` Use 'dcupl files pull' (sync-aware, changed-only) instead. The dcupl CDN stores text files\n` +
|
|
1834
|
+
` only, so there is nothing the new command cannot round-trip.\n`);
|
|
1284
1835
|
}
|
|
1285
1836
|
const { pullFiles } = await import('./functions/files/files-pull.js');
|
|
1286
1837
|
pullFiles(argv, output);
|
|
@@ -1298,7 +1849,12 @@ function buildCli(rawArgs) {
|
|
|
1298
1849
|
try {
|
|
1299
1850
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
1300
1851
|
const client = (0, api_client_1.createApiClient)();
|
|
1301
|
-
await copyVersionCommand(client, output, {
|
|
1852
|
+
await copyVersionCommand(client, output, {
|
|
1853
|
+
from: argv.from,
|
|
1854
|
+
to: argv.to,
|
|
1855
|
+
yes: true,
|
|
1856
|
+
dryRun: false,
|
|
1857
|
+
});
|
|
1302
1858
|
}
|
|
1303
1859
|
catch (err) {
|
|
1304
1860
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
@@ -1319,6 +1875,6 @@ function buildCli(rawArgs) {
|
|
|
1319
1875
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
1320
1876
|
}
|
|
1321
1877
|
})
|
|
1322
|
-
.demandCommand(1);
|
|
1878
|
+
.demandCommand(1));
|
|
1323
1879
|
}
|
|
1324
1880
|
//# sourceMappingURL=cli.js.map
|