@dcupl/cli 1.4.0-beta.4 → 1.4.0-beta.6
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 +650 -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/main.js +4 -1
- 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/package.json +14 -9
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,8 +92,12 @@ 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 });
|
|
@@ -131,16 +135,35 @@ function buildCli(rawArgs) {
|
|
|
131
135
|
'workflow',
|
|
132
136
|
],
|
|
133
137
|
})
|
|
134
|
-
.option('name', {
|
|
138
|
+
.option('name', {
|
|
139
|
+
describe: 'Name for model generation, or the workflow key for `generate workflow`',
|
|
140
|
+
type: 'string',
|
|
141
|
+
})
|
|
135
142
|
.option('file-name', { describe: 'File name for generation', type: 'string' })
|
|
136
143
|
.option('operator', { describe: 'Operator name for operator generation', type: 'string' })
|
|
137
|
-
.option('template', {
|
|
144
|
+
.option('template', {
|
|
145
|
+
describe: `Workflow preset (used by \`generate workflow\`, default: ${workflow_presets_js_1.WORKFLOW_PRESETS[0]})`,
|
|
146
|
+
type: 'string',
|
|
147
|
+
choices: workflow_presets_js_1.WORKFLOW_PRESETS,
|
|
148
|
+
})
|
|
138
149
|
.option('title', { describe: 'Test title (used by `generate test`)', type: 'string' })
|
|
139
150
|
.option('from', { describe: 'Data file (CSV/JSON/NDJSON) to infer a model from', type: 'string' })
|
|
140
|
-
.option('register', {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
151
|
+
.option('register', {
|
|
152
|
+
describe: 'Register the generated model + data resource in dcupl.lc.json',
|
|
153
|
+
type: 'boolean',
|
|
154
|
+
})
|
|
155
|
+
.option('sample-size', {
|
|
156
|
+
describe: 'Max rows to scan when inferring types from --from',
|
|
157
|
+
type: 'number',
|
|
158
|
+
})
|
|
159
|
+
.option('key-property', {
|
|
160
|
+
describe: 'Override inferred keyProperty for --from. Comma-separate for a composite key (a,b,c). Skips inference + prompts.',
|
|
161
|
+
type: 'string',
|
|
162
|
+
})
|
|
163
|
+
.option('dry-run', {
|
|
164
|
+
describe: 'Preview the proposed model + lc.json additions without writing.',
|
|
165
|
+
type: 'boolean',
|
|
166
|
+
});
|
|
144
167
|
}, async (argv) => {
|
|
145
168
|
const { generateFn } = await import('./functions/generate/files/generate-files.js');
|
|
146
169
|
generateFn(argv);
|
|
@@ -152,14 +175,26 @@ function buildCli(rawArgs) {
|
|
|
152
175
|
(0, command_js_1.schemasListCommand)(argv, output);
|
|
153
176
|
})
|
|
154
177
|
.command('get <name>', 'Print the source of a schema', (args) => args
|
|
155
|
-
.positional('name', {
|
|
178
|
+
.positional('name', {
|
|
179
|
+
type: 'string',
|
|
180
|
+
describe: 'Schema name (see `dcupl schemas list`)',
|
|
181
|
+
demandOption: true,
|
|
182
|
+
})
|
|
156
183
|
.option('example', { type: 'boolean', default: false, describe: 'Append a curated example payload' }), (argv) => {
|
|
157
184
|
const output = (0, output_1.createOutput)(argv.json);
|
|
158
185
|
(0, command_js_1.schemasGetCommand)({ name: argv.name, json: argv.json, example: argv.example }, output);
|
|
159
186
|
})
|
|
160
187
|
.command('validate <file>', 'Validate a JSON file against a registry schema (Zod-kind, e.g. TemplateV3)', (args) => args
|
|
161
|
-
.positional('file', {
|
|
162
|
-
|
|
188
|
+
.positional('file', {
|
|
189
|
+
type: 'string',
|
|
190
|
+
describe: 'Path to the JSON file to validate',
|
|
191
|
+
demandOption: true,
|
|
192
|
+
})
|
|
193
|
+
.option('against', {
|
|
194
|
+
type: 'string',
|
|
195
|
+
demandOption: true,
|
|
196
|
+
describe: 'Schema name to validate against (see `dcupl schemas list` — [Zod] entries only)',
|
|
197
|
+
}), async (argv) => {
|
|
163
198
|
const output = (0, output_1.createOutput)(argv.json);
|
|
164
199
|
try {
|
|
165
200
|
const { schemasValidateCommand } = await import('./functions/schemas/validate.js');
|
|
@@ -176,9 +211,20 @@ function buildCli(rawArgs) {
|
|
|
176
211
|
.command('workflow <subcommand>', 'Build, test, and deploy dcupl Workflow v3 templates. Auth: `dcupl config set` (projectId + apiKey).', (yy) => {
|
|
177
212
|
return yy
|
|
178
213
|
.command('validate', 'Validate a TemplateV3 file locally (and remotely if --runner is given).', (a) => a
|
|
179
|
-
.option('file', {
|
|
180
|
-
|
|
181
|
-
|
|
214
|
+
.option('file', {
|
|
215
|
+
type: 'string',
|
|
216
|
+
demandOption: true,
|
|
217
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
218
|
+
})
|
|
219
|
+
.option('runner', {
|
|
220
|
+
type: 'string',
|
|
221
|
+
describe: 'Runner uid or runnerKey for remote validation (feature limits, cycles, expressions)',
|
|
222
|
+
})
|
|
223
|
+
.option('local-only', {
|
|
224
|
+
type: 'boolean',
|
|
225
|
+
default: false,
|
|
226
|
+
describe: 'Skip remote validation even if --runner is set',
|
|
227
|
+
}), async (argv) => {
|
|
182
228
|
const { validateCommand } = await import('./functions/workflow/commands/validate.js');
|
|
183
229
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
184
230
|
try {
|
|
@@ -187,7 +233,11 @@ function buildCli(rawArgs) {
|
|
|
187
233
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
188
234
|
deps.client = mkClient();
|
|
189
235
|
}
|
|
190
|
-
await validateCommand(output, {
|
|
236
|
+
await validateCommand(output, {
|
|
237
|
+
file: argv.file,
|
|
238
|
+
runner: argv.runner,
|
|
239
|
+
localOnly: !!argv['local-only'],
|
|
240
|
+
}, deps);
|
|
191
241
|
}
|
|
192
242
|
catch (err) {
|
|
193
243
|
output.error(err.message, err.code || 'WORKFLOW_VALIDATE_FAILED');
|
|
@@ -251,19 +301,27 @@ function buildCli(rawArgs) {
|
|
|
251
301
|
.command('trace', 'Show the node-by-node execution state of a single run (debug a workflow run).', (a) => a
|
|
252
302
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
253
303
|
.option('run', { type: 'string', describe: 'Execution runId (from `workflow history`)' })
|
|
254
|
-
.option('last', {
|
|
304
|
+
.option('last', {
|
|
305
|
+
type: 'boolean',
|
|
306
|
+
default: false,
|
|
307
|
+
describe: 'Trace the most recent run instead of naming one with --run',
|
|
308
|
+
}), async (argv) => {
|
|
255
309
|
const { traceCommand } = await import('./functions/workflow/commands/trace.js');
|
|
256
310
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
257
311
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
258
312
|
try {
|
|
259
|
-
await traceCommand(output, mkClient(), {
|
|
313
|
+
await traceCommand(output, mkClient(), {
|
|
314
|
+
id: argv.id,
|
|
315
|
+
run: argv.run,
|
|
316
|
+
last: !!argv.last,
|
|
317
|
+
});
|
|
260
318
|
}
|
|
261
319
|
catch (err) {
|
|
262
320
|
output.error(err.message, err.code || 'WORKFLOW_TRACE_FAILED');
|
|
263
321
|
}
|
|
264
322
|
})
|
|
265
323
|
.command('runners [subcommand]', 'Inspect the runners available to this project.', (rr) => {
|
|
266
|
-
return rr
|
|
324
|
+
return (rr
|
|
267
325
|
.command(['list', '$0'], 'List the runners available to this project (uid / key / type / url / health).', () => { }, async (argv) => {
|
|
268
326
|
const { runnersCommand } = await import('./functions/workflow/commands/runners.js');
|
|
269
327
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
@@ -285,26 +343,51 @@ function buildCli(rawArgs) {
|
|
|
285
343
|
catch (err) {
|
|
286
344
|
output.error(err.message, err.code || 'WORKFLOW_RUNNERS_GET_FAILED');
|
|
287
345
|
}
|
|
288
|
-
});
|
|
346
|
+
}));
|
|
289
347
|
}, () => { })
|
|
290
348
|
.command('test', 'Deploy to a (dev) runner then exercise it: --node for one node, otherwise a full run.', (a) => a
|
|
291
|
-
.option('file', {
|
|
292
|
-
|
|
349
|
+
.option('file', {
|
|
350
|
+
type: 'string',
|
|
351
|
+
demandOption: true,
|
|
352
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
353
|
+
})
|
|
354
|
+
.option('runner', {
|
|
355
|
+
type: 'string',
|
|
356
|
+
demandOption: true,
|
|
357
|
+
describe: 'Runner uid or runnerKey to deploy+run against (use a dev/test runner)',
|
|
358
|
+
})
|
|
293
359
|
.option('node', { type: 'string', describe: 'Test a single node by id (uses test-node)' })
|
|
294
|
-
.option('input', {
|
|
360
|
+
.option('input', {
|
|
361
|
+
type: 'string',
|
|
362
|
+
describe: 'Path to a JSON file: test-node inputData, or full-run request body',
|
|
363
|
+
})
|
|
295
364
|
.option('state', { type: 'string', describe: 'Path to a JSON file: $state seed for test-node' })
|
|
296
|
-
.option('trigger-key', {
|
|
297
|
-
|
|
298
|
-
|
|
365
|
+
.option('trigger-key', {
|
|
366
|
+
type: 'string',
|
|
367
|
+
describe: 'api-key to pass to the runner if the trigger requires auth',
|
|
368
|
+
})
|
|
369
|
+
.option('wait', {
|
|
370
|
+
type: 'boolean',
|
|
371
|
+
default: true,
|
|
372
|
+
describe: 'Wait for the runner to hot-swap before triggering (--no-wait to skip)',
|
|
373
|
+
})
|
|
374
|
+
.option('swap-timeout', {
|
|
375
|
+
type: 'number',
|
|
376
|
+
describe: 'Max ms to wait for swap confirmation (default 30000)',
|
|
377
|
+
}), async (argv) => {
|
|
299
378
|
const { testCommand } = await import('./functions/workflow/commands/test.js');
|
|
300
379
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
301
380
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
302
381
|
try {
|
|
303
382
|
await testCommand(output, mkClient(), {
|
|
304
|
-
file: argv.file,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
383
|
+
file: argv.file,
|
|
384
|
+
runner: argv.runner,
|
|
385
|
+
node: argv.node,
|
|
386
|
+
input: argv.input,
|
|
387
|
+
state: argv.state,
|
|
388
|
+
triggerKey: argv['trigger-key'],
|
|
389
|
+
wait: argv.wait,
|
|
390
|
+
swapTimeout: argv['swap-timeout'],
|
|
308
391
|
});
|
|
309
392
|
}
|
|
310
393
|
catch (err) {
|
|
@@ -312,20 +395,43 @@ function buildCli(rawArgs) {
|
|
|
312
395
|
}
|
|
313
396
|
})
|
|
314
397
|
.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('
|
|
398
|
+
.positional('key', {
|
|
399
|
+
type: 'string',
|
|
400
|
+
demandOption: true,
|
|
401
|
+
describe: 'Deployed workflow key (as shown by `workflow list`; the bare template key also works)',
|
|
402
|
+
})
|
|
403
|
+
.option('runner', {
|
|
404
|
+
type: 'string',
|
|
405
|
+
demandOption: true,
|
|
406
|
+
describe: 'Runner uid or runnerKey the workflow is deployed on',
|
|
407
|
+
})
|
|
408
|
+
.option('body', {
|
|
409
|
+
type: 'string',
|
|
410
|
+
describe: 'Inline JSON: test-node inputData, or full-run request body (mutually exclusive with --input)',
|
|
411
|
+
})
|
|
412
|
+
.option('input', {
|
|
413
|
+
type: 'string',
|
|
414
|
+
describe: 'Path to a JSON file: test-node inputData, or full-run request body',
|
|
415
|
+
})
|
|
416
|
+
.option('node', {
|
|
417
|
+
type: 'string',
|
|
418
|
+
describe: 'Run a single node of the deployed workflow by id (uses test-node)',
|
|
419
|
+
})
|
|
420
|
+
.option('trigger-key', {
|
|
421
|
+
type: 'string',
|
|
422
|
+
describe: 'api-key to pass to the runner if the trigger requires auth',
|
|
423
|
+
}), async (argv) => {
|
|
321
424
|
const { runCommand } = await import('./functions/workflow/commands/run.js');
|
|
322
425
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
323
426
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
324
427
|
try {
|
|
325
428
|
await runCommand(output, mkClient(), {
|
|
326
|
-
key: argv.key,
|
|
327
|
-
|
|
328
|
-
|
|
429
|
+
key: argv.key,
|
|
430
|
+
runner: argv.runner,
|
|
431
|
+
body: argv.body,
|
|
432
|
+
input: argv.input,
|
|
433
|
+
node: argv.node,
|
|
434
|
+
triggerKey: argv['trigger-key'],
|
|
329
435
|
});
|
|
330
436
|
}
|
|
331
437
|
catch (err) {
|
|
@@ -333,16 +439,37 @@ function buildCli(rawArgs) {
|
|
|
333
439
|
}
|
|
334
440
|
})
|
|
335
441
|
.command('deploy', 'Validate (remote) then deploy a template to a runner. Confirms before going live.', (a) => a
|
|
336
|
-
.option('file', {
|
|
337
|
-
|
|
442
|
+
.option('file', {
|
|
443
|
+
type: 'string',
|
|
444
|
+
demandOption: true,
|
|
445
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
446
|
+
})
|
|
447
|
+
.option('runner', {
|
|
448
|
+
type: 'string',
|
|
449
|
+
demandOption: true,
|
|
450
|
+
describe: 'Runner uid or runnerKey to deploy to',
|
|
451
|
+
})
|
|
338
452
|
.option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI)' })
|
|
339
|
-
.option('wait', {
|
|
340
|
-
|
|
453
|
+
.option('wait', {
|
|
454
|
+
type: 'boolean',
|
|
455
|
+
default: true,
|
|
456
|
+
describe: 'Wait for the runner to hot-swap to this version before returning (--no-wait to skip)',
|
|
457
|
+
})
|
|
458
|
+
.option('swap-timeout', {
|
|
459
|
+
type: 'number',
|
|
460
|
+
describe: 'Max ms to wait for swap confirmation (default 30000)',
|
|
461
|
+
}), async (argv) => {
|
|
341
462
|
const { deployCommand } = await import('./functions/workflow/commands/deploy.js');
|
|
342
463
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
343
464
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
344
465
|
try {
|
|
345
|
-
await deployCommand(output, mkClient(), {
|
|
466
|
+
await deployCommand(output, mkClient(), {
|
|
467
|
+
file: argv.file,
|
|
468
|
+
runner: argv.runner,
|
|
469
|
+
yes: !!argv.yes,
|
|
470
|
+
wait: argv.wait,
|
|
471
|
+
swapTimeout: argv['swap-timeout'],
|
|
472
|
+
});
|
|
346
473
|
}
|
|
347
474
|
catch (err) {
|
|
348
475
|
output.error(err.message, err.code || 'WORKFLOW_DEPLOY_FAILED');
|
|
@@ -350,7 +477,11 @@ function buildCli(rawArgs) {
|
|
|
350
477
|
})
|
|
351
478
|
.command('undeploy', 'Undeploy (stop + remove) a deployed workflow by its uid.', (a) => a
|
|
352
479
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
353
|
-
.option('yes', {
|
|
480
|
+
.option('yes', {
|
|
481
|
+
type: 'boolean',
|
|
482
|
+
default: false,
|
|
483
|
+
describe: 'Skip the confirmation prompt (for CI)',
|
|
484
|
+
}), async (argv) => {
|
|
354
485
|
const { undeployCommand } = await import('./functions/workflow/commands/undeploy.js');
|
|
355
486
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
356
487
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -404,9 +535,21 @@ function buildCli(rawArgs) {
|
|
|
404
535
|
describe: 'Version id (defaults to HEAD, then "draft"). "production" is rejected.',
|
|
405
536
|
})
|
|
406
537
|
.option('name', { type: 'string', hidden: true })
|
|
407
|
-
.option('strict', {
|
|
408
|
-
|
|
409
|
-
|
|
538
|
+
.option('strict', {
|
|
539
|
+
type: 'boolean',
|
|
540
|
+
default: false,
|
|
541
|
+
describe: 'Delete server files no longer present locally. Default (additive) never deletes on the server.',
|
|
542
|
+
})
|
|
543
|
+
.option('yes', {
|
|
544
|
+
type: 'boolean',
|
|
545
|
+
default: false,
|
|
546
|
+
describe: 'Skip the deletion confirmation prompt (for CI).',
|
|
547
|
+
})
|
|
548
|
+
.option('force', {
|
|
549
|
+
type: 'boolean',
|
|
550
|
+
default: false,
|
|
551
|
+
describe: 'Resolve conflicts by uploading the local copy.',
|
|
552
|
+
})
|
|
410
553
|
.option('path', {
|
|
411
554
|
type: 'array',
|
|
412
555
|
string: true,
|
|
@@ -449,9 +592,21 @@ function buildCli(rawArgs) {
|
|
|
449
592
|
describe: 'Version id (defaults to HEAD, then "draft"). Switching versions requires a clean workspace or --force.',
|
|
450
593
|
})
|
|
451
594
|
.option('name', { type: 'string', hidden: true })
|
|
452
|
-
.option('strict', {
|
|
453
|
-
|
|
454
|
-
|
|
595
|
+
.option('strict', {
|
|
596
|
+
type: 'boolean',
|
|
597
|
+
default: false,
|
|
598
|
+
describe: 'Delete local files no longer present on the server. Default (additive) never deletes locally.',
|
|
599
|
+
})
|
|
600
|
+
.option('yes', {
|
|
601
|
+
type: 'boolean',
|
|
602
|
+
default: false,
|
|
603
|
+
describe: 'Skip the deletion confirmation prompt (for CI).',
|
|
604
|
+
})
|
|
605
|
+
.option('force', {
|
|
606
|
+
type: 'boolean',
|
|
607
|
+
default: false,
|
|
608
|
+
describe: 'Resolve conflicts by overwriting local with server. Also overrides the dirty-workspace switch refusal.',
|
|
609
|
+
})
|
|
455
610
|
.option('path', {
|
|
456
611
|
type: 'array',
|
|
457
612
|
string: true,
|
|
@@ -493,9 +648,17 @@ function buildCli(rawArgs) {
|
|
|
493
648
|
}
|
|
494
649
|
})
|
|
495
650
|
.command('list', 'List files in a version', (a) => a
|
|
496
|
-
.option('version', {
|
|
651
|
+
.option('version', {
|
|
652
|
+
alias: 'v',
|
|
653
|
+
type: 'string',
|
|
654
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
655
|
+
})
|
|
497
656
|
.option('search', { type: 'string', describe: 'Filter files by search query' })
|
|
498
|
-
.option('tree', {
|
|
657
|
+
.option('tree', {
|
|
658
|
+
type: 'boolean',
|
|
659
|
+
default: false,
|
|
660
|
+
describe: 'Render a nested directory tree instead of a flat list. Ignored when --json is set.',
|
|
661
|
+
}), async (argv) => {
|
|
499
662
|
const { listFilesCommand } = await import('./functions/files/commands/list.js');
|
|
500
663
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
501
664
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -512,9 +675,11 @@ function buildCli(rawArgs) {
|
|
|
512
675
|
output.error(err.error || err.message, err.code || 'LIST_FAILED');
|
|
513
676
|
}
|
|
514
677
|
})
|
|
515
|
-
.command('read', 'Read a single file from a version', (a) => a
|
|
516
|
-
|
|
517
|
-
|
|
678
|
+
.command('read', 'Read a single file from a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'File path' }).option('version', {
|
|
679
|
+
alias: 'v',
|
|
680
|
+
type: 'string',
|
|
681
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
682
|
+
}), async (argv) => {
|
|
518
683
|
const { readFileCommand } = await import('./functions/files/commands/read.js');
|
|
519
684
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
520
685
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -534,7 +699,11 @@ function buildCli(rawArgs) {
|
|
|
534
699
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
535
700
|
.option('content', { type: 'string', describe: 'Inline content to write' })
|
|
536
701
|
.option('file', { type: 'string', describe: 'Path to local file to upload' })
|
|
537
|
-
.option('version', {
|
|
702
|
+
.option('version', {
|
|
703
|
+
alias: 'v',
|
|
704
|
+
type: 'string',
|
|
705
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
706
|
+
}), async (argv) => {
|
|
538
707
|
const { writeFileCommand } = await import('./functions/files/commands/write.js');
|
|
539
708
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
540
709
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -554,9 +723,21 @@ function buildCli(rawArgs) {
|
|
|
554
723
|
})
|
|
555
724
|
.command('delete', 'Delete a single file from a version', (a) => a
|
|
556
725
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
557
|
-
.option('version', {
|
|
558
|
-
|
|
559
|
-
|
|
726
|
+
.option('version', {
|
|
727
|
+
alias: 'v',
|
|
728
|
+
type: 'string',
|
|
729
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
730
|
+
})
|
|
731
|
+
.option('yes', {
|
|
732
|
+
type: 'boolean',
|
|
733
|
+
default: false,
|
|
734
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
735
|
+
})
|
|
736
|
+
.option('dry-run', {
|
|
737
|
+
type: 'boolean',
|
|
738
|
+
default: false,
|
|
739
|
+
describe: 'Preview the delete without executing it.',
|
|
740
|
+
}), async (argv) => {
|
|
560
741
|
const { deleteFileCommand } = await import('./functions/files/commands/delete.js');
|
|
561
742
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
562
743
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -577,9 +758,21 @@ function buildCli(rawArgs) {
|
|
|
577
758
|
.command('move', 'Move/rename a file within a version (remote — does not touch local files).', (a) => a
|
|
578
759
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
579
760
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
580
|
-
.option('version', {
|
|
581
|
-
|
|
582
|
-
|
|
761
|
+
.option('version', {
|
|
762
|
+
alias: 'v',
|
|
763
|
+
type: 'string',
|
|
764
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
765
|
+
})
|
|
766
|
+
.option('yes', {
|
|
767
|
+
type: 'boolean',
|
|
768
|
+
default: false,
|
|
769
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
770
|
+
})
|
|
771
|
+
.option('dry-run', {
|
|
772
|
+
type: 'boolean',
|
|
773
|
+
default: false,
|
|
774
|
+
describe: 'Preview the move without executing it.',
|
|
775
|
+
}), async (argv) => {
|
|
583
776
|
const { moveFileCommand } = await import('./functions/files/commands/move.js');
|
|
584
777
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
585
778
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -601,7 +794,11 @@ function buildCli(rawArgs) {
|
|
|
601
794
|
.command('copy', 'Copy a single file within a version (remote — does not touch local files).', (a) => a
|
|
602
795
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
603
796
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
604
|
-
.option('version', {
|
|
797
|
+
.option('version', {
|
|
798
|
+
alias: 'v',
|
|
799
|
+
type: 'string',
|
|
800
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
801
|
+
}), async (argv) => {
|
|
605
802
|
const { copyFileCommand } = await import('./functions/files/commands/copy.js');
|
|
606
803
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
607
804
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -618,9 +815,11 @@ function buildCli(rawArgs) {
|
|
|
618
815
|
output.error(err.error || err.message, err.code || 'COPY_FAILED');
|
|
619
816
|
}
|
|
620
817
|
})
|
|
621
|
-
.command('create-folder', 'Create a folder in a version', (a) => a
|
|
622
|
-
|
|
623
|
-
|
|
818
|
+
.command('create-folder', 'Create a folder in a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'Folder path' }).option('version', {
|
|
819
|
+
alias: 'v',
|
|
820
|
+
type: 'string',
|
|
821
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
822
|
+
}), async (argv) => {
|
|
624
823
|
const { createFolderCommand } = await import('./functions/files/commands/create-folder.js');
|
|
625
824
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
626
825
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -650,10 +849,26 @@ function buildCli(rawArgs) {
|
|
|
650
849
|
}
|
|
651
850
|
})
|
|
652
851
|
.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
|
-
|
|
852
|
+
.option('from', {
|
|
853
|
+
type: 'string',
|
|
854
|
+
demandOption: true,
|
|
855
|
+
describe: 'Source version to copy files from',
|
|
856
|
+
})
|
|
857
|
+
.option('to', {
|
|
858
|
+
type: 'string',
|
|
859
|
+
demandOption: true,
|
|
860
|
+
describe: 'Target version id — created if new, otherwise its contents are replaced',
|
|
861
|
+
})
|
|
862
|
+
.option('yes', {
|
|
863
|
+
type: 'boolean',
|
|
864
|
+
default: false,
|
|
865
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
866
|
+
})
|
|
867
|
+
.option('dry-run', {
|
|
868
|
+
type: 'boolean',
|
|
869
|
+
default: false,
|
|
870
|
+
describe: 'Preview the copy without executing it.',
|
|
871
|
+
}), async (argv) => {
|
|
657
872
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
658
873
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
659
874
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -672,8 +887,16 @@ function buildCli(rawArgs) {
|
|
|
672
887
|
})
|
|
673
888
|
.command('delete <id>', 'Delete a version', (a) => a
|
|
674
889
|
.positional('id', { type: 'string', demandOption: true, describe: 'Version id to delete' })
|
|
675
|
-
.option('yes', {
|
|
676
|
-
|
|
890
|
+
.option('yes', {
|
|
891
|
+
type: 'boolean',
|
|
892
|
+
default: false,
|
|
893
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
894
|
+
})
|
|
895
|
+
.option('dry-run', {
|
|
896
|
+
type: 'boolean',
|
|
897
|
+
default: false,
|
|
898
|
+
describe: 'Preview the delete without executing it.',
|
|
899
|
+
}), async (argv) => {
|
|
677
900
|
const { deleteVersionCommand } = await import('./functions/files/commands/versions/delete.js');
|
|
678
901
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
679
902
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -696,8 +919,15 @@ function buildCli(rawArgs) {
|
|
|
696
919
|
.command('set', 'Create or update dcupl.config.json + dcupl.secrets.json. Interactive by default; flags skip prompts.', (a) => a
|
|
697
920
|
.option('project-id', { type: 'string', describe: 'dcupl Console project id' })
|
|
698
921
|
.option('api-key', { type: 'string', describe: 'dcupl Console API key' })
|
|
699
|
-
.option('console-api-url', {
|
|
700
|
-
|
|
922
|
+
.option('console-api-url', {
|
|
923
|
+
type: 'string',
|
|
924
|
+
describe: 'Override console API URL (for self-hosted / internal dev; leave unset for default)',
|
|
925
|
+
})
|
|
926
|
+
.option('yes', {
|
|
927
|
+
type: 'boolean',
|
|
928
|
+
default: false,
|
|
929
|
+
describe: 'Non-interactive mode. Requires --project-id and --api-key (or existing values in the files).',
|
|
930
|
+
}), async (argv) => {
|
|
701
931
|
const { configSetCommand } = await import('./functions/config/commands/set.js');
|
|
702
932
|
try {
|
|
703
933
|
await configSetCommand({
|
|
@@ -711,8 +941,11 @@ function buildCli(rawArgs) {
|
|
|
711
941
|
(0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_SET_FAILED');
|
|
712
942
|
}
|
|
713
943
|
})
|
|
714
|
-
.command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a
|
|
715
|
-
|
|
944
|
+
.command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a.option('show-secrets', {
|
|
945
|
+
type: 'boolean',
|
|
946
|
+
default: false,
|
|
947
|
+
describe: 'Reveal apiKey instead of ***last4',
|
|
948
|
+
}), async (argv) => {
|
|
716
949
|
const { configGetCommand } = await import('./functions/config/commands/get.js');
|
|
717
950
|
try {
|
|
718
951
|
await configGetCommand({
|
|
@@ -727,20 +960,45 @@ function buildCli(rawArgs) {
|
|
|
727
960
|
.demandCommand(1);
|
|
728
961
|
})
|
|
729
962
|
.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', {
|
|
963
|
+
.option('source', {
|
|
964
|
+
type: 'string',
|
|
965
|
+
choices: ['local', 'remote'],
|
|
966
|
+
describe: 'Project source (inferred when omitted)',
|
|
967
|
+
})
|
|
731
968
|
.option('lc-json', { type: 'string', describe: 'Loader config path (local source)' })
|
|
732
|
-
.option('auto-serve', {
|
|
969
|
+
.option('auto-serve', {
|
|
970
|
+
type: 'boolean',
|
|
971
|
+
describe: 'Auto-spawn dcupl serve for local source (default: on; throwaway, auto-cleaned). Use --no-auto-serve to opt out.',
|
|
972
|
+
})
|
|
733
973
|
.option('project-id', { type: 'string', describe: 'Console project id (remote source)' })
|
|
734
974
|
.option('api-key', { type: 'string', describe: 'Console API key (remote source)' })
|
|
735
975
|
.option('version', { type: 'string', describe: 'Console version id (remote source, default: draft)' })
|
|
736
976
|
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
737
977
|
.option('app-key', { type: 'string', describe: 'Application key for the process step' })
|
|
738
|
-
.option('env', {
|
|
978
|
+
.option('env', {
|
|
979
|
+
type: 'array',
|
|
980
|
+
string: true,
|
|
981
|
+
describe: 'Environment keys for the process step (repeatable)',
|
|
982
|
+
})
|
|
739
983
|
.option('tag', { type: 'array', string: true, describe: 'Resource tags for the process step (repeatable)' })
|
|
740
|
-
.option('var', {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
984
|
+
.option('var', {
|
|
985
|
+
type: 'array',
|
|
986
|
+
string: true,
|
|
987
|
+
describe: 'Variables KEY=VALUE for the process step (repeatable)',
|
|
988
|
+
})
|
|
989
|
+
.option('limit', {
|
|
990
|
+
type: 'number',
|
|
991
|
+
default: 10,
|
|
992
|
+
describe: 'Max error records in the report (top findings)',
|
|
993
|
+
})
|
|
994
|
+
.option('quality', {
|
|
995
|
+
type: 'boolean',
|
|
996
|
+
describe: 'Enable model & data quality checks incl. error tracking (default: true). Use --quality false for a structural-only load.',
|
|
997
|
+
})
|
|
998
|
+
.option('max-memory', {
|
|
999
|
+
type: 'number',
|
|
1000
|
+
describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
|
|
1001
|
+
}), async (argv) => {
|
|
744
1002
|
const { validateCommand } = await import('./functions/app/commands/validate.js');
|
|
745
1003
|
const output = (0, output_1.createOutput)(argv.json);
|
|
746
1004
|
try {
|
|
@@ -766,41 +1024,123 @@ function buildCli(rawArgs) {
|
|
|
766
1024
|
}
|
|
767
1025
|
})
|
|
768
1026
|
.command('app <subcommand>', 'Run local dcupl daemons to query and analyze tabular data', (yy) => {
|
|
769
|
-
return yy
|
|
1027
|
+
return (yy
|
|
770
1028
|
.command('create', 'Start a new daemon and register an app', (a) => a
|
|
771
1029
|
.option('app', { type: 'string', describe: 'App id (auto-generated if omitted)' })
|
|
772
1030
|
.option('idle-timeout', { type: 'number', default: 30, describe: 'Idle timeout in minutes' })
|
|
773
|
-
.option('auto-update', {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
1031
|
+
.option('auto-update', {
|
|
1032
|
+
type: 'boolean',
|
|
1033
|
+
default: false,
|
|
1034
|
+
describe: 'Auto-run update() after every mutation. Default (off): mutations stage changes, run `dcupl app build` to apply (mirrors the SDK).',
|
|
1035
|
+
})
|
|
1036
|
+
.option('auto-generate-properties', {
|
|
1037
|
+
type: 'boolean',
|
|
1038
|
+
default: false,
|
|
1039
|
+
describe: 'Infer model schema from the data on first ingest. Daemon-wide default; override per call on `app data <verb>`.',
|
|
1040
|
+
})
|
|
1041
|
+
.option('auto-generate-deep', {
|
|
1042
|
+
type: 'boolean',
|
|
1043
|
+
default: false,
|
|
1044
|
+
describe: 'When inferring model schema, walk every row and reconcile types (handles row-1 blanks). Implies --auto-generate-properties.',
|
|
1045
|
+
})
|
|
1046
|
+
.option('auto-generate-sample-size', {
|
|
1047
|
+
type: 'number',
|
|
1048
|
+
describe: 'When inferring model schema, sample at most N rows (implies deep). Useful for large CSVs where row 1 may not represent the schema.',
|
|
1049
|
+
})
|
|
1050
|
+
.option('quality', {
|
|
1051
|
+
type: 'boolean',
|
|
1052
|
+
describe: 'Enable model & data quality checks (default: true). Use `--quality false` to opt out.',
|
|
1053
|
+
})
|
|
778
1054
|
.option('cache', { type: 'boolean', describe: 'Enable internal API caching (default: true)' })
|
|
779
|
-
.option('clone', {
|
|
780
|
-
|
|
781
|
-
|
|
1055
|
+
.option('clone', {
|
|
1056
|
+
type: 'boolean',
|
|
1057
|
+
describe: 'Enable deep data clones to avoid mutation side-effects (default: false)',
|
|
1058
|
+
})
|
|
1059
|
+
.option('analytics', {
|
|
1060
|
+
type: 'boolean',
|
|
1061
|
+
describe: 'Enable analytics instrumentation (default: true)',
|
|
1062
|
+
})
|
|
1063
|
+
.option('reference-metadata', {
|
|
1064
|
+
type: 'boolean',
|
|
1065
|
+
describe: 'Enable reference metadata resolution (default: true)',
|
|
1066
|
+
})
|
|
782
1067
|
.option('logging-level', { type: 'string', choices: init_options_js_1.LOG_LEVELS, describe: 'Minimum SDK log level' })
|
|
783
|
-
.option('logging-format', {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
1068
|
+
.option('logging-format', {
|
|
1069
|
+
type: 'string',
|
|
1070
|
+
choices: [...init_options_js_1.LOG_FORMATS],
|
|
1071
|
+
describe: 'SDK log output format',
|
|
1072
|
+
})
|
|
1073
|
+
.option('max-memory', {
|
|
1074
|
+
type: 'number',
|
|
1075
|
+
describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
|
|
1076
|
+
})
|
|
1077
|
+
.option('max-body', {
|
|
1078
|
+
type: 'string',
|
|
1079
|
+
default: '2gb',
|
|
1080
|
+
describe: 'Max request body size, e.g. 2gb, 500mb',
|
|
1081
|
+
})
|
|
1082
|
+
.option('load', {
|
|
1083
|
+
type: 'boolean',
|
|
1084
|
+
describe: 'After creating the daemon, register, process, and build a loader so the app is immediately queryable',
|
|
1085
|
+
})
|
|
787
1086
|
.option('key', { type: 'string', describe: 'Loader key for --load (auto-generated if omitted)' })
|
|
788
|
-
.option('source', {
|
|
789
|
-
|
|
790
|
-
|
|
1087
|
+
.option('source', {
|
|
1088
|
+
type: 'string',
|
|
1089
|
+
choices: ['local', 'remote', 'url'],
|
|
1090
|
+
describe: 'Loader source for --load (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
|
|
1091
|
+
})
|
|
1092
|
+
.option('workspace', {
|
|
1093
|
+
type: 'boolean',
|
|
1094
|
+
describe: 'Use local dcupl workspace as loader source (--load)',
|
|
1095
|
+
})
|
|
1096
|
+
.option('project-id', {
|
|
1097
|
+
type: 'string',
|
|
1098
|
+
describe: 'dcupl Console project id (cdn loader source, --load). CDN host: see --cdn-base-url',
|
|
1099
|
+
})
|
|
791
1100
|
.option('api-key', { type: 'string', describe: 'Console API key (--load)' })
|
|
792
|
-
.option('version', {
|
|
1101
|
+
.option('version', {
|
|
1102
|
+
type: 'string',
|
|
1103
|
+
describe: 'Console version id (cdn loader source, default: draft)',
|
|
1104
|
+
})
|
|
793
1105
|
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
794
1106
|
.option('base-url', { type: 'string', describe: 'Custom base URL loader source (--load)' })
|
|
795
|
-
.option('loader-file', {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
.option('
|
|
1107
|
+
.option('loader-file', {
|
|
1108
|
+
type: 'string',
|
|
1109
|
+
describe: 'Loader file name for base-url source (--load)',
|
|
1110
|
+
})
|
|
1111
|
+
.option('header', {
|
|
1112
|
+
type: 'array',
|
|
1113
|
+
string: true,
|
|
1114
|
+
describe: 'HTTP headers for base-url source KEY=VALUE (repeatable, --load)',
|
|
1115
|
+
})
|
|
1116
|
+
.option('lc-json', {
|
|
1117
|
+
type: 'string',
|
|
1118
|
+
describe: 'Path to loader config file (workspace source, --load)',
|
|
1119
|
+
})
|
|
1120
|
+
.option('auto-serve', {
|
|
1121
|
+
type: 'boolean',
|
|
1122
|
+
describe: 'Auto-spawn dcupl serve if not running (workspace source, --load)',
|
|
1123
|
+
})
|
|
1124
|
+
.option('auto-serve-port', {
|
|
1125
|
+
type: 'string',
|
|
1126
|
+
describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned (--load)',
|
|
1127
|
+
})
|
|
800
1128
|
.option('app-key', { type: 'string', describe: 'Application key for process step (--load)' })
|
|
801
|
-
.option('env', {
|
|
802
|
-
|
|
803
|
-
|
|
1129
|
+
.option('env', {
|
|
1130
|
+
type: 'array',
|
|
1131
|
+
string: true,
|
|
1132
|
+
describe: 'Environment keys for process step (repeatable, --load)',
|
|
1133
|
+
})
|
|
1134
|
+
.option('tag', {
|
|
1135
|
+
type: 'array',
|
|
1136
|
+
string: true,
|
|
1137
|
+
describe: 'Resource tags for process step (repeatable, comma-separate for AND, --load)',
|
|
1138
|
+
})
|
|
1139
|
+
.option('var', {
|
|
1140
|
+
type: 'array',
|
|
1141
|
+
string: true,
|
|
1142
|
+
describe: 'Variables KEY=VALUE for process step (repeatable, --load)',
|
|
1143
|
+
}), async (argv) => {
|
|
804
1144
|
const { createCommand } = await import('./functions/app/commands/create.js');
|
|
805
1145
|
const output = (0, output_1.createOutput)(argv.json);
|
|
806
1146
|
try {
|
|
@@ -848,9 +1188,11 @@ function buildCli(rawArgs) {
|
|
|
848
1188
|
output.error(err.message, err.code || 'CREATE_FAILED', err.details === undefined ? undefined : { details: err.details });
|
|
849
1189
|
}
|
|
850
1190
|
})
|
|
851
|
-
.command('destroy', 'Stop a daemon', (a) => a
|
|
852
|
-
|
|
853
|
-
|
|
1191
|
+
.command('destroy', 'Stop a daemon', (a) => a.option('app', { type: 'string' }).option('keep-logs', {
|
|
1192
|
+
type: 'boolean',
|
|
1193
|
+
default: false,
|
|
1194
|
+
describe: 'Keep the daemon log file after destroy',
|
|
1195
|
+
}), async (argv) => {
|
|
854
1196
|
const { destroyCommand } = await import('./functions/app/commands/destroy.js');
|
|
855
1197
|
const output = (0, output_1.createOutput)(argv.json);
|
|
856
1198
|
try {
|
|
@@ -926,12 +1268,17 @@ function buildCli(rawArgs) {
|
|
|
926
1268
|
.command('set', 'Set a model from a JSON file or inline content', (a) => a
|
|
927
1269
|
.option('app', { type: 'string' })
|
|
928
1270
|
.option('file', { type: 'string', describe: 'Path to model JSON file' })
|
|
929
|
-
.option('content', {
|
|
1271
|
+
.option('content', {
|
|
1272
|
+
type: 'string',
|
|
1273
|
+
describe: 'Inline JSON model definition (use "-" to read from stdin)',
|
|
1274
|
+
}), async (argv) => {
|
|
930
1275
|
const { setCommand } = await import('./functions/app/commands/models/set.js');
|
|
931
1276
|
const output = (0, output_1.createOutput)(argv.json);
|
|
932
1277
|
try {
|
|
933
1278
|
const content = argv.content !== undefined
|
|
934
|
-
?
|
|
1279
|
+
? argv.content === '' && argv._.includes('-')
|
|
1280
|
+
? '-'
|
|
1281
|
+
: argv.content
|
|
935
1282
|
: undefined;
|
|
936
1283
|
await setCommand(output, { appId: argv.app, file: argv.file, content });
|
|
937
1284
|
}
|
|
@@ -953,26 +1300,46 @@ function buildCli(rawArgs) {
|
|
|
953
1300
|
.command('data <verb>', 'Ingest data', (yyy) => {
|
|
954
1301
|
const dataOpts = (a) => a
|
|
955
1302
|
.option('app', { type: 'string' })
|
|
956
|
-
.option('file', {
|
|
1303
|
+
.option('file', {
|
|
1304
|
+
type: 'string',
|
|
1305
|
+
describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest',
|
|
1306
|
+
})
|
|
957
1307
|
.option('url', { type: 'string', describe: 'Remote URL to fetch the data payload from' })
|
|
958
1308
|
.option('content', { type: 'string', describe: 'Inline payload (use "-" to read from stdin)' })
|
|
959
1309
|
.option('format', { type: 'string', choices: ['csv', 'json', 'ndjson'] })
|
|
960
1310
|
.option('model', { type: 'string', demandOption: true })
|
|
961
1311
|
.option('key-property', { type: 'string' })
|
|
962
1312
|
.option('auto-generate-key', { type: 'boolean', default: false })
|
|
963
|
-
.option('auto-generate-properties', {
|
|
964
|
-
|
|
965
|
-
|
|
1313
|
+
.option('auto-generate-properties', {
|
|
1314
|
+
type: 'boolean',
|
|
1315
|
+
describe: 'Override daemon default for this call (use --no-auto-generate-properties to force off)',
|
|
1316
|
+
})
|
|
1317
|
+
.option('auto-generate-deep', {
|
|
1318
|
+
type: 'boolean',
|
|
1319
|
+
describe: 'Walk every row when inferring (implies --auto-generate-properties)',
|
|
1320
|
+
})
|
|
1321
|
+
.option('auto-generate-sample-size', {
|
|
1322
|
+
type: 'number',
|
|
1323
|
+
describe: 'Sample N rows when inferring (implies deep)',
|
|
1324
|
+
});
|
|
966
1325
|
const handler = (mod, exportName, code) => async (argv) => {
|
|
967
1326
|
const m = await import(`./functions/app/commands/data/${mod}.js`);
|
|
968
1327
|
const output = (0, output_1.createOutput)(argv.json);
|
|
969
1328
|
try {
|
|
970
1329
|
const content = argv.content !== undefined
|
|
971
|
-
?
|
|
1330
|
+
? argv.content === '' && argv._.includes('-')
|
|
1331
|
+
? '-'
|
|
1332
|
+
: argv.content
|
|
972
1333
|
: undefined;
|
|
973
1334
|
await m[exportName](output, {
|
|
974
|
-
appId: argv.app,
|
|
975
|
-
|
|
1335
|
+
appId: argv.app,
|
|
1336
|
+
file: argv.file,
|
|
1337
|
+
url: argv.url,
|
|
1338
|
+
content,
|
|
1339
|
+
format: argv.format,
|
|
1340
|
+
model: argv.model,
|
|
1341
|
+
keyProperty: argv.keyProperty,
|
|
1342
|
+
autoGenerateKey: argv.autoGenerateKey,
|
|
976
1343
|
autoGenerateProperties: argv.autoGenerateProperties,
|
|
977
1344
|
autoGenerateDeep: argv.autoGenerateDeep,
|
|
978
1345
|
autoGenerateSampleSize: argv.autoGenerateSampleSize,
|
|
@@ -1000,7 +1367,10 @@ function buildCli(rawArgs) {
|
|
|
1000
1367
|
.demandCommand(1);
|
|
1001
1368
|
})
|
|
1002
1369
|
.command('query <verb>', 'Query records', (yyy) => yyy
|
|
1003
|
-
.command('one', 'Fetch single record', (a) => a
|
|
1370
|
+
.command('one', 'Fetch single record', (a) => a
|
|
1371
|
+
.option('app', { type: 'string' })
|
|
1372
|
+
.option('model', { type: 'string', demandOption: true })
|
|
1373
|
+
.option('item-key', { type: 'string', demandOption: true }), async (argv) => {
|
|
1004
1374
|
const { oneCommand } = await import('./functions/app/commands/query/one.js');
|
|
1005
1375
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1006
1376
|
try {
|
|
@@ -1023,9 +1393,13 @@ function buildCli(rawArgs) {
|
|
|
1023
1393
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1024
1394
|
try {
|
|
1025
1395
|
await executeCommand(output, {
|
|
1026
|
-
appId: argv.app,
|
|
1027
|
-
|
|
1028
|
-
|
|
1396
|
+
appId: argv.app,
|
|
1397
|
+
model: argv.model,
|
|
1398
|
+
query: argv.query,
|
|
1399
|
+
queryFile: argv.queryFile,
|
|
1400
|
+
sort: argv.sort,
|
|
1401
|
+
limit: argv.limit,
|
|
1402
|
+
start: argv.start,
|
|
1029
1403
|
projection: argv.projection,
|
|
1030
1404
|
});
|
|
1031
1405
|
}
|
|
@@ -1050,15 +1424,32 @@ function buildCli(rawArgs) {
|
|
|
1050
1424
|
choices: ['size-desc', 'size-asc', 'value-asc', 'value-desc'],
|
|
1051
1425
|
describe: 'Deterministic ordering (opt-in; walks all keys). Use size-desc for top-N-by-count.',
|
|
1052
1426
|
})
|
|
1053
|
-
.option('full', {
|
|
1054
|
-
|
|
1427
|
+
.option('full', {
|
|
1428
|
+
type: 'boolean',
|
|
1429
|
+
default: false,
|
|
1430
|
+
describe: 'Return full SDK facet shape (resultKeys, entry, enabled, selected)',
|
|
1431
|
+
})
|
|
1432
|
+
.option('include-results', {
|
|
1433
|
+
type: 'boolean',
|
|
1434
|
+
default: false,
|
|
1435
|
+
describe: 'Keep resultKeys in compact output',
|
|
1436
|
+
}), async (argv) => {
|
|
1055
1437
|
const { facetsCommand } = await import('./functions/app/commands/fn/facets.js');
|
|
1056
1438
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1057
1439
|
try {
|
|
1058
1440
|
await facetsCommand(output, {
|
|
1059
|
-
appId: argv.app,
|
|
1060
|
-
|
|
1061
|
-
|
|
1441
|
+
appId: argv.app,
|
|
1442
|
+
model: argv.model,
|
|
1443
|
+
attribute: argv.attribute,
|
|
1444
|
+
excludeZeros: argv.excludeZeros,
|
|
1445
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1446
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1447
|
+
query: argv.query,
|
|
1448
|
+
queryFile: argv.queryFile,
|
|
1449
|
+
limit: argv.limit,
|
|
1450
|
+
sort: argv.sort,
|
|
1451
|
+
full: argv.full,
|
|
1452
|
+
includeResults: argv.includeResults,
|
|
1062
1453
|
});
|
|
1063
1454
|
}
|
|
1064
1455
|
catch (err) {
|
|
@@ -1069,11 +1460,21 @@ function buildCli(rawArgs) {
|
|
|
1069
1460
|
.option('app', { type: 'string' })
|
|
1070
1461
|
.option('model', { type: 'string', demandOption: true })
|
|
1071
1462
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1072
|
-
.option('types', {
|
|
1463
|
+
.option('types', {
|
|
1464
|
+
type: 'string',
|
|
1465
|
+
describe: 'Comma-separated: distinct,count,sum,avg,min,max,group. Optional when --bins/--group-options supply grouping.',
|
|
1466
|
+
})
|
|
1073
1467
|
.option('query', { type: 'string' })
|
|
1074
1468
|
.option('query-file', { type: 'string' })
|
|
1075
|
-
.option('include-keys', {
|
|
1076
|
-
|
|
1469
|
+
.option('include-keys', {
|
|
1470
|
+
type: 'boolean',
|
|
1471
|
+
default: false,
|
|
1472
|
+
describe: 'Include row keys in distinct results',
|
|
1473
|
+
})
|
|
1474
|
+
.option('bins', {
|
|
1475
|
+
type: 'string',
|
|
1476
|
+
describe: 'Numeric ranges for grouping, e.g. 0-100,100-200,200-',
|
|
1477
|
+
})
|
|
1077
1478
|
.option('group-options', { type: 'string', describe: 'Full groupOptions JSON' })
|
|
1078
1479
|
.option('group-options-file', { type: 'string', describe: 'Path to groupOptions JSON' })
|
|
1079
1480
|
.option('distinct-limit', { type: 'number', describe: 'Cap distinct values' })
|
|
@@ -1084,10 +1485,20 @@ function buildCli(rawArgs) {
|
|
|
1084
1485
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1085
1486
|
try {
|
|
1086
1487
|
await aggregateCommand(output, {
|
|
1087
|
-
appId: argv.app,
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1488
|
+
appId: argv.app,
|
|
1489
|
+
model: argv.model,
|
|
1490
|
+
attribute: argv.attribute,
|
|
1491
|
+
types: argv.types,
|
|
1492
|
+
query: argv.query,
|
|
1493
|
+
queryFile: argv.queryFile,
|
|
1494
|
+
includeKeys: argv.includeKeys,
|
|
1495
|
+
bins: argv.bins,
|
|
1496
|
+
groupOptions: argv.groupOptions,
|
|
1497
|
+
groupOptionsFile: argv.groupOptionsFile,
|
|
1498
|
+
distinctLimit: argv.distinctLimit,
|
|
1499
|
+
excludeZeros: argv.excludeZeros,
|
|
1500
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1501
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1091
1502
|
});
|
|
1092
1503
|
}
|
|
1093
1504
|
catch (err) {
|
|
@@ -1100,7 +1511,10 @@ function buildCli(rawArgs) {
|
|
|
1100
1511
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1101
1512
|
.option('query', { type: 'string' })
|
|
1102
1513
|
.option('query-file', { type: 'string' })
|
|
1103
|
-
.option('aggregate', {
|
|
1514
|
+
.option('aggregate', {
|
|
1515
|
+
type: 'array',
|
|
1516
|
+
describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.',
|
|
1517
|
+
})
|
|
1104
1518
|
.option('exclude-zeros', { type: 'boolean' })
|
|
1105
1519
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1106
1520
|
.option('exclude-unresolved', { type: 'boolean' })
|
|
@@ -1111,9 +1525,18 @@ function buildCli(rawArgs) {
|
|
|
1111
1525
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1112
1526
|
try {
|
|
1113
1527
|
await groupByCommand(output, {
|
|
1114
|
-
appId: argv.app,
|
|
1115
|
-
|
|
1116
|
-
|
|
1528
|
+
appId: argv.app,
|
|
1529
|
+
model: argv.model,
|
|
1530
|
+
attribute: argv.attribute,
|
|
1531
|
+
query: argv.query,
|
|
1532
|
+
queryFile: argv.queryFile,
|
|
1533
|
+
aggregate: argv.aggregate,
|
|
1534
|
+
excludeZeros: argv.excludeZeros,
|
|
1535
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1536
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1537
|
+
sort: argv.sort,
|
|
1538
|
+
limit: argv.limit,
|
|
1539
|
+
start: argv.start,
|
|
1117
1540
|
});
|
|
1118
1541
|
}
|
|
1119
1542
|
catch (err) {
|
|
@@ -1128,7 +1551,12 @@ function buildCli(rawArgs) {
|
|
|
1128
1551
|
const { metadataCommand } = await import('./functions/app/commands/fn/metadata.js');
|
|
1129
1552
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1130
1553
|
try {
|
|
1131
|
-
await metadataCommand(output, {
|
|
1554
|
+
await metadataCommand(output, {
|
|
1555
|
+
appId: argv.app,
|
|
1556
|
+
model: argv.model,
|
|
1557
|
+
query: argv.query,
|
|
1558
|
+
queryFile: argv.queryFile,
|
|
1559
|
+
});
|
|
1132
1560
|
}
|
|
1133
1561
|
catch (err) {
|
|
1134
1562
|
output.error(err.message, err.code || 'FN_METADATA_FAILED');
|
|
@@ -1137,11 +1565,20 @@ function buildCli(rawArgs) {
|
|
|
1137
1565
|
.command('pivot', 'Multi-dimensional cross-tab (rows x columns x values)', (a) => a
|
|
1138
1566
|
.option('app', { type: 'string' })
|
|
1139
1567
|
.option('model', { type: 'string', demandOption: true })
|
|
1140
|
-
.option('rows', {
|
|
1141
|
-
|
|
1568
|
+
.option('rows', {
|
|
1569
|
+
type: 'array',
|
|
1570
|
+
describe: 'Row attribute(s); append :totals for row totals. Repeatable.',
|
|
1571
|
+
})
|
|
1572
|
+
.option('columns', {
|
|
1573
|
+
type: 'array',
|
|
1574
|
+
describe: 'Column attribute(s); append :totals. Repeatable.',
|
|
1575
|
+
})
|
|
1142
1576
|
.option('values', { type: 'array', describe: 'Aggregations <attr>:<type[,type]>. Repeatable.' })
|
|
1143
1577
|
.option('totals', { type: 'boolean', describe: 'Compute grand totals' })
|
|
1144
|
-
.option('spec', {
|
|
1578
|
+
.option('spec', {
|
|
1579
|
+
type: 'string',
|
|
1580
|
+
describe: 'Full PivotOptions JSON (mutually exclusive with shorthand flags)',
|
|
1581
|
+
})
|
|
1145
1582
|
.option('spec-file', { type: 'string', describe: 'Path to PivotOptions JSON' })
|
|
1146
1583
|
.option('query', { type: 'string' })
|
|
1147
1584
|
.option('query-file', { type: 'string' }), async (argv) => {
|
|
@@ -1149,10 +1586,16 @@ function buildCli(rawArgs) {
|
|
|
1149
1586
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1150
1587
|
try {
|
|
1151
1588
|
await pivotCommand(output, {
|
|
1152
|
-
appId: argv.app,
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1589
|
+
appId: argv.app,
|
|
1590
|
+
model: argv.model,
|
|
1591
|
+
rows: argv.rows,
|
|
1592
|
+
columns: argv.columns,
|
|
1593
|
+
values: argv.values,
|
|
1594
|
+
totals: argv.totals,
|
|
1595
|
+
spec: argv.spec,
|
|
1596
|
+
specFile: argv.specFile,
|
|
1597
|
+
query: argv.query,
|
|
1598
|
+
queryFile: argv.queryFile,
|
|
1156
1599
|
});
|
|
1157
1600
|
}
|
|
1158
1601
|
catch (err) {
|
|
@@ -1165,7 +1608,10 @@ function buildCli(rawArgs) {
|
|
|
1165
1608
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1166
1609
|
.option('value', { type: 'string', demandOption: true })
|
|
1167
1610
|
.option('max', { type: 'number' })
|
|
1168
|
-
.option('relevant-data', {
|
|
1611
|
+
.option('relevant-data', {
|
|
1612
|
+
type: 'string',
|
|
1613
|
+
choices: ['filtered', 'all', 'excludeQuery'],
|
|
1614
|
+
})
|
|
1169
1615
|
.option('calculate-result-keys', { type: 'boolean' })
|
|
1170
1616
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1171
1617
|
.option('exclude-nulls', { type: 'boolean' })
|
|
@@ -1177,11 +1623,19 @@ function buildCli(rawArgs) {
|
|
|
1177
1623
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1178
1624
|
try {
|
|
1179
1625
|
await suggestCommand(output, {
|
|
1180
|
-
appId: argv.app,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1626
|
+
appId: argv.app,
|
|
1627
|
+
model: argv.model,
|
|
1628
|
+
attribute: argv.attribute,
|
|
1629
|
+
value: argv.value,
|
|
1630
|
+
max: argv.max,
|
|
1631
|
+
relevantData: argv.relevantData,
|
|
1632
|
+
calculateResultKeys: argv.calculateResultKeys,
|
|
1633
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1634
|
+
excludeNulls: argv.excludeNulls,
|
|
1635
|
+
excludeQuery: argv.excludeQuery,
|
|
1636
|
+
excludeQueryFile: argv.excludeQueryFile,
|
|
1637
|
+
query: argv.query,
|
|
1638
|
+
queryFile: argv.queryFile,
|
|
1185
1639
|
});
|
|
1186
1640
|
}
|
|
1187
1641
|
catch (err) {
|
|
@@ -1193,18 +1647,38 @@ function buildCli(rawArgs) {
|
|
|
1193
1647
|
.command('add', 'Register a loader source', (a) => a
|
|
1194
1648
|
.option('app', { type: 'string', describe: 'App id' })
|
|
1195
1649
|
.option('key', { type: 'string', describe: 'Loader key (auto-generated if omitted)' })
|
|
1196
|
-
.option('source', {
|
|
1650
|
+
.option('source', {
|
|
1651
|
+
type: 'string',
|
|
1652
|
+
choices: ['local', 'remote', 'url'],
|
|
1653
|
+
describe: 'Loader source (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
|
|
1654
|
+
})
|
|
1197
1655
|
.option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as source' })
|
|
1198
|
-
.option('project-id', {
|
|
1656
|
+
.option('project-id', {
|
|
1657
|
+
type: 'string',
|
|
1658
|
+
describe: 'dcupl Console project id (cdn source). CDN host: see --cdn-base-url',
|
|
1659
|
+
})
|
|
1199
1660
|
.option('api-key', { type: 'string', describe: 'Console API key' })
|
|
1200
|
-
.option('version', {
|
|
1661
|
+
.option('version', {
|
|
1662
|
+
type: 'string',
|
|
1663
|
+
describe: 'Console version id (cdn source, default: draft)',
|
|
1664
|
+
})
|
|
1201
1665
|
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
1202
1666
|
.option('base-url', { type: 'string', describe: 'Custom base URL source' })
|
|
1203
1667
|
.option('loader-file', { type: 'string', describe: 'Loader file name for base-url source' })
|
|
1204
|
-
.option('header', {
|
|
1668
|
+
.option('header', {
|
|
1669
|
+
type: 'array',
|
|
1670
|
+
string: true,
|
|
1671
|
+
describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)',
|
|
1672
|
+
})
|
|
1205
1673
|
.option('lc-json', { type: 'string', describe: 'Path to loader config (workspace source)' })
|
|
1206
|
-
.option('auto-serve', {
|
|
1207
|
-
|
|
1674
|
+
.option('auto-serve', {
|
|
1675
|
+
type: 'boolean',
|
|
1676
|
+
describe: 'Auto-spawn dcupl serve if not running (workspace source)',
|
|
1677
|
+
})
|
|
1678
|
+
.option('auto-serve-port', {
|
|
1679
|
+
type: 'string',
|
|
1680
|
+
describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned',
|
|
1681
|
+
}), async (argv) => {
|
|
1208
1682
|
const { addLoaderCommand } = await import('./functions/app/commands/loaders/add.js');
|
|
1209
1683
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1210
1684
|
try {
|
|
@@ -1236,7 +1710,11 @@ function buildCli(rawArgs) {
|
|
|
1236
1710
|
.option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' })
|
|
1237
1711
|
.option('app-key', { type: 'string', describe: 'Application key' })
|
|
1238
1712
|
.option('env', { type: 'array', string: true, describe: 'Environment keys (repeatable)' })
|
|
1239
|
-
.option('tag', {
|
|
1713
|
+
.option('tag', {
|
|
1714
|
+
type: 'array',
|
|
1715
|
+
string: true,
|
|
1716
|
+
describe: 'Resource tags (repeatable, comma-separate for AND)',
|
|
1717
|
+
})
|
|
1240
1718
|
.option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE (repeatable)' }), async (argv) => {
|
|
1241
1719
|
const { processLoaderCommand } = await import('./functions/app/commands/loaders/process.js');
|
|
1242
1720
|
const output = (0, output_1.createOutput)(argv.json);
|
|
@@ -1291,7 +1769,7 @@ function buildCli(rawArgs) {
|
|
|
1291
1769
|
}
|
|
1292
1770
|
})
|
|
1293
1771
|
.demandCommand(1))
|
|
1294
|
-
.demandCommand(1);
|
|
1772
|
+
.demandCommand(1));
|
|
1295
1773
|
}, () => { })
|
|
1296
1774
|
.command('version', 'Print the CLI version and the resolved @dcupl/* package versions', () => { }, (argv) => {
|
|
1297
1775
|
(0, command_js_2.versionCommand)((0, output_1.createOutput)(argv.json));
|
|
@@ -1363,7 +1841,12 @@ function buildCli(rawArgs) {
|
|
|
1363
1841
|
try {
|
|
1364
1842
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
1365
1843
|
const client = (0, api_client_1.createApiClient)();
|
|
1366
|
-
await copyVersionCommand(client, output, {
|
|
1844
|
+
await copyVersionCommand(client, output, {
|
|
1845
|
+
from: argv.from,
|
|
1846
|
+
to: argv.to,
|
|
1847
|
+
yes: true,
|
|
1848
|
+
dryRun: false,
|
|
1849
|
+
});
|
|
1367
1850
|
}
|
|
1368
1851
|
catch (err) {
|
|
1369
1852
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
@@ -1384,6 +1867,6 @@ function buildCli(rawArgs) {
|
|
|
1384
1867
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
1385
1868
|
}
|
|
1386
1869
|
})
|
|
1387
|
-
.demandCommand(1);
|
|
1870
|
+
.demandCommand(1));
|
|
1388
1871
|
}
|
|
1389
1872
|
//# sourceMappingURL=cli.js.map
|