@dcupl/cli 1.4.0-beta.5 → 1.4.0-beta.7
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 +20 -20
- package/dist/cli.js +658 -167
- 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.js +11 -1
- package/dist/functions/app/commands/cdn-host.js.map +1 -1
- 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/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 +9 -3
- 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.js +5 -4
- 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.js +30 -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/main.js +14 -7
- package/dist/functions/app/daemon/main.js.map +1 -1
- package/dist/functions/app/daemon/services/attribute-validation.js +6 -3
- package/dist/functions/app/daemon/services/attribute-validation.js.map +1 -1
- package/dist/functions/app/daemon/services/dcupl-host.service.js +10 -14
- 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 +2 -1
- package/dist/functions/app/daemon/services/loaders.service.js +5 -5
- package/dist/functions/app/daemon/services/loaders.service.js.map +1 -1
- package/dist/functions/app/e2e/port-lock.js +23 -9
- 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/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/generate/model-from-data/generate-model-from-data.js +7 -2
- 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.js +9 -2
- package/dist/functions/generate/projects/generate-project.js.map +1 -1
- package/dist/functions/helper/output.js +3 -1
- 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.js +83 -31
- 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.js.map +1 -1
- 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 +84 -12
- 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 +1 -0
- package/dist/functions/workflow/commands/deploy.js +14 -6
- 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.js +25 -9
- package/dist/functions/workflow/commands/run.js.map +1 -1
- package/dist/functions/workflow/commands/runners-get.js.map +1 -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.js +10 -3
- package/dist/functions/workflow/commands/test.js.map +1 -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 +8 -1
- 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/runner-health.js.map +1 -1
- package/dist/functions/workflow/script-lint.js +32 -7
- package/dist/functions/workflow/script-lint.js.map +1 -1
- package/dist/functions/workflow/trace.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 +14 -9
- 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
|
@@ -23,13 +23,13 @@ function parseAutoServePort(raw) {
|
|
|
23
23
|
return n;
|
|
24
24
|
}
|
|
25
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, dev.
|
|
26
|
+
' (api.dcupl.com → cdn.dcupl.com, api.dev.dcupl.com → cdn.dev.dcupl.com), else the prod CDN;' +
|
|
27
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
|
|
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
29
|
' see docs/flows/workflow-app-remote.md';
|
|
30
30
|
function buildCli(rawArgs) {
|
|
31
31
|
const instance = (0, yargs_1.default)(rawArgs);
|
|
32
|
-
return instance
|
|
32
|
+
return (instance
|
|
33
33
|
.version(false)
|
|
34
34
|
.locale('en')
|
|
35
35
|
.strict()
|
|
@@ -92,13 +92,25 @@ function buildCli(rawArgs) {
|
|
|
92
92
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
93
93
|
await serveListCommand(output);
|
|
94
94
|
})
|
|
95
|
-
.command('stop', 'Stop a running serve by port', (a) => a
|
|
96
|
-
|
|
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) => {
|
|
97
101
|
const { serveStopCommand } = await import('./functions/serve/commands/stop.js');
|
|
98
102
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
99
103
|
await serveStopCommand(output, { port: argv.port });
|
|
100
104
|
})
|
|
101
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
|
+
})
|
|
102
114
|
.option('open-browser', {
|
|
103
115
|
type: 'boolean',
|
|
104
116
|
describe: 'Open the welcome screen in a browser on start. Overrides openBrowser in dcupl.config.json.',
|
|
@@ -131,16 +143,35 @@ function buildCli(rawArgs) {
|
|
|
131
143
|
'workflow',
|
|
132
144
|
],
|
|
133
145
|
})
|
|
134
|
-
.option('name', {
|
|
146
|
+
.option('name', {
|
|
147
|
+
describe: 'Name for model generation, or the workflow key for `generate workflow`',
|
|
148
|
+
type: 'string',
|
|
149
|
+
})
|
|
135
150
|
.option('file-name', { describe: 'File name for generation', type: 'string' })
|
|
136
151
|
.option('operator', { describe: 'Operator name for operator generation', type: 'string' })
|
|
137
|
-
.option('template', {
|
|
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
|
+
})
|
|
138
157
|
.option('title', { describe: 'Test title (used by `generate test`)', type: 'string' })
|
|
139
158
|
.option('from', { describe: 'Data file (CSV/JSON/NDJSON) to infer a model from', type: 'string' })
|
|
140
|
-
.option('register', {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
+
});
|
|
144
175
|
}, async (argv) => {
|
|
145
176
|
const { generateFn } = await import('./functions/generate/files/generate-files.js');
|
|
146
177
|
generateFn(argv);
|
|
@@ -152,14 +183,26 @@ function buildCli(rawArgs) {
|
|
|
152
183
|
(0, command_js_1.schemasListCommand)(argv, output);
|
|
153
184
|
})
|
|
154
185
|
.command('get <name>', 'Print the source of a schema', (args) => args
|
|
155
|
-
.positional('name', {
|
|
186
|
+
.positional('name', {
|
|
187
|
+
type: 'string',
|
|
188
|
+
describe: 'Schema name (see `dcupl schemas list`)',
|
|
189
|
+
demandOption: true,
|
|
190
|
+
})
|
|
156
191
|
.option('example', { type: 'boolean', default: false, describe: 'Append a curated example payload' }), (argv) => {
|
|
157
192
|
const output = (0, output_1.createOutput)(argv.json);
|
|
158
193
|
(0, command_js_1.schemasGetCommand)({ name: argv.name, json: argv.json, example: argv.example }, output);
|
|
159
194
|
})
|
|
160
195
|
.command('validate <file>', 'Validate a JSON file against a registry schema (Zod-kind, e.g. TemplateV3)', (args) => args
|
|
161
|
-
.positional('file', {
|
|
162
|
-
|
|
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) => {
|
|
163
206
|
const output = (0, output_1.createOutput)(argv.json);
|
|
164
207
|
try {
|
|
165
208
|
const { schemasValidateCommand } = await import('./functions/schemas/validate.js');
|
|
@@ -176,9 +219,20 @@ function buildCli(rawArgs) {
|
|
|
176
219
|
.command('workflow <subcommand>', 'Build, test, and deploy dcupl Workflow v3 templates. Auth: `dcupl config set` (projectId + apiKey).', (yy) => {
|
|
177
220
|
return yy
|
|
178
221
|
.command('validate', 'Validate a TemplateV3 file locally (and remotely if --runner is given).', (a) => a
|
|
179
|
-
.option('file', {
|
|
180
|
-
|
|
181
|
-
|
|
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) => {
|
|
182
236
|
const { validateCommand } = await import('./functions/workflow/commands/validate.js');
|
|
183
237
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
184
238
|
try {
|
|
@@ -187,7 +241,11 @@ function buildCli(rawArgs) {
|
|
|
187
241
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
188
242
|
deps.client = mkClient();
|
|
189
243
|
}
|
|
190
|
-
await validateCommand(output, {
|
|
244
|
+
await validateCommand(output, {
|
|
245
|
+
file: argv.file,
|
|
246
|
+
runner: argv.runner,
|
|
247
|
+
localOnly: !!argv['local-only'],
|
|
248
|
+
}, deps);
|
|
191
249
|
}
|
|
192
250
|
catch (err) {
|
|
193
251
|
output.error(err.message, err.code || 'WORKFLOW_VALIDATE_FAILED');
|
|
@@ -251,19 +309,27 @@ function buildCli(rawArgs) {
|
|
|
251
309
|
.command('trace', 'Show the node-by-node execution state of a single run (debug a workflow run).', (a) => a
|
|
252
310
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
253
311
|
.option('run', { type: 'string', describe: 'Execution runId (from `workflow history`)' })
|
|
254
|
-
.option('last', {
|
|
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) => {
|
|
255
317
|
const { traceCommand } = await import('./functions/workflow/commands/trace.js');
|
|
256
318
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
257
319
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
258
320
|
try {
|
|
259
|
-
await traceCommand(output, mkClient(), {
|
|
321
|
+
await traceCommand(output, mkClient(), {
|
|
322
|
+
id: argv.id,
|
|
323
|
+
run: argv.run,
|
|
324
|
+
last: !!argv.last,
|
|
325
|
+
});
|
|
260
326
|
}
|
|
261
327
|
catch (err) {
|
|
262
328
|
output.error(err.message, err.code || 'WORKFLOW_TRACE_FAILED');
|
|
263
329
|
}
|
|
264
330
|
})
|
|
265
331
|
.command('runners [subcommand]', 'Inspect the runners available to this project.', (rr) => {
|
|
266
|
-
return rr
|
|
332
|
+
return (rr
|
|
267
333
|
.command(['list', '$0'], 'List the runners available to this project (uid / key / type / url / health).', () => { }, async (argv) => {
|
|
268
334
|
const { runnersCommand } = await import('./functions/workflow/commands/runners.js');
|
|
269
335
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
@@ -285,26 +351,51 @@ function buildCli(rawArgs) {
|
|
|
285
351
|
catch (err) {
|
|
286
352
|
output.error(err.message, err.code || 'WORKFLOW_RUNNERS_GET_FAILED');
|
|
287
353
|
}
|
|
288
|
-
});
|
|
354
|
+
}));
|
|
289
355
|
}, () => { })
|
|
290
356
|
.command('test', 'Deploy to a (dev) runner then exercise it: --node for one node, otherwise a full run.', (a) => a
|
|
291
|
-
.option('file', {
|
|
292
|
-
|
|
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
|
+
})
|
|
293
367
|
.option('node', { type: 'string', describe: 'Test a single node by id (uses test-node)' })
|
|
294
|
-
.option('input', {
|
|
368
|
+
.option('input', {
|
|
369
|
+
type: 'string',
|
|
370
|
+
describe: 'Path to a JSON file: test-node inputData, or full-run request body',
|
|
371
|
+
})
|
|
295
372
|
.option('state', { type: 'string', describe: 'Path to a JSON file: $state seed for test-node' })
|
|
296
|
-
.option('trigger-key', {
|
|
297
|
-
|
|
298
|
-
|
|
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) => {
|
|
299
386
|
const { testCommand } = await import('./functions/workflow/commands/test.js');
|
|
300
387
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
301
388
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
302
389
|
try {
|
|
303
390
|
await testCommand(output, mkClient(), {
|
|
304
|
-
file: argv.file,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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'],
|
|
308
399
|
});
|
|
309
400
|
}
|
|
310
401
|
catch (err) {
|
|
@@ -312,20 +403,43 @@ function buildCli(rawArgs) {
|
|
|
312
403
|
}
|
|
313
404
|
})
|
|
314
405
|
.command('run <key>', 'Trigger an already-deployed workflow (no redeploy): --node for one node, otherwise a full run.', (a) => a
|
|
315
|
-
.positional('key', {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
.option('
|
|
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) => {
|
|
321
432
|
const { runCommand } = await import('./functions/workflow/commands/run.js');
|
|
322
433
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
323
434
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
324
435
|
try {
|
|
325
436
|
await runCommand(output, mkClient(), {
|
|
326
|
-
key: argv.key,
|
|
327
|
-
|
|
328
|
-
|
|
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'],
|
|
329
443
|
});
|
|
330
444
|
}
|
|
331
445
|
catch (err) {
|
|
@@ -333,16 +447,37 @@ function buildCli(rawArgs) {
|
|
|
333
447
|
}
|
|
334
448
|
})
|
|
335
449
|
.command('deploy', 'Validate (remote) then deploy a template to a runner. Confirms before going live.', (a) => a
|
|
336
|
-
.option('file', {
|
|
337
|
-
|
|
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
|
+
})
|
|
338
460
|
.option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI)' })
|
|
339
|
-
.option('wait', {
|
|
340
|
-
|
|
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) => {
|
|
341
470
|
const { deployCommand } = await import('./functions/workflow/commands/deploy.js');
|
|
342
471
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
343
472
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
344
473
|
try {
|
|
345
|
-
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
|
+
});
|
|
346
481
|
}
|
|
347
482
|
catch (err) {
|
|
348
483
|
output.error(err.message, err.code || 'WORKFLOW_DEPLOY_FAILED');
|
|
@@ -350,7 +485,11 @@ function buildCli(rawArgs) {
|
|
|
350
485
|
})
|
|
351
486
|
.command('undeploy', 'Undeploy (stop + remove) a deployed workflow by its uid.', (a) => a
|
|
352
487
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
353
|
-
.option('yes', {
|
|
488
|
+
.option('yes', {
|
|
489
|
+
type: 'boolean',
|
|
490
|
+
default: false,
|
|
491
|
+
describe: 'Skip the confirmation prompt (for CI)',
|
|
492
|
+
}), async (argv) => {
|
|
354
493
|
const { undeployCommand } = await import('./functions/workflow/commands/undeploy.js');
|
|
355
494
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
356
495
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -404,9 +543,21 @@ function buildCli(rawArgs) {
|
|
|
404
543
|
describe: 'Version id (defaults to HEAD, then "draft"). "production" is rejected.',
|
|
405
544
|
})
|
|
406
545
|
.option('name', { type: 'string', hidden: true })
|
|
407
|
-
.option('strict', {
|
|
408
|
-
|
|
409
|
-
|
|
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
|
+
})
|
|
410
561
|
.option('path', {
|
|
411
562
|
type: 'array',
|
|
412
563
|
string: true,
|
|
@@ -449,9 +600,21 @@ function buildCli(rawArgs) {
|
|
|
449
600
|
describe: 'Version id (defaults to HEAD, then "draft"). Switching versions requires a clean workspace or --force.',
|
|
450
601
|
})
|
|
451
602
|
.option('name', { type: 'string', hidden: true })
|
|
452
|
-
.option('strict', {
|
|
453
|
-
|
|
454
|
-
|
|
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
|
+
})
|
|
455
618
|
.option('path', {
|
|
456
619
|
type: 'array',
|
|
457
620
|
string: true,
|
|
@@ -493,9 +656,17 @@ function buildCli(rawArgs) {
|
|
|
493
656
|
}
|
|
494
657
|
})
|
|
495
658
|
.command('list', 'List files in a version', (a) => a
|
|
496
|
-
.option('version', {
|
|
659
|
+
.option('version', {
|
|
660
|
+
alias: 'v',
|
|
661
|
+
type: 'string',
|
|
662
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
663
|
+
})
|
|
497
664
|
.option('search', { type: 'string', describe: 'Filter files by search query' })
|
|
498
|
-
.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) => {
|
|
499
670
|
const { listFilesCommand } = await import('./functions/files/commands/list.js');
|
|
500
671
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
501
672
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -512,9 +683,11 @@ function buildCli(rawArgs) {
|
|
|
512
683
|
output.error(err.error || err.message, err.code || 'LIST_FAILED');
|
|
513
684
|
}
|
|
514
685
|
})
|
|
515
|
-
.command('read', 'Read a single file from a version', (a) => a
|
|
516
|
-
|
|
517
|
-
|
|
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) => {
|
|
518
691
|
const { readFileCommand } = await import('./functions/files/commands/read.js');
|
|
519
692
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
520
693
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -534,7 +707,11 @@ function buildCli(rawArgs) {
|
|
|
534
707
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
535
708
|
.option('content', { type: 'string', describe: 'Inline content to write' })
|
|
536
709
|
.option('file', { type: 'string', describe: 'Path to local file to upload' })
|
|
537
|
-
.option('version', {
|
|
710
|
+
.option('version', {
|
|
711
|
+
alias: 'v',
|
|
712
|
+
type: 'string',
|
|
713
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
714
|
+
}), async (argv) => {
|
|
538
715
|
const { writeFileCommand } = await import('./functions/files/commands/write.js');
|
|
539
716
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
540
717
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -554,9 +731,21 @@ function buildCli(rawArgs) {
|
|
|
554
731
|
})
|
|
555
732
|
.command('delete', 'Delete a single file from a version', (a) => a
|
|
556
733
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
557
|
-
.option('version', {
|
|
558
|
-
|
|
559
|
-
|
|
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) => {
|
|
560
749
|
const { deleteFileCommand } = await import('./functions/files/commands/delete.js');
|
|
561
750
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
562
751
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -577,9 +766,21 @@ function buildCli(rawArgs) {
|
|
|
577
766
|
.command('move', 'Move/rename a file within a version (remote — does not touch local files).', (a) => a
|
|
578
767
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
579
768
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
580
|
-
.option('version', {
|
|
581
|
-
|
|
582
|
-
|
|
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) => {
|
|
583
784
|
const { moveFileCommand } = await import('./functions/files/commands/move.js');
|
|
584
785
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
585
786
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -601,7 +802,11 @@ function buildCli(rawArgs) {
|
|
|
601
802
|
.command('copy', 'Copy a single file within a version (remote — does not touch local files).', (a) => a
|
|
602
803
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
603
804
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
604
|
-
.option('version', {
|
|
805
|
+
.option('version', {
|
|
806
|
+
alias: 'v',
|
|
807
|
+
type: 'string',
|
|
808
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
809
|
+
}), async (argv) => {
|
|
605
810
|
const { copyFileCommand } = await import('./functions/files/commands/copy.js');
|
|
606
811
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
607
812
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -618,9 +823,11 @@ function buildCli(rawArgs) {
|
|
|
618
823
|
output.error(err.error || err.message, err.code || 'COPY_FAILED');
|
|
619
824
|
}
|
|
620
825
|
})
|
|
621
|
-
.command('create-folder', 'Create a folder in a version', (a) => a
|
|
622
|
-
|
|
623
|
-
|
|
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) => {
|
|
624
831
|
const { createFolderCommand } = await import('./functions/files/commands/create-folder.js');
|
|
625
832
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
626
833
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -650,10 +857,26 @@ function buildCli(rawArgs) {
|
|
|
650
857
|
}
|
|
651
858
|
})
|
|
652
859
|
.command('copy', 'Snapshot all files from one version into another (creates the target, or replaces its contents if it already exists)', (a) => a
|
|
653
|
-
.option('from', {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
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) => {
|
|
657
880
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
658
881
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
659
882
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -672,8 +895,16 @@ function buildCli(rawArgs) {
|
|
|
672
895
|
})
|
|
673
896
|
.command('delete <id>', 'Delete a version', (a) => a
|
|
674
897
|
.positional('id', { type: 'string', demandOption: true, describe: 'Version id to delete' })
|
|
675
|
-
.option('yes', {
|
|
676
|
-
|
|
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) => {
|
|
677
908
|
const { deleteVersionCommand } = await import('./functions/files/commands/versions/delete.js');
|
|
678
909
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
679
910
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -696,8 +927,15 @@ function buildCli(rawArgs) {
|
|
|
696
927
|
.command('set', 'Create or update dcupl.config.json + dcupl.secrets.json. Interactive by default; flags skip prompts.', (a) => a
|
|
697
928
|
.option('project-id', { type: 'string', describe: 'dcupl Console project id' })
|
|
698
929
|
.option('api-key', { type: 'string', describe: 'dcupl Console API key' })
|
|
699
|
-
.option('console-api-url', {
|
|
700
|
-
|
|
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) => {
|
|
701
939
|
const { configSetCommand } = await import('./functions/config/commands/set.js');
|
|
702
940
|
try {
|
|
703
941
|
await configSetCommand({
|
|
@@ -711,8 +949,11 @@ function buildCli(rawArgs) {
|
|
|
711
949
|
(0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_SET_FAILED');
|
|
712
950
|
}
|
|
713
951
|
})
|
|
714
|
-
.command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a
|
|
715
|
-
|
|
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) => {
|
|
716
957
|
const { configGetCommand } = await import('./functions/config/commands/get.js');
|
|
717
958
|
try {
|
|
718
959
|
await configGetCommand({
|
|
@@ -727,20 +968,45 @@ function buildCli(rawArgs) {
|
|
|
727
968
|
.demandCommand(1);
|
|
728
969
|
})
|
|
729
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
|
|
730
|
-
.option('source', {
|
|
971
|
+
.option('source', {
|
|
972
|
+
type: 'string',
|
|
973
|
+
choices: ['local', 'remote'],
|
|
974
|
+
describe: 'Project source (inferred when omitted)',
|
|
975
|
+
})
|
|
731
976
|
.option('lc-json', { type: 'string', describe: 'Loader config path (local source)' })
|
|
732
|
-
.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
|
+
})
|
|
733
981
|
.option('project-id', { type: 'string', describe: 'Console project id (remote source)' })
|
|
734
982
|
.option('api-key', { type: 'string', describe: 'Console API key (remote source)' })
|
|
735
983
|
.option('version', { type: 'string', describe: 'Console version id (remote source, default: draft)' })
|
|
736
984
|
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
737
985
|
.option('app-key', { type: 'string', describe: 'Application key for the process step' })
|
|
738
|
-
.option('env', {
|
|
986
|
+
.option('env', {
|
|
987
|
+
type: 'array',
|
|
988
|
+
string: true,
|
|
989
|
+
describe: 'Environment keys for the process step (repeatable)',
|
|
990
|
+
})
|
|
739
991
|
.option('tag', { type: 'array', string: true, describe: 'Resource tags for the process step (repeatable)' })
|
|
740
|
-
.option('var', {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
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) => {
|
|
744
1010
|
const { validateCommand } = await import('./functions/app/commands/validate.js');
|
|
745
1011
|
const output = (0, output_1.createOutput)(argv.json);
|
|
746
1012
|
try {
|
|
@@ -766,41 +1032,123 @@ function buildCli(rawArgs) {
|
|
|
766
1032
|
}
|
|
767
1033
|
})
|
|
768
1034
|
.command('app <subcommand>', 'Run local dcupl daemons to query and analyze tabular data', (yy) => {
|
|
769
|
-
return yy
|
|
1035
|
+
return (yy
|
|
770
1036
|
.command('create', 'Start a new daemon and register an app', (a) => a
|
|
771
1037
|
.option('app', { type: 'string', describe: 'App id (auto-generated if omitted)' })
|
|
772
1038
|
.option('idle-timeout', { type: 'number', default: 30, describe: 'Idle timeout in minutes' })
|
|
773
|
-
.option('auto-update', {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
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
|
+
})
|
|
778
1062
|
.option('cache', { type: 'boolean', describe: 'Enable internal API caching (default: true)' })
|
|
779
|
-
.option('clone', {
|
|
780
|
-
|
|
781
|
-
|
|
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
|
+
})
|
|
782
1075
|
.option('logging-level', { type: 'string', choices: init_options_js_1.LOG_LEVELS, describe: 'Minimum SDK log level' })
|
|
783
|
-
.option('logging-format', {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
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
|
+
})
|
|
787
1094
|
.option('key', { type: 'string', describe: 'Loader key for --load (auto-generated if omitted)' })
|
|
788
|
-
.option('source', {
|
|
789
|
-
|
|
790
|
-
|
|
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
|
+
})
|
|
791
1108
|
.option('api-key', { type: 'string', describe: 'Console API key (--load)' })
|
|
792
|
-
.option('version', {
|
|
1109
|
+
.option('version', {
|
|
1110
|
+
type: 'string',
|
|
1111
|
+
describe: 'Console version id (cdn loader source, default: draft)',
|
|
1112
|
+
})
|
|
793
1113
|
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
794
1114
|
.option('base-url', { type: 'string', describe: 'Custom base URL loader source (--load)' })
|
|
795
|
-
.option('loader-file', {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
.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
|
+
})
|
|
800
1136
|
.option('app-key', { type: 'string', describe: 'Application key for process step (--load)' })
|
|
801
|
-
.option('env', {
|
|
802
|
-
|
|
803
|
-
|
|
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) => {
|
|
804
1152
|
const { createCommand } = await import('./functions/app/commands/create.js');
|
|
805
1153
|
const output = (0, output_1.createOutput)(argv.json);
|
|
806
1154
|
try {
|
|
@@ -848,9 +1196,11 @@ function buildCli(rawArgs) {
|
|
|
848
1196
|
output.error(err.message, err.code || 'CREATE_FAILED', err.details === undefined ? undefined : { details: err.details });
|
|
849
1197
|
}
|
|
850
1198
|
})
|
|
851
|
-
.command('destroy', 'Stop a daemon', (a) => a
|
|
852
|
-
|
|
853
|
-
|
|
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) => {
|
|
854
1204
|
const { destroyCommand } = await import('./functions/app/commands/destroy.js');
|
|
855
1205
|
const output = (0, output_1.createOutput)(argv.json);
|
|
856
1206
|
try {
|
|
@@ -926,12 +1276,17 @@ function buildCli(rawArgs) {
|
|
|
926
1276
|
.command('set', 'Set a model from a JSON file or inline content', (a) => a
|
|
927
1277
|
.option('app', { type: 'string' })
|
|
928
1278
|
.option('file', { type: 'string', describe: 'Path to model JSON file' })
|
|
929
|
-
.option('content', {
|
|
1279
|
+
.option('content', {
|
|
1280
|
+
type: 'string',
|
|
1281
|
+
describe: 'Inline JSON model definition (use "-" to read from stdin)',
|
|
1282
|
+
}), async (argv) => {
|
|
930
1283
|
const { setCommand } = await import('./functions/app/commands/models/set.js');
|
|
931
1284
|
const output = (0, output_1.createOutput)(argv.json);
|
|
932
1285
|
try {
|
|
933
1286
|
const content = argv.content !== undefined
|
|
934
|
-
?
|
|
1287
|
+
? argv.content === '' && argv._.includes('-')
|
|
1288
|
+
? '-'
|
|
1289
|
+
: argv.content
|
|
935
1290
|
: undefined;
|
|
936
1291
|
await setCommand(output, { appId: argv.app, file: argv.file, content });
|
|
937
1292
|
}
|
|
@@ -953,26 +1308,46 @@ function buildCli(rawArgs) {
|
|
|
953
1308
|
.command('data <verb>', 'Ingest data', (yyy) => {
|
|
954
1309
|
const dataOpts = (a) => a
|
|
955
1310
|
.option('app', { type: 'string' })
|
|
956
|
-
.option('file', {
|
|
1311
|
+
.option('file', {
|
|
1312
|
+
type: 'string',
|
|
1313
|
+
describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest',
|
|
1314
|
+
})
|
|
957
1315
|
.option('url', { type: 'string', describe: 'Remote URL to fetch the data payload from' })
|
|
958
1316
|
.option('content', { type: 'string', describe: 'Inline payload (use "-" to read from stdin)' })
|
|
959
1317
|
.option('format', { type: 'string', choices: ['csv', 'json', 'ndjson'] })
|
|
960
1318
|
.option('model', { type: 'string', demandOption: true })
|
|
961
1319
|
.option('key-property', { type: 'string' })
|
|
962
1320
|
.option('auto-generate-key', { type: 'boolean', default: false })
|
|
963
|
-
.option('auto-generate-properties', {
|
|
964
|
-
|
|
965
|
-
|
|
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
|
+
});
|
|
966
1333
|
const handler = (mod, exportName, code) => async (argv) => {
|
|
967
1334
|
const m = await import(`./functions/app/commands/data/${mod}.js`);
|
|
968
1335
|
const output = (0, output_1.createOutput)(argv.json);
|
|
969
1336
|
try {
|
|
970
1337
|
const content = argv.content !== undefined
|
|
971
|
-
?
|
|
1338
|
+
? argv.content === '' && argv._.includes('-')
|
|
1339
|
+
? '-'
|
|
1340
|
+
: argv.content
|
|
972
1341
|
: undefined;
|
|
973
1342
|
await m[exportName](output, {
|
|
974
|
-
appId: argv.app,
|
|
975
|
-
|
|
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,
|
|
976
1351
|
autoGenerateProperties: argv.autoGenerateProperties,
|
|
977
1352
|
autoGenerateDeep: argv.autoGenerateDeep,
|
|
978
1353
|
autoGenerateSampleSize: argv.autoGenerateSampleSize,
|
|
@@ -1000,7 +1375,10 @@ function buildCli(rawArgs) {
|
|
|
1000
1375
|
.demandCommand(1);
|
|
1001
1376
|
})
|
|
1002
1377
|
.command('query <verb>', 'Query records', (yyy) => yyy
|
|
1003
|
-
.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) => {
|
|
1004
1382
|
const { oneCommand } = await import('./functions/app/commands/query/one.js');
|
|
1005
1383
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1006
1384
|
try {
|
|
@@ -1023,9 +1401,13 @@ function buildCli(rawArgs) {
|
|
|
1023
1401
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1024
1402
|
try {
|
|
1025
1403
|
await executeCommand(output, {
|
|
1026
|
-
appId: argv.app,
|
|
1027
|
-
|
|
1028
|
-
|
|
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,
|
|
1029
1411
|
projection: argv.projection,
|
|
1030
1412
|
});
|
|
1031
1413
|
}
|
|
@@ -1050,15 +1432,32 @@ function buildCli(rawArgs) {
|
|
|
1050
1432
|
choices: ['size-desc', 'size-asc', 'value-asc', 'value-desc'],
|
|
1051
1433
|
describe: 'Deterministic ordering (opt-in; walks all keys). Use size-desc for top-N-by-count.',
|
|
1052
1434
|
})
|
|
1053
|
-
.option('full', {
|
|
1054
|
-
|
|
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) => {
|
|
1055
1445
|
const { facetsCommand } = await import('./functions/app/commands/fn/facets.js');
|
|
1056
1446
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1057
1447
|
try {
|
|
1058
1448
|
await facetsCommand(output, {
|
|
1059
|
-
appId: argv.app,
|
|
1060
|
-
|
|
1061
|
-
|
|
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,
|
|
1062
1461
|
});
|
|
1063
1462
|
}
|
|
1064
1463
|
catch (err) {
|
|
@@ -1069,11 +1468,21 @@ function buildCli(rawArgs) {
|
|
|
1069
1468
|
.option('app', { type: 'string' })
|
|
1070
1469
|
.option('model', { type: 'string', demandOption: true })
|
|
1071
1470
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1072
|
-
.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
|
+
})
|
|
1073
1475
|
.option('query', { type: 'string' })
|
|
1074
1476
|
.option('query-file', { type: 'string' })
|
|
1075
|
-
.option('include-keys', {
|
|
1076
|
-
|
|
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
|
+
})
|
|
1077
1486
|
.option('group-options', { type: 'string', describe: 'Full groupOptions JSON' })
|
|
1078
1487
|
.option('group-options-file', { type: 'string', describe: 'Path to groupOptions JSON' })
|
|
1079
1488
|
.option('distinct-limit', { type: 'number', describe: 'Cap distinct values' })
|
|
@@ -1084,10 +1493,20 @@ function buildCli(rawArgs) {
|
|
|
1084
1493
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1085
1494
|
try {
|
|
1086
1495
|
await aggregateCommand(output, {
|
|
1087
|
-
appId: argv.app,
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
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,
|
|
1091
1510
|
});
|
|
1092
1511
|
}
|
|
1093
1512
|
catch (err) {
|
|
@@ -1100,7 +1519,10 @@ function buildCli(rawArgs) {
|
|
|
1100
1519
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1101
1520
|
.option('query', { type: 'string' })
|
|
1102
1521
|
.option('query-file', { type: 'string' })
|
|
1103
|
-
.option('aggregate', {
|
|
1522
|
+
.option('aggregate', {
|
|
1523
|
+
type: 'array',
|
|
1524
|
+
describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.',
|
|
1525
|
+
})
|
|
1104
1526
|
.option('exclude-zeros', { type: 'boolean' })
|
|
1105
1527
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1106
1528
|
.option('exclude-unresolved', { type: 'boolean' })
|
|
@@ -1111,9 +1533,18 @@ function buildCli(rawArgs) {
|
|
|
1111
1533
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1112
1534
|
try {
|
|
1113
1535
|
await groupByCommand(output, {
|
|
1114
|
-
appId: argv.app,
|
|
1115
|
-
|
|
1116
|
-
|
|
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,
|
|
1117
1548
|
});
|
|
1118
1549
|
}
|
|
1119
1550
|
catch (err) {
|
|
@@ -1128,7 +1559,12 @@ function buildCli(rawArgs) {
|
|
|
1128
1559
|
const { metadataCommand } = await import('./functions/app/commands/fn/metadata.js');
|
|
1129
1560
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1130
1561
|
try {
|
|
1131
|
-
await metadataCommand(output, {
|
|
1562
|
+
await metadataCommand(output, {
|
|
1563
|
+
appId: argv.app,
|
|
1564
|
+
model: argv.model,
|
|
1565
|
+
query: argv.query,
|
|
1566
|
+
queryFile: argv.queryFile,
|
|
1567
|
+
});
|
|
1132
1568
|
}
|
|
1133
1569
|
catch (err) {
|
|
1134
1570
|
output.error(err.message, err.code || 'FN_METADATA_FAILED');
|
|
@@ -1137,11 +1573,20 @@ function buildCli(rawArgs) {
|
|
|
1137
1573
|
.command('pivot', 'Multi-dimensional cross-tab (rows x columns x values)', (a) => a
|
|
1138
1574
|
.option('app', { type: 'string' })
|
|
1139
1575
|
.option('model', { type: 'string', demandOption: true })
|
|
1140
|
-
.option('rows', {
|
|
1141
|
-
|
|
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
|
+
})
|
|
1142
1584
|
.option('values', { type: 'array', describe: 'Aggregations <attr>:<type[,type]>. Repeatable.' })
|
|
1143
1585
|
.option('totals', { type: 'boolean', describe: 'Compute grand totals' })
|
|
1144
|
-
.option('spec', {
|
|
1586
|
+
.option('spec', {
|
|
1587
|
+
type: 'string',
|
|
1588
|
+
describe: 'Full PivotOptions JSON (mutually exclusive with shorthand flags)',
|
|
1589
|
+
})
|
|
1145
1590
|
.option('spec-file', { type: 'string', describe: 'Path to PivotOptions JSON' })
|
|
1146
1591
|
.option('query', { type: 'string' })
|
|
1147
1592
|
.option('query-file', { type: 'string' }), async (argv) => {
|
|
@@ -1149,10 +1594,16 @@ function buildCli(rawArgs) {
|
|
|
1149
1594
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1150
1595
|
try {
|
|
1151
1596
|
await pivotCommand(output, {
|
|
1152
|
-
appId: argv.app,
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
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,
|
|
1156
1607
|
});
|
|
1157
1608
|
}
|
|
1158
1609
|
catch (err) {
|
|
@@ -1165,7 +1616,10 @@ function buildCli(rawArgs) {
|
|
|
1165
1616
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1166
1617
|
.option('value', { type: 'string', demandOption: true })
|
|
1167
1618
|
.option('max', { type: 'number' })
|
|
1168
|
-
.option('relevant-data', {
|
|
1619
|
+
.option('relevant-data', {
|
|
1620
|
+
type: 'string',
|
|
1621
|
+
choices: ['filtered', 'all', 'excludeQuery'],
|
|
1622
|
+
})
|
|
1169
1623
|
.option('calculate-result-keys', { type: 'boolean' })
|
|
1170
1624
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1171
1625
|
.option('exclude-nulls', { type: 'boolean' })
|
|
@@ -1177,11 +1631,19 @@ function buildCli(rawArgs) {
|
|
|
1177
1631
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1178
1632
|
try {
|
|
1179
1633
|
await suggestCommand(output, {
|
|
1180
|
-
appId: argv.app,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
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,
|
|
1185
1647
|
});
|
|
1186
1648
|
}
|
|
1187
1649
|
catch (err) {
|
|
@@ -1193,18 +1655,38 @@ function buildCli(rawArgs) {
|
|
|
1193
1655
|
.command('add', 'Register a loader source', (a) => a
|
|
1194
1656
|
.option('app', { type: 'string', describe: 'App id' })
|
|
1195
1657
|
.option('key', { type: 'string', describe: 'Loader key (auto-generated if omitted)' })
|
|
1196
|
-
.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
|
+
})
|
|
1197
1663
|
.option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as source' })
|
|
1198
|
-
.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
|
+
})
|
|
1199
1668
|
.option('api-key', { type: 'string', describe: 'Console API key' })
|
|
1200
|
-
.option('version', {
|
|
1669
|
+
.option('version', {
|
|
1670
|
+
type: 'string',
|
|
1671
|
+
describe: 'Console version id (cdn source, default: draft)',
|
|
1672
|
+
})
|
|
1201
1673
|
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
1202
1674
|
.option('base-url', { type: 'string', describe: 'Custom base URL source' })
|
|
1203
1675
|
.option('loader-file', { type: 'string', describe: 'Loader file name for base-url source' })
|
|
1204
|
-
.option('header', {
|
|
1676
|
+
.option('header', {
|
|
1677
|
+
type: 'array',
|
|
1678
|
+
string: true,
|
|
1679
|
+
describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)',
|
|
1680
|
+
})
|
|
1205
1681
|
.option('lc-json', { type: 'string', describe: 'Path to loader config (workspace source)' })
|
|
1206
|
-
.option('auto-serve', {
|
|
1207
|
-
|
|
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) => {
|
|
1208
1690
|
const { addLoaderCommand } = await import('./functions/app/commands/loaders/add.js');
|
|
1209
1691
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1210
1692
|
try {
|
|
@@ -1236,7 +1718,11 @@ function buildCli(rawArgs) {
|
|
|
1236
1718
|
.option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' })
|
|
1237
1719
|
.option('app-key', { type: 'string', describe: 'Application key' })
|
|
1238
1720
|
.option('env', { type: 'array', string: true, describe: 'Environment keys (repeatable)' })
|
|
1239
|
-
.option('tag', {
|
|
1721
|
+
.option('tag', {
|
|
1722
|
+
type: 'array',
|
|
1723
|
+
string: true,
|
|
1724
|
+
describe: 'Resource tags (repeatable, comma-separate for AND)',
|
|
1725
|
+
})
|
|
1240
1726
|
.option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE (repeatable)' }), async (argv) => {
|
|
1241
1727
|
const { processLoaderCommand } = await import('./functions/app/commands/loaders/process.js');
|
|
1242
1728
|
const output = (0, output_1.createOutput)(argv.json);
|
|
@@ -1291,7 +1777,7 @@ function buildCli(rawArgs) {
|
|
|
1291
1777
|
}
|
|
1292
1778
|
})
|
|
1293
1779
|
.demandCommand(1))
|
|
1294
|
-
.demandCommand(1);
|
|
1780
|
+
.demandCommand(1));
|
|
1295
1781
|
}, () => { })
|
|
1296
1782
|
.command('version', 'Print the CLI version and the resolved @dcupl/* package versions', () => { }, (argv) => {
|
|
1297
1783
|
(0, command_js_2.versionCommand)((0, output_1.createOutput)(argv.json));
|
|
@@ -1363,7 +1849,12 @@ function buildCli(rawArgs) {
|
|
|
1363
1849
|
try {
|
|
1364
1850
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
1365
1851
|
const client = (0, api_client_1.createApiClient)();
|
|
1366
|
-
await copyVersionCommand(client, output, {
|
|
1852
|
+
await copyVersionCommand(client, output, {
|
|
1853
|
+
from: argv.from,
|
|
1854
|
+
to: argv.to,
|
|
1855
|
+
yes: true,
|
|
1856
|
+
dryRun: false,
|
|
1857
|
+
});
|
|
1367
1858
|
}
|
|
1368
1859
|
catch (err) {
|
|
1369
1860
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
@@ -1384,6 +1875,6 @@ function buildCli(rawArgs) {
|
|
|
1384
1875
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
1385
1876
|
}
|
|
1386
1877
|
})
|
|
1387
|
-
.demandCommand(1);
|
|
1878
|
+
.demandCommand(1));
|
|
1388
1879
|
}
|
|
1389
1880
|
//# sourceMappingURL=cli.js.map
|