@dcupl/cli 1.4.0-beta.2 → 1.4.0-beta.20
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 +30 -23
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +740 -205
- package/dist/cli.js.map +1 -1
- package/dist/functions/app/app-id.js +34 -2
- package/dist/functions/app/app-id.js.map +1 -1
- package/dist/functions/app/client/daemon-client.js.map +1 -1
- package/dist/functions/app/commands/cdn-host.d.ts +16 -0
- package/dist/functions/app/commands/cdn-host.js +47 -0
- package/dist/functions/app/commands/cdn-host.js.map +1 -0
- package/dist/functions/app/commands/create.js +50 -34
- package/dist/functions/app/commands/create.js.map +1 -1
- package/dist/functions/app/commands/data/render.d.ts +3 -1
- package/dist/functions/app/commands/data/render.js +9 -1
- package/dist/functions/app/commands/data/render.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/group-by.js +4 -2
- package/dist/functions/app/commands/fn/group-by.js.map +1 -1
- package/dist/functions/app/commands/fn/pivot.js.map +1 -1
- package/dist/functions/app/commands/list.js +6 -2
- package/dist/functions/app/commands/list.js.map +1 -1
- package/dist/functions/app/commands/loader-hash.js.map +1 -1
- package/dist/functions/app/commands/loaders/add.js +6 -0
- package/dist/functions/app/commands/loaders/add.js.map +1 -1
- package/dist/functions/app/commands/loaders/process-flags.js +4 -1
- package/dist/functions/app/commands/loaders/process-flags.js.map +1 -1
- package/dist/functions/app/commands/loaders/process.js +3 -1
- package/dist/functions/app/commands/loaders/process.js.map +1 -1
- package/dist/functions/app/commands/loaders/remove.js +2 -0
- package/dist/functions/app/commands/loaders/remove.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 +7 -15
- 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/query-input.d.ts +1 -0
- package/dist/functions/app/commands/query-input.js +15 -2
- package/dist/functions/app/commands/query-input.js.map +1 -1
- package/dist/functions/app/commands/render.js +10 -4
- package/dist/functions/app/commands/render.js.map +1 -1
- package/dist/functions/app/commands/resolve-app.js.map +1 -1
- package/dist/functions/app/commands/resolve-source.d.ts +1 -0
- package/dist/functions/app/commands/resolve-source.js +20 -5
- package/dist/functions/app/commands/resolve-source.js.map +1 -1
- package/dist/functions/app/commands/sort-input.d.ts +5 -0
- package/dist/functions/app/commands/sort-input.js +34 -0
- package/dist/functions/app/commands/sort-input.js.map +1 -0
- package/dist/functions/app/commands/validate-report.d.ts +31 -0
- package/dist/functions/app/commands/validate-report.js +20 -1
- package/dist/functions/app/commands/validate-report.js.map +1 -1
- package/dist/functions/app/commands/validate.d.ts +1 -0
- package/dist/functions/app/commands/validate.js +31 -10
- package/dist/functions/app/commands/validate.js.map +1 -1
- package/dist/functions/app/daemon/app-server.module.js +6 -1
- package/dist/functions/app/daemon/app-server.module.js.map +1 -1
- package/dist/functions/app/daemon/controllers/data.controller.d.ts +3 -4
- package/dist/functions/app/daemon/controllers/data.controller.js +18 -7
- 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/loaders.controller.js +1 -1
- package/dist/functions/app/daemon/controllers/loaders.controller.js.map +1 -1
- package/dist/functions/app/daemon/controllers/query.controller.js +4 -1
- package/dist/functions/app/daemon/controllers/query.controller.js.map +1 -1
- package/dist/functions/app/daemon/daemon-args.js +2 -2
- package/dist/functions/app/daemon/daemon-args.js.map +1 -1
- package/dist/functions/app/daemon/filters/envelope-exception.filter.js +6 -1
- package/dist/functions/app/daemon/filters/envelope-exception.filter.js.map +1 -1
- package/dist/functions/app/daemon/main.js +14 -7
- package/dist/functions/app/daemon/main.js.map +1 -1
- package/dist/functions/app/daemon/services/attribute-validation.js +6 -3
- package/dist/functions/app/daemon/services/attribute-validation.js.map +1 -1
- package/dist/functions/app/daemon/services/csv-delimiter.d.ts +15 -0
- package/dist/functions/app/daemon/services/csv-delimiter.js +99 -0
- package/dist/functions/app/daemon/services/csv-delimiter.js.map +1 -0
- package/dist/functions/app/daemon/services/dcupl-host.service.d.ts +15 -2
- package/dist/functions/app/daemon/services/dcupl-host.service.js +132 -24
- package/dist/functions/app/daemon/services/dcupl-host.service.js.map +1 -1
- package/dist/functions/app/daemon/services/group-sort.d.ts +25 -0
- package/dist/functions/app/daemon/services/group-sort.js +128 -0
- package/dist/functions/app/daemon/services/group-sort.js.map +1 -0
- package/dist/functions/app/daemon/services/idle-watchdog.service.js.map +1 -1
- package/dist/functions/app/daemon/services/ingest.service.d.ts +1 -0
- package/dist/functions/app/daemon/services/ingest.service.js +17 -11
- 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 +4 -2
- package/dist/functions/app/daemon/services/loaders.service.js +29 -7
- package/dist/functions/app/daemon/services/loaders.service.js.map +1 -1
- package/dist/functions/app/daemon/services/normalize-query.d.ts +1 -1
- package/dist/functions/app/daemon/services/normalize-query.js +44 -3
- package/dist/functions/app/daemon/services/normalize-query.js.map +1 -1
- package/dist/functions/app/daemon/services/staged-keys.d.ts +12 -0
- package/dist/functions/app/daemon/services/staged-keys.js +72 -0
- package/dist/functions/app/daemon/services/staged-keys.js.map +1 -0
- 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/app/types.d.ts +2 -0
- package/dist/functions/config/commands/set.js +4 -4
- 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.d.ts +2 -1
- package/dist/functions/config/prompts.js +1 -3
- package/dist/functions/config/prompts.js.map +1 -1
- package/dist/functions/files/commands/pull.d.ts +2 -0
- package/dist/functions/files/commands/pull.js +40 -16
- package/dist/functions/files/commands/pull.js.map +1 -1
- package/dist/functions/files/commands/push.d.ts +1 -0
- package/dist/functions/files/commands/push.js +20 -0
- package/dist/functions/files/commands/push.js.map +1 -1
- package/dist/functions/files/commands/read.js +2 -1
- package/dist/functions/files/commands/read.js.map +1 -1
- package/dist/functions/files/commands/write.js +12 -2
- package/dist/functions/files/commands/write.js.map +1 -1
- package/dist/functions/files/files-push.js +1 -1
- package/dist/functions/files/files-push.js.map +1 -1
- package/dist/functions/files/helper/confirm.js +2 -3
- package/dist/functions/files/helper/confirm.js.map +1 -1
- package/dist/functions/files/helper/text-policy.d.ts +5 -0
- package/dist/functions/files/helper/text-policy.js +31 -0
- package/dist/functions/files/helper/text-policy.js.map +1 -0
- package/dist/functions/files/sync/large-upload.d.ts +20 -0
- package/dist/functions/files/sync/large-upload.js +140 -0
- package/dist/functions/files/sync/large-upload.js.map +1 -0
- package/dist/functions/files/sync/manifest.js +2 -1
- package/dist/functions/files/sync/manifest.js.map +1 -1
- package/dist/functions/files/sync/transfer.d.ts +5 -0
- package/dist/functions/files/sync/transfer.js +47 -10
- package/dist/functions/files/sync/transfer.js.map +1 -1
- package/dist/functions/generate/files/generate-code.js +0 -1
- package/dist/functions/generate/files/generate-code.js.map +1 -1
- package/dist/functions/generate/files/generate-files.d.ts +10 -1
- package/dist/functions/generate/files/generate-files.js +154 -43
- package/dist/functions/generate/files/generate-files.js.map +1 -1
- package/dist/functions/generate/files/generate-schema.js +1 -1
- package/dist/functions/generate/files/generate-schema.js.map +1 -1
- package/dist/functions/generate/files/generate.helper.d.ts +9 -3
- package/dist/functions/generate/files/generate.helper.js +11 -8
- package/dist/functions/generate/files/generate.helper.js.map +1 -1
- package/dist/functions/generate/files/rest-api-template.d.ts +16 -0
- package/dist/functions/generate/files/rest-api-template.js +63 -0
- package/dist/functions/generate/files/rest-api-template.js.map +1 -0
- package/dist/functions/generate/files/script-starters.d.ts +7 -0
- package/dist/functions/generate/files/script-starters.js +75 -0
- package/dist/functions/generate/files/script-starters.js.map +1 -0
- package/dist/functions/generate/files/workflow-presets.js +2 -1
- package/dist/functions/generate/files/workflow-presets.js.map +1 -1
- package/dist/functions/generate/model-from-data/generate-model-from-data.d.ts +1 -0
- package/dist/functions/generate/model-from-data/generate-model-from-data.js +74 -6
- 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 +18 -13
- package/dist/functions/generate/projects/generate-project.js.map +1 -1
- package/dist/functions/helper/api-client.d.ts +4 -0
- package/dist/functions/helper/api-client.js +18 -5
- package/dist/functions/helper/api-client.js.map +1 -1
- package/dist/functions/helper/config.helper.d.ts +1 -0
- package/dist/functions/helper/config.helper.js +1 -1
- package/dist/functions/helper/config.helper.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/helper/prompt.d.ts +2 -0
- package/dist/functions/helper/prompt.js +8 -0
- package/dist/functions/helper/prompt.js.map +1 -0
- 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/ResponseScriptConfig.example.json +1 -1
- package/dist/functions/schemas/examples/RestApiTemplate.example.json +30 -0
- 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 +7 -5
- package/dist/functions/schemas/format.js.map +1 -1
- package/dist/functions/schemas/registry.d.ts +2 -1
- package/dist/functions/schemas/registry.js +95 -31
- package/dist/functions/schemas/registry.js.map +1 -1
- package/dist/functions/schemas/resolve.d.ts +1 -0
- package/dist/functions/schemas/resolve.js +31 -1
- 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 +146 -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 +18 -13
- package/dist/functions/workflow/commands/deploy.js.map +1 -1
- package/dist/functions/workflow/commands/get.js.map +1 -1
- package/dist/functions/workflow/commands/history.js.map +1 -1
- package/dist/functions/workflow/commands/run.d.ts +2 -8
- package/dist/functions/workflow/commands/run.js +29 -22
- 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.d.ts +1 -1
- package/dist/functions/workflow/commands/status.js +7 -1
- package/dist/functions/workflow/commands/status.js.map +1 -1
- package/dist/functions/workflow/commands/template.js.map +1 -1
- package/dist/functions/workflow/commands/test.d.ts +2 -8
- package/dist/functions/workflow/commands/test.js +19 -21
- 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/run-failure.js +1 -1
- package/dist/functions/workflow/run-failure.js.map +1 -1
- 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/types.d.ts +11 -2
- package/dist/functions/workflow/types.js +4 -0
- package/dist/functions/workflow/types.js.map +1 -1
- package/dist/functions/workflow/wait-for-swap.d.ts +24 -1
- package/dist/functions/workflow/wait-for-swap.js +58 -0
- package/dist/functions/workflow/wait-for-swap.js.map +1 -1
- package/dist/functions/workflow/workflow-api.d.ts +7 -7
- package/dist/functions/workflow/workflow-api.js +31 -16
- package/dist/functions/workflow/workflow-api.js.map +1 -1
- package/files/common/_gitignore +2 -1
- package/files/dev-server/index.html +2 -1
- package/package.json +24 -15
- 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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FILES_PUSH_NAME_UNSUPPORTED = exports.APP_SCRIPTS_TRUST_NOTE = void 0;
|
|
3
4
|
exports.buildCli = buildCli;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const yargs_1 = tslib_1.__importDefault(require("yargs"));
|
|
@@ -8,6 +9,7 @@ const output_1 = require("./functions/helper/output");
|
|
|
8
9
|
const parse_fail_1 = require("./functions/helper/parse-fail");
|
|
9
10
|
const command_js_1 = require("./functions/schemas/command.js");
|
|
10
11
|
const workflow_presets_js_1 = require("./functions/generate/files/workflow-presets.js");
|
|
12
|
+
const script_starters_js_1 = require("./functions/generate/files/script-starters.js");
|
|
11
13
|
const command_js_2 = require("./functions/version/command.js");
|
|
12
14
|
const init_options_js_1 = require("./functions/app/daemon/services/init-options.js");
|
|
13
15
|
function parseAutoServePort(raw) {
|
|
@@ -22,9 +24,22 @@ function parseAutoServePort(raw) {
|
|
|
22
24
|
}
|
|
23
25
|
return n;
|
|
24
26
|
}
|
|
27
|
+
exports.APP_SCRIPTS_TRUST_NOTE = 'Project scripts (custom operators, sort and endpoint scripts) run unsandboxed in this process ' +
|
|
28
|
+
'(the SDK compiles them with `new Function`), like an npm script: only load projects you trust. ' +
|
|
29
|
+
'The hosted dcupl runners sandbox the same scripts.';
|
|
30
|
+
exports.FILES_PUSH_NAME_UNSUPPORTED = 'Named versions are created in the console; `--name` is not supported by `files push`';
|
|
31
|
+
const FILES_DEFAULT_INCLUDE = ['**/*.json', '**/*.csv', '**/*.js'];
|
|
32
|
+
function warnNoFilesConfig(output) {
|
|
33
|
+
output.warn(`No dcupl.config.json in ${process.cwd()}; using the defaults (baseFolder "dcupl", include ${FILES_DEFAULT_INCLUDE.join(', ')}).`);
|
|
34
|
+
}
|
|
35
|
+
const CDN_BASE_URL_DESCRIBE = 'CDN base url for the remote source. Default: derived from consoleApiUrl in dcupl.config.json' +
|
|
36
|
+
' (api.dcupl.com → cdn.dcupl.com, api.dev.dcupl.com → cdn.dev.dcupl.com), else the prod CDN;' +
|
|
37
|
+
' also DCUPL_CDN_BASE_URL env or `cdnBaseUrl` in dcupl.config.json. Overrides the workspace consoleApiUrl' +
|
|
38
|
+
' even with an explicit --project-id. api-key + cache-busting only apply to dcupl CDN hosts (cdn*.dcupl.com, cdn.dev.dcupl.com);' +
|
|
39
|
+
' see docs/flows/workflow-app-remote.md';
|
|
25
40
|
function buildCli(rawArgs) {
|
|
26
41
|
const instance = (0, yargs_1.default)(rawArgs);
|
|
27
|
-
return instance
|
|
42
|
+
return (instance
|
|
28
43
|
.version(false)
|
|
29
44
|
.locale('en')
|
|
30
45
|
.strict()
|
|
@@ -87,13 +102,25 @@ function buildCli(rawArgs) {
|
|
|
87
102
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
88
103
|
await serveListCommand(output);
|
|
89
104
|
})
|
|
90
|
-
.command('stop', 'Stop a running serve by port', (a) => a
|
|
91
|
-
|
|
105
|
+
.command('stop', 'Stop a running serve by port', (a) => a.option('port', {
|
|
106
|
+
type: 'number',
|
|
107
|
+
demandOption: true,
|
|
108
|
+
default: undefined,
|
|
109
|
+
describe: 'Port of the serve to stop',
|
|
110
|
+
}), async (argv) => {
|
|
92
111
|
const { serveStopCommand } = await import('./functions/serve/commands/stop.js');
|
|
93
112
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
94
113
|
await serveStopCommand(output, { port: argv.port });
|
|
95
114
|
})
|
|
96
115
|
.option('port', { default: '8083' })
|
|
116
|
+
.option('host', {
|
|
117
|
+
type: 'string',
|
|
118
|
+
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.',
|
|
119
|
+
})
|
|
120
|
+
.option('allow-origin', {
|
|
121
|
+
type: 'string',
|
|
122
|
+
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.',
|
|
123
|
+
})
|
|
97
124
|
.option('open-browser', {
|
|
98
125
|
type: 'boolean',
|
|
99
126
|
describe: 'Open the welcome screen in a browser on start. Overrides openBrowser in dcupl.config.json.',
|
|
@@ -108,7 +135,7 @@ function buildCli(rawArgs) {
|
|
|
108
135
|
const { bootstrap } = await import('./functions/serve/main.js');
|
|
109
136
|
bootstrap(argv);
|
|
110
137
|
})
|
|
111
|
-
.command('generate [type]', 'Generate models, types, schemas and more from your data', (args) => {
|
|
138
|
+
.command('generate [type]', 'Generate models, scripts, REST API templates, types, schemas and more from your data', (args) => {
|
|
112
139
|
return args
|
|
113
140
|
.positional('type', {
|
|
114
141
|
describe: 'type of content to generate',
|
|
@@ -124,18 +151,56 @@ function buildCli(rawArgs) {
|
|
|
124
151
|
'test',
|
|
125
152
|
'test-config',
|
|
126
153
|
'workflow',
|
|
154
|
+
'api',
|
|
127
155
|
],
|
|
128
156
|
})
|
|
129
|
-
.option('name', {
|
|
157
|
+
.option('name', {
|
|
158
|
+
describe: 'Name for model generation, the workflow key for `generate workflow`, or the template key for `generate api`',
|
|
159
|
+
type: 'string',
|
|
160
|
+
})
|
|
130
161
|
.option('file-name', { describe: 'File name for generation', type: 'string' })
|
|
162
|
+
.option('mode', {
|
|
163
|
+
describe: `Script mode starter for \`generate script\` (default: ${script_starters_js_1.DEFAULT_SCRIPT_MODE}); the scriptKey is derived from --file-name`,
|
|
164
|
+
type: 'string',
|
|
165
|
+
choices: script_starters_js_1.SCRIPT_MODES,
|
|
166
|
+
})
|
|
167
|
+
.option('endpoint', {
|
|
168
|
+
describe: 'Scripted endpoint for `generate api` as "<GET|POST> <path>=<scriptKey>" (repeatable); unknown scripts are scaffolded in endpoint mode and registered',
|
|
169
|
+
type: 'string',
|
|
170
|
+
array: true,
|
|
171
|
+
})
|
|
172
|
+
.option('force', {
|
|
173
|
+
describe: 'Overwrite a file that already exists (`generate api`, `generate script`); without it the file is kept and reported as skipped',
|
|
174
|
+
type: 'boolean',
|
|
175
|
+
})
|
|
131
176
|
.option('operator', { describe: 'Operator name for operator generation', type: 'string' })
|
|
132
|
-
.option('template', {
|
|
177
|
+
.option('template', {
|
|
178
|
+
describe: `Workflow preset (used by \`generate workflow\`, default: ${workflow_presets_js_1.WORKFLOW_PRESETS[0]})`,
|
|
179
|
+
type: 'string',
|
|
180
|
+
choices: workflow_presets_js_1.WORKFLOW_PRESETS,
|
|
181
|
+
})
|
|
133
182
|
.option('title', { describe: 'Test title (used by `generate test`)', type: 'string' })
|
|
134
183
|
.option('from', { describe: 'Data file (CSV/JSON/NDJSON) to infer a model from', type: 'string' })
|
|
135
|
-
.option('
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
184
|
+
.option('delimiter', {
|
|
185
|
+
describe: "CSV column delimiter for --from: ',' ';' tab '|' (default: detected from the header and first rows)",
|
|
186
|
+
type: 'string',
|
|
187
|
+
})
|
|
188
|
+
.option('register', {
|
|
189
|
+
describe: 'Register the generated model + data resource in dcupl.lc.json',
|
|
190
|
+
type: 'boolean',
|
|
191
|
+
})
|
|
192
|
+
.option('sample-size', {
|
|
193
|
+
describe: 'Max rows to scan when inferring types from --from',
|
|
194
|
+
type: 'number',
|
|
195
|
+
})
|
|
196
|
+
.option('key-property', {
|
|
197
|
+
describe: 'Override inferred keyProperty for --from. Comma-separate for a composite key (a,b,c). Skips inference + prompts.',
|
|
198
|
+
type: 'string',
|
|
199
|
+
})
|
|
200
|
+
.option('dry-run', {
|
|
201
|
+
describe: 'Preview the proposed model + lc.json additions without writing.',
|
|
202
|
+
type: 'boolean',
|
|
203
|
+
});
|
|
139
204
|
}, async (argv) => {
|
|
140
205
|
const { generateFn } = await import('./functions/generate/files/generate-files.js');
|
|
141
206
|
generateFn(argv);
|
|
@@ -147,14 +212,26 @@ function buildCli(rawArgs) {
|
|
|
147
212
|
(0, command_js_1.schemasListCommand)(argv, output);
|
|
148
213
|
})
|
|
149
214
|
.command('get <name>', 'Print the source of a schema', (args) => args
|
|
150
|
-
.positional('name', {
|
|
215
|
+
.positional('name', {
|
|
216
|
+
type: 'string',
|
|
217
|
+
describe: 'Schema name (see `dcupl schemas list`)',
|
|
218
|
+
demandOption: true,
|
|
219
|
+
})
|
|
151
220
|
.option('example', { type: 'boolean', default: false, describe: 'Append a curated example payload' }), (argv) => {
|
|
152
221
|
const output = (0, output_1.createOutput)(argv.json);
|
|
153
222
|
(0, command_js_1.schemasGetCommand)({ name: argv.name, json: argv.json, example: argv.example }, output);
|
|
154
223
|
})
|
|
155
224
|
.command('validate <file>', 'Validate a JSON file against a registry schema (Zod-kind, e.g. TemplateV3)', (args) => args
|
|
156
|
-
.positional('file', {
|
|
157
|
-
|
|
225
|
+
.positional('file', {
|
|
226
|
+
type: 'string',
|
|
227
|
+
describe: 'Path to the JSON file to validate',
|
|
228
|
+
demandOption: true,
|
|
229
|
+
})
|
|
230
|
+
.option('against', {
|
|
231
|
+
type: 'string',
|
|
232
|
+
demandOption: true,
|
|
233
|
+
describe: 'Schema name to validate against (see `dcupl schemas list` — [Zod] entries only)',
|
|
234
|
+
}), async (argv) => {
|
|
158
235
|
const output = (0, output_1.createOutput)(argv.json);
|
|
159
236
|
try {
|
|
160
237
|
const { schemasValidateCommand } = await import('./functions/schemas/validate.js');
|
|
@@ -171,9 +248,20 @@ function buildCli(rawArgs) {
|
|
|
171
248
|
.command('workflow <subcommand>', 'Build, test, and deploy dcupl Workflow v3 templates. Auth: `dcupl config set` (projectId + apiKey).', (yy) => {
|
|
172
249
|
return yy
|
|
173
250
|
.command('validate', 'Validate a TemplateV3 file locally (and remotely if --runner is given).', (a) => a
|
|
174
|
-
.option('file', {
|
|
175
|
-
|
|
176
|
-
|
|
251
|
+
.option('file', {
|
|
252
|
+
type: 'string',
|
|
253
|
+
demandOption: true,
|
|
254
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
255
|
+
})
|
|
256
|
+
.option('runner', {
|
|
257
|
+
type: 'string',
|
|
258
|
+
describe: 'Runner uid or runnerKey for remote validation (feature limits, cycles, expressions)',
|
|
259
|
+
})
|
|
260
|
+
.option('local-only', {
|
|
261
|
+
type: 'boolean',
|
|
262
|
+
default: false,
|
|
263
|
+
describe: 'Skip remote validation even if --runner is set',
|
|
264
|
+
}), async (argv) => {
|
|
177
265
|
const { validateCommand } = await import('./functions/workflow/commands/validate.js');
|
|
178
266
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
179
267
|
try {
|
|
@@ -182,7 +270,11 @@ function buildCli(rawArgs) {
|
|
|
182
270
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
183
271
|
deps.client = mkClient();
|
|
184
272
|
}
|
|
185
|
-
await validateCommand(output, {
|
|
273
|
+
await validateCommand(output, {
|
|
274
|
+
file: argv.file,
|
|
275
|
+
runner: argv.runner,
|
|
276
|
+
localOnly: !!argv['local-only'],
|
|
277
|
+
}, deps);
|
|
186
278
|
}
|
|
187
279
|
catch (err) {
|
|
188
280
|
output.error(err.message, err.code || 'WORKFLOW_VALIDATE_FAILED');
|
|
@@ -246,19 +338,27 @@ function buildCli(rawArgs) {
|
|
|
246
338
|
.command('trace', 'Show the node-by-node execution state of a single run (debug a workflow run).', (a) => a
|
|
247
339
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
248
340
|
.option('run', { type: 'string', describe: 'Execution runId (from `workflow history`)' })
|
|
249
|
-
.option('last', {
|
|
341
|
+
.option('last', {
|
|
342
|
+
type: 'boolean',
|
|
343
|
+
default: false,
|
|
344
|
+
describe: 'Trace the most recent run instead of naming one with --run',
|
|
345
|
+
}), async (argv) => {
|
|
250
346
|
const { traceCommand } = await import('./functions/workflow/commands/trace.js');
|
|
251
347
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
252
348
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
253
349
|
try {
|
|
254
|
-
await traceCommand(output, mkClient(), {
|
|
350
|
+
await traceCommand(output, mkClient(), {
|
|
351
|
+
id: argv.id,
|
|
352
|
+
run: argv.run,
|
|
353
|
+
last: !!argv.last,
|
|
354
|
+
});
|
|
255
355
|
}
|
|
256
356
|
catch (err) {
|
|
257
357
|
output.error(err.message, err.code || 'WORKFLOW_TRACE_FAILED');
|
|
258
358
|
}
|
|
259
359
|
})
|
|
260
360
|
.command('runners [subcommand]', 'Inspect the runners available to this project.', (rr) => {
|
|
261
|
-
return rr
|
|
361
|
+
return (rr
|
|
262
362
|
.command(['list', '$0'], 'List the runners available to this project (uid / key / type / url / health).', () => { }, async (argv) => {
|
|
263
363
|
const { runnersCommand } = await import('./functions/workflow/commands/runners.js');
|
|
264
364
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
@@ -280,26 +380,48 @@ function buildCli(rawArgs) {
|
|
|
280
380
|
catch (err) {
|
|
281
381
|
output.error(err.message, err.code || 'WORKFLOW_RUNNERS_GET_FAILED');
|
|
282
382
|
}
|
|
283
|
-
});
|
|
383
|
+
}));
|
|
284
384
|
}, () => { })
|
|
285
385
|
.command('test', 'Deploy to a (dev) runner then exercise it: --node for one node, otherwise a full run.', (a) => a
|
|
286
|
-
.option('file', {
|
|
287
|
-
|
|
386
|
+
.option('file', {
|
|
387
|
+
type: 'string',
|
|
388
|
+
demandOption: true,
|
|
389
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
390
|
+
})
|
|
391
|
+
.option('runner', {
|
|
392
|
+
type: 'string',
|
|
393
|
+
demandOption: true,
|
|
394
|
+
describe: 'Runner uid or runnerKey to deploy+run against (use a dev/test runner)',
|
|
395
|
+
})
|
|
288
396
|
.option('node', { type: 'string', describe: 'Test a single node by id (uses test-node)' })
|
|
289
|
-
.option('input', {
|
|
397
|
+
.option('input', {
|
|
398
|
+
type: 'string',
|
|
399
|
+
describe: 'Path to a JSON file: test-node inputData, or full-run request body',
|
|
400
|
+
})
|
|
290
401
|
.option('state', { type: 'string', describe: 'Path to a JSON file: $state seed for test-node' })
|
|
291
|
-
.option('trigger-key', { type: 'string',
|
|
292
|
-
.option('wait', {
|
|
293
|
-
|
|
402
|
+
.option('trigger-key', { type: 'string', hidden: true })
|
|
403
|
+
.option('wait', {
|
|
404
|
+
type: 'boolean',
|
|
405
|
+
default: true,
|
|
406
|
+
describe: 'Wait for the runner to hot-swap before triggering (--no-wait to skip)',
|
|
407
|
+
})
|
|
408
|
+
.option('swap-timeout', {
|
|
409
|
+
type: 'number',
|
|
410
|
+
describe: 'Max ms to wait for swap confirmation (default 30000)',
|
|
411
|
+
}), async (argv) => {
|
|
294
412
|
const { testCommand } = await import('./functions/workflow/commands/test.js');
|
|
295
413
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
296
414
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
297
415
|
try {
|
|
298
416
|
await testCommand(output, mkClient(), {
|
|
299
|
-
file: argv.file,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
417
|
+
file: argv.file,
|
|
418
|
+
runner: argv.runner,
|
|
419
|
+
node: argv.node,
|
|
420
|
+
input: argv.input,
|
|
421
|
+
state: argv.state,
|
|
422
|
+
triggerKey: argv['trigger-key'],
|
|
423
|
+
wait: argv.wait,
|
|
424
|
+
swapTimeout: argv['swap-timeout'],
|
|
303
425
|
});
|
|
304
426
|
}
|
|
305
427
|
catch (err) {
|
|
@@ -307,20 +429,40 @@ function buildCli(rawArgs) {
|
|
|
307
429
|
}
|
|
308
430
|
})
|
|
309
431
|
.command('run <key>', 'Trigger an already-deployed workflow (no redeploy): --node for one node, otherwise a full run.', (a) => a
|
|
310
|
-
.positional('key', {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
.option('
|
|
432
|
+
.positional('key', {
|
|
433
|
+
type: 'string',
|
|
434
|
+
demandOption: true,
|
|
435
|
+
describe: 'Deployed workflow key (as shown by `workflow list`; the bare template key also works)',
|
|
436
|
+
})
|
|
437
|
+
.option('runner', {
|
|
438
|
+
type: 'string',
|
|
439
|
+
demandOption: true,
|
|
440
|
+
describe: 'Runner uid or runnerKey the workflow is deployed on',
|
|
441
|
+
})
|
|
442
|
+
.option('body', {
|
|
443
|
+
type: 'string',
|
|
444
|
+
describe: 'Inline JSON: test-node inputData, or full-run request body (mutually exclusive with --input)',
|
|
445
|
+
})
|
|
446
|
+
.option('input', {
|
|
447
|
+
type: 'string',
|
|
448
|
+
describe: 'Path to a JSON file: test-node inputData, or full-run request body',
|
|
449
|
+
})
|
|
450
|
+
.option('node', {
|
|
451
|
+
type: 'string',
|
|
452
|
+
describe: 'Run a single node of the deployed workflow by id (uses test-node)',
|
|
453
|
+
})
|
|
454
|
+
.option('trigger-key', { type: 'string', hidden: true }), async (argv) => {
|
|
316
455
|
const { runCommand } = await import('./functions/workflow/commands/run.js');
|
|
317
456
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
318
457
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
319
458
|
try {
|
|
320
459
|
await runCommand(output, mkClient(), {
|
|
321
|
-
key: argv.key,
|
|
322
|
-
|
|
323
|
-
|
|
460
|
+
key: argv.key,
|
|
461
|
+
runner: argv.runner,
|
|
462
|
+
body: argv.body,
|
|
463
|
+
input: argv.input,
|
|
464
|
+
node: argv.node,
|
|
465
|
+
triggerKey: argv['trigger-key'],
|
|
324
466
|
});
|
|
325
467
|
}
|
|
326
468
|
catch (err) {
|
|
@@ -328,16 +470,37 @@ function buildCli(rawArgs) {
|
|
|
328
470
|
}
|
|
329
471
|
})
|
|
330
472
|
.command('deploy', 'Validate (remote) then deploy a template to a runner. Confirms before going live.', (a) => a
|
|
331
|
-
.option('file', {
|
|
332
|
-
|
|
473
|
+
.option('file', {
|
|
474
|
+
type: 'string',
|
|
475
|
+
demandOption: true,
|
|
476
|
+
describe: 'Path to a local *.workflow-v3.json template',
|
|
477
|
+
})
|
|
478
|
+
.option('runner', {
|
|
479
|
+
type: 'string',
|
|
480
|
+
demandOption: true,
|
|
481
|
+
describe: 'Runner uid or runnerKey to deploy to',
|
|
482
|
+
})
|
|
333
483
|
.option('yes', { type: 'boolean', default: false, describe: 'Skip the confirmation prompt (for CI)' })
|
|
334
|
-
.option('wait', {
|
|
335
|
-
|
|
484
|
+
.option('wait', {
|
|
485
|
+
type: 'boolean',
|
|
486
|
+
default: true,
|
|
487
|
+
describe: 'Wait for the runner to hot-swap to this version before returning (--no-wait to skip)',
|
|
488
|
+
})
|
|
489
|
+
.option('swap-timeout', {
|
|
490
|
+
type: 'number',
|
|
491
|
+
describe: 'Max ms to wait for swap confirmation (default 30000)',
|
|
492
|
+
}), async (argv) => {
|
|
336
493
|
const { deployCommand } = await import('./functions/workflow/commands/deploy.js');
|
|
337
494
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
338
495
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
339
496
|
try {
|
|
340
|
-
await deployCommand(output, mkClient(), {
|
|
497
|
+
await deployCommand(output, mkClient(), {
|
|
498
|
+
file: argv.file,
|
|
499
|
+
runner: argv.runner,
|
|
500
|
+
yes: !!argv.yes,
|
|
501
|
+
wait: argv.wait,
|
|
502
|
+
swapTimeout: argv['swap-timeout'],
|
|
503
|
+
});
|
|
341
504
|
}
|
|
342
505
|
catch (err) {
|
|
343
506
|
output.error(err.message, err.code || 'WORKFLOW_DEPLOY_FAILED');
|
|
@@ -345,7 +508,11 @@ function buildCli(rawArgs) {
|
|
|
345
508
|
})
|
|
346
509
|
.command('undeploy', 'Undeploy (stop + remove) a deployed workflow by its uid.', (a) => a
|
|
347
510
|
.option('id', { type: 'string', demandOption: true, describe: 'Deployed workflow uid' })
|
|
348
|
-
.option('yes', {
|
|
511
|
+
.option('yes', {
|
|
512
|
+
type: 'boolean',
|
|
513
|
+
default: false,
|
|
514
|
+
describe: 'Skip the confirmation prompt (for CI)',
|
|
515
|
+
}), async (argv) => {
|
|
349
516
|
const { undeployCommand } = await import('./functions/workflow/commands/undeploy.js');
|
|
350
517
|
const { createApiClient: mkClient } = await import('./functions/helper/api-client.js');
|
|
351
518
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -378,11 +545,13 @@ function buildCli(rawArgs) {
|
|
|
378
545
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
379
546
|
try {
|
|
380
547
|
const client = createApiClient();
|
|
381
|
-
const cfg = getConfigFileValue(process.cwd());
|
|
548
|
+
const cfg = getConfigFileValue(process.cwd(), undefined, { quiet: true });
|
|
549
|
+
if (!cfg)
|
|
550
|
+
warnNoFilesConfig(output);
|
|
382
551
|
await statusCommand(client, output, {
|
|
383
552
|
workspaceRoot: process.cwd(),
|
|
384
553
|
baseFolder: cfg?.baseFolder || 'dcupl',
|
|
385
|
-
include: cfg?.filesUpload?.include ||
|
|
554
|
+
include: cfg?.filesUpload?.include || FILES_DEFAULT_INCLUDE,
|
|
386
555
|
exclude: cfg?.filesUpload?.exclude || [],
|
|
387
556
|
versionArg: (argv.version ?? argv.name),
|
|
388
557
|
paths: argv.path,
|
|
@@ -399,31 +568,56 @@ function buildCli(rawArgs) {
|
|
|
399
568
|
describe: 'Version id (defaults to HEAD, then "draft"). "production" is rejected.',
|
|
400
569
|
})
|
|
401
570
|
.option('name', { type: 'string', hidden: true })
|
|
402
|
-
.option('strict', {
|
|
403
|
-
|
|
404
|
-
|
|
571
|
+
.option('strict', {
|
|
572
|
+
type: 'boolean',
|
|
573
|
+
default: false,
|
|
574
|
+
describe: 'Delete server files no longer present locally. Default (additive) never deletes on the server.',
|
|
575
|
+
})
|
|
576
|
+
.option('yes', {
|
|
577
|
+
type: 'boolean',
|
|
578
|
+
default: false,
|
|
579
|
+
describe: 'Skip the deletion confirmation prompt (for CI).',
|
|
580
|
+
})
|
|
581
|
+
.option('force', {
|
|
582
|
+
type: 'boolean',
|
|
583
|
+
default: false,
|
|
584
|
+
describe: 'Resolve conflicts by uploading the local copy.',
|
|
585
|
+
})
|
|
405
586
|
.option('path', {
|
|
406
587
|
type: 'array',
|
|
407
588
|
string: true,
|
|
408
589
|
describe: 'Restrict the push to one or more files / folders / globs (relative to baseFolder). Repeatable. With --strict, deletion is also confined to the scope. Example: --path models/ --path data/products.csv',
|
|
590
|
+
})
|
|
591
|
+
.option('concurrency', {
|
|
592
|
+
type: 'number',
|
|
593
|
+
describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
|
|
409
594
|
}), async (argv) => {
|
|
595
|
+
const output = (0, output_1.createOutput)(!!argv.json);
|
|
596
|
+
if (argv.name !== undefined) {
|
|
597
|
+
output.error(exports.FILES_PUSH_NAME_UNSUPPORTED, 'PUSH_NAME_NOT_SUPPORTED');
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
410
600
|
const { pushCommand } = await import('./functions/files/commands/push.js');
|
|
411
601
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
412
602
|
const { getConfigFileValue } = await import('./functions/helper/config.helper.js');
|
|
413
|
-
const output = (0, output_1.createOutput)(!!argv.json);
|
|
414
603
|
try {
|
|
415
604
|
const client = createApiClient();
|
|
416
|
-
const cfg = getConfigFileValue(process.cwd());
|
|
605
|
+
const cfg = getConfigFileValue(process.cwd(), undefined, { quiet: true });
|
|
606
|
+
if (!cfg)
|
|
607
|
+
warnNoFilesConfig(output);
|
|
417
608
|
await pushCommand(client, output, {
|
|
418
609
|
workspaceRoot: process.cwd(),
|
|
419
610
|
baseFolder: cfg?.baseFolder || 'dcupl',
|
|
420
|
-
include: cfg?.filesUpload?.include ||
|
|
611
|
+
include: cfg?.filesUpload?.include || FILES_DEFAULT_INCLUDE,
|
|
421
612
|
exclude: cfg?.filesUpload?.exclude || [],
|
|
422
|
-
versionArg:
|
|
613
|
+
versionArg: argv.version,
|
|
423
614
|
mode: argv.strict ? 'strict' : 'additive',
|
|
424
615
|
yes: argv.yes,
|
|
425
616
|
force: argv.force,
|
|
426
617
|
paths: argv.path,
|
|
618
|
+
concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
|
|
619
|
+
? Math.floor(argv.concurrency)
|
|
620
|
+
: undefined,
|
|
427
621
|
});
|
|
428
622
|
}
|
|
429
623
|
catch (err) {
|
|
@@ -437,9 +631,21 @@ function buildCli(rawArgs) {
|
|
|
437
631
|
describe: 'Version id (defaults to HEAD, then "draft"). Switching versions requires a clean workspace or --force.',
|
|
438
632
|
})
|
|
439
633
|
.option('name', { type: 'string', hidden: true })
|
|
440
|
-
.option('strict', {
|
|
441
|
-
|
|
442
|
-
|
|
634
|
+
.option('strict', {
|
|
635
|
+
type: 'boolean',
|
|
636
|
+
default: false,
|
|
637
|
+
describe: 'Delete local files no longer present on the server. Default (additive) never deletes locally.',
|
|
638
|
+
})
|
|
639
|
+
.option('yes', {
|
|
640
|
+
type: 'boolean',
|
|
641
|
+
default: false,
|
|
642
|
+
describe: 'Skip the deletion confirmation prompt (for CI).',
|
|
643
|
+
})
|
|
644
|
+
.option('force', {
|
|
645
|
+
type: 'boolean',
|
|
646
|
+
default: false,
|
|
647
|
+
describe: 'Resolve conflicts by overwriting local with server. Also overrides the dirty-workspace switch refusal.',
|
|
648
|
+
})
|
|
443
649
|
.option('path', {
|
|
444
650
|
type: 'array',
|
|
445
651
|
string: true,
|
|
@@ -448,6 +654,10 @@ function buildCli(rawArgs) {
|
|
|
448
654
|
.option('dest', {
|
|
449
655
|
type: 'string',
|
|
450
656
|
describe: 'Sandbox fetch: write the pulled files to this path instead of the workspace — no baseline/HEAD update, no conflict checks. An existing directory, a path ending in "/", or any multi-file match mirrors remote paths beneath it; with exactly one matching file, a plain file path is written as-is. Example: --path customers.csv --dest pulled/',
|
|
657
|
+
})
|
|
658
|
+
.option('concurrency', {
|
|
659
|
+
type: 'number',
|
|
660
|
+
describe: 'Max parallel file transfers (default 4). Lower this for very large files or slow links.',
|
|
451
661
|
}), async (argv) => {
|
|
452
662
|
const { pullCommand } = await import('./functions/files/commands/pull.js');
|
|
453
663
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
@@ -455,11 +665,13 @@ function buildCli(rawArgs) {
|
|
|
455
665
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
456
666
|
try {
|
|
457
667
|
const client = createApiClient();
|
|
458
|
-
const cfg = getConfigFileValue(process.cwd());
|
|
668
|
+
const cfg = getConfigFileValue(process.cwd(), undefined, { quiet: true });
|
|
669
|
+
if (!cfg)
|
|
670
|
+
warnNoFilesConfig(output);
|
|
459
671
|
await pullCommand(client, output, {
|
|
460
672
|
workspaceRoot: process.cwd(),
|
|
461
673
|
baseFolder: cfg?.baseFolder || 'dcupl',
|
|
462
|
-
include: cfg?.filesUpload?.include ||
|
|
674
|
+
include: cfg?.filesUpload?.include || FILES_DEFAULT_INCLUDE,
|
|
463
675
|
exclude: cfg?.filesUpload?.exclude || [],
|
|
464
676
|
versionArg: (argv.version ?? argv.name),
|
|
465
677
|
mode: argv.strict ? 'strict' : 'additive',
|
|
@@ -467,6 +679,9 @@ function buildCli(rawArgs) {
|
|
|
467
679
|
force: argv.force,
|
|
468
680
|
paths: argv.path,
|
|
469
681
|
dest: argv.dest,
|
|
682
|
+
concurrency: Number.isFinite(argv.concurrency) && argv.concurrency >= 1
|
|
683
|
+
? Math.floor(argv.concurrency)
|
|
684
|
+
: undefined,
|
|
470
685
|
});
|
|
471
686
|
}
|
|
472
687
|
catch (err) {
|
|
@@ -474,9 +689,17 @@ function buildCli(rawArgs) {
|
|
|
474
689
|
}
|
|
475
690
|
})
|
|
476
691
|
.command('list', 'List files in a version', (a) => a
|
|
477
|
-
.option('version', {
|
|
692
|
+
.option('version', {
|
|
693
|
+
alias: 'v',
|
|
694
|
+
type: 'string',
|
|
695
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
696
|
+
})
|
|
478
697
|
.option('search', { type: 'string', describe: 'Filter files by search query' })
|
|
479
|
-
.option('tree', {
|
|
698
|
+
.option('tree', {
|
|
699
|
+
type: 'boolean',
|
|
700
|
+
default: false,
|
|
701
|
+
describe: 'Render a nested directory tree instead of a flat list. Ignored when --json is set.',
|
|
702
|
+
}), async (argv) => {
|
|
480
703
|
const { listFilesCommand } = await import('./functions/files/commands/list.js');
|
|
481
704
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
482
705
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -493,9 +716,11 @@ function buildCli(rawArgs) {
|
|
|
493
716
|
output.error(err.error || err.message, err.code || 'LIST_FAILED');
|
|
494
717
|
}
|
|
495
718
|
})
|
|
496
|
-
.command('read', 'Read a single file from a version', (a) => a
|
|
497
|
-
|
|
498
|
-
|
|
719
|
+
.command('read', 'Read a single file from a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'File path' }).option('version', {
|
|
720
|
+
alias: 'v',
|
|
721
|
+
type: 'string',
|
|
722
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
723
|
+
}), async (argv) => {
|
|
499
724
|
const { readFileCommand } = await import('./functions/files/commands/read.js');
|
|
500
725
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
501
726
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -515,7 +740,11 @@ function buildCli(rawArgs) {
|
|
|
515
740
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
516
741
|
.option('content', { type: 'string', describe: 'Inline content to write' })
|
|
517
742
|
.option('file', { type: 'string', describe: 'Path to local file to upload' })
|
|
518
|
-
.option('version', {
|
|
743
|
+
.option('version', {
|
|
744
|
+
alias: 'v',
|
|
745
|
+
type: 'string',
|
|
746
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
747
|
+
}), async (argv) => {
|
|
519
748
|
const { writeFileCommand } = await import('./functions/files/commands/write.js');
|
|
520
749
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
521
750
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -535,9 +764,21 @@ function buildCli(rawArgs) {
|
|
|
535
764
|
})
|
|
536
765
|
.command('delete', 'Delete a single file from a version', (a) => a
|
|
537
766
|
.option('path', { type: 'string', demandOption: true, describe: 'File path' })
|
|
538
|
-
.option('version', {
|
|
539
|
-
|
|
540
|
-
|
|
767
|
+
.option('version', {
|
|
768
|
+
alias: 'v',
|
|
769
|
+
type: 'string',
|
|
770
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
771
|
+
})
|
|
772
|
+
.option('yes', {
|
|
773
|
+
type: 'boolean',
|
|
774
|
+
default: false,
|
|
775
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
776
|
+
})
|
|
777
|
+
.option('dry-run', {
|
|
778
|
+
type: 'boolean',
|
|
779
|
+
default: false,
|
|
780
|
+
describe: 'Preview the delete without executing it.',
|
|
781
|
+
}), async (argv) => {
|
|
541
782
|
const { deleteFileCommand } = await import('./functions/files/commands/delete.js');
|
|
542
783
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
543
784
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -558,9 +799,21 @@ function buildCli(rawArgs) {
|
|
|
558
799
|
.command('move', 'Move/rename a file within a version (remote — does not touch local files).', (a) => a
|
|
559
800
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
560
801
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
561
|
-
.option('version', {
|
|
562
|
-
|
|
563
|
-
|
|
802
|
+
.option('version', {
|
|
803
|
+
alias: 'v',
|
|
804
|
+
type: 'string',
|
|
805
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
806
|
+
})
|
|
807
|
+
.option('yes', {
|
|
808
|
+
type: 'boolean',
|
|
809
|
+
default: false,
|
|
810
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
811
|
+
})
|
|
812
|
+
.option('dry-run', {
|
|
813
|
+
type: 'boolean',
|
|
814
|
+
default: false,
|
|
815
|
+
describe: 'Preview the move without executing it.',
|
|
816
|
+
}), async (argv) => {
|
|
564
817
|
const { moveFileCommand } = await import('./functions/files/commands/move.js');
|
|
565
818
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
566
819
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -582,7 +835,11 @@ function buildCli(rawArgs) {
|
|
|
582
835
|
.command('copy', 'Copy a single file within a version (remote — does not touch local files).', (a) => a
|
|
583
836
|
.option('from', { type: 'string', demandOption: true, describe: 'Source file path' })
|
|
584
837
|
.option('to', { type: 'string', demandOption: true, describe: 'Destination file path' })
|
|
585
|
-
.option('version', {
|
|
838
|
+
.option('version', {
|
|
839
|
+
alias: 'v',
|
|
840
|
+
type: 'string',
|
|
841
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
842
|
+
}), async (argv) => {
|
|
586
843
|
const { copyFileCommand } = await import('./functions/files/commands/copy.js');
|
|
587
844
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
588
845
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -599,9 +856,11 @@ function buildCli(rawArgs) {
|
|
|
599
856
|
output.error(err.error || err.message, err.code || 'COPY_FAILED');
|
|
600
857
|
}
|
|
601
858
|
})
|
|
602
|
-
.command('create-folder', 'Create a folder in a version', (a) => a
|
|
603
|
-
|
|
604
|
-
|
|
859
|
+
.command('create-folder', 'Create a folder in a version', (a) => a.option('path', { type: 'string', demandOption: true, describe: 'Folder path' }).option('version', {
|
|
860
|
+
alias: 'v',
|
|
861
|
+
type: 'string',
|
|
862
|
+
describe: 'Version id (defaults to HEAD, then "draft")',
|
|
863
|
+
}), async (argv) => {
|
|
605
864
|
const { createFolderCommand } = await import('./functions/files/commands/create-folder.js');
|
|
606
865
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
607
866
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -631,10 +890,26 @@ function buildCli(rawArgs) {
|
|
|
631
890
|
}
|
|
632
891
|
})
|
|
633
892
|
.command('copy', 'Snapshot all files from one version into another (creates the target, or replaces its contents if it already exists)', (a) => a
|
|
634
|
-
.option('from', {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
893
|
+
.option('from', {
|
|
894
|
+
type: 'string',
|
|
895
|
+
demandOption: true,
|
|
896
|
+
describe: 'Source version to copy files from',
|
|
897
|
+
})
|
|
898
|
+
.option('to', {
|
|
899
|
+
type: 'string',
|
|
900
|
+
demandOption: true,
|
|
901
|
+
describe: 'Target version id — created if new, otherwise its contents are replaced',
|
|
902
|
+
})
|
|
903
|
+
.option('yes', {
|
|
904
|
+
type: 'boolean',
|
|
905
|
+
default: false,
|
|
906
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
907
|
+
})
|
|
908
|
+
.option('dry-run', {
|
|
909
|
+
type: 'boolean',
|
|
910
|
+
default: false,
|
|
911
|
+
describe: 'Preview the copy without executing it.',
|
|
912
|
+
}), async (argv) => {
|
|
638
913
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
639
914
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
640
915
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -653,8 +928,16 @@ function buildCli(rawArgs) {
|
|
|
653
928
|
})
|
|
654
929
|
.command('delete <id>', 'Delete a version', (a) => a
|
|
655
930
|
.positional('id', { type: 'string', demandOption: true, describe: 'Version id to delete' })
|
|
656
|
-
.option('yes', {
|
|
657
|
-
|
|
931
|
+
.option('yes', {
|
|
932
|
+
type: 'boolean',
|
|
933
|
+
default: false,
|
|
934
|
+
describe: 'Skip the confirmation prompt (for CI).',
|
|
935
|
+
})
|
|
936
|
+
.option('dry-run', {
|
|
937
|
+
type: 'boolean',
|
|
938
|
+
default: false,
|
|
939
|
+
describe: 'Preview the delete without executing it.',
|
|
940
|
+
}), async (argv) => {
|
|
658
941
|
const { deleteVersionCommand } = await import('./functions/files/commands/versions/delete.js');
|
|
659
942
|
const { createApiClient } = await import('./functions/helper/api-client.js');
|
|
660
943
|
const output = (0, output_1.createOutput)(!!argv.json);
|
|
@@ -677,8 +960,15 @@ function buildCli(rawArgs) {
|
|
|
677
960
|
.command('set', 'Create or update dcupl.config.json + dcupl.secrets.json. Interactive by default; flags skip prompts.', (a) => a
|
|
678
961
|
.option('project-id', { type: 'string', describe: 'dcupl Console project id' })
|
|
679
962
|
.option('api-key', { type: 'string', describe: 'dcupl Console API key' })
|
|
680
|
-
.option('console-api-url', {
|
|
681
|
-
|
|
963
|
+
.option('console-api-url', {
|
|
964
|
+
type: 'string',
|
|
965
|
+
describe: 'Override console API URL (for self-hosted / internal dev; leave unset for default)',
|
|
966
|
+
})
|
|
967
|
+
.option('yes', {
|
|
968
|
+
type: 'boolean',
|
|
969
|
+
default: false,
|
|
970
|
+
describe: 'Non-interactive mode. Requires --project-id and --api-key (or existing values in the files).',
|
|
971
|
+
}), async (argv) => {
|
|
682
972
|
const { configSetCommand } = await import('./functions/config/commands/set.js');
|
|
683
973
|
try {
|
|
684
974
|
await configSetCommand({
|
|
@@ -692,8 +982,11 @@ function buildCli(rawArgs) {
|
|
|
692
982
|
(0, output_1.createOutput)(!!argv.json).error(err?.message || String(err), err?.code || 'CONFIG_SET_FAILED');
|
|
693
983
|
}
|
|
694
984
|
})
|
|
695
|
-
.command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a
|
|
696
|
-
|
|
985
|
+
.command('get', 'Print current projectId / apiKey / consoleApiUrl. apiKey redacted by default.', (a) => a.option('show-secrets', {
|
|
986
|
+
type: 'boolean',
|
|
987
|
+
default: false,
|
|
988
|
+
describe: 'Reveal apiKey instead of ***last4',
|
|
989
|
+
}), async (argv) => {
|
|
697
990
|
const { configGetCommand } = await import('./functions/config/commands/get.js');
|
|
698
991
|
try {
|
|
699
992
|
await configGetCommand({
|
|
@@ -708,19 +1001,45 @@ function buildCli(rawArgs) {
|
|
|
708
1001
|
.demandCommand(1);
|
|
709
1002
|
})
|
|
710
1003
|
.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
|
|
711
|
-
.option('source', {
|
|
1004
|
+
.option('source', {
|
|
1005
|
+
type: 'string',
|
|
1006
|
+
choices: ['local', 'remote'],
|
|
1007
|
+
describe: 'Project source (inferred when omitted)',
|
|
1008
|
+
})
|
|
712
1009
|
.option('lc-json', { type: 'string', describe: 'Loader config path (local source)' })
|
|
713
|
-
.option('auto-serve', {
|
|
1010
|
+
.option('auto-serve', {
|
|
1011
|
+
type: 'boolean',
|
|
1012
|
+
describe: 'Auto-spawn dcupl serve for local source (default: on; throwaway, auto-cleaned). Use --no-auto-serve to opt out.',
|
|
1013
|
+
})
|
|
714
1014
|
.option('project-id', { type: 'string', describe: 'Console project id (remote source)' })
|
|
715
1015
|
.option('api-key', { type: 'string', describe: 'Console API key (remote source)' })
|
|
716
1016
|
.option('version', { type: 'string', describe: 'Console version id (remote source, default: draft)' })
|
|
1017
|
+
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
717
1018
|
.option('app-key', { type: 'string', describe: 'Application key for the process step' })
|
|
718
|
-
.option('env', {
|
|
1019
|
+
.option('env', {
|
|
1020
|
+
type: 'array',
|
|
1021
|
+
string: true,
|
|
1022
|
+
describe: 'Environment keys for the process step (repeatable)',
|
|
1023
|
+
})
|
|
719
1024
|
.option('tag', { type: 'array', string: true, describe: 'Resource tags for the process step (repeatable)' })
|
|
720
|
-
.option('var', {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
1025
|
+
.option('var', {
|
|
1026
|
+
type: 'array',
|
|
1027
|
+
string: true,
|
|
1028
|
+
describe: 'Variables KEY=VALUE for the process step (repeatable)',
|
|
1029
|
+
})
|
|
1030
|
+
.option('limit', {
|
|
1031
|
+
type: 'number',
|
|
1032
|
+
default: 10,
|
|
1033
|
+
describe: 'Max error records in the report (top findings)',
|
|
1034
|
+
})
|
|
1035
|
+
.option('quality', {
|
|
1036
|
+
type: 'boolean',
|
|
1037
|
+
describe: 'Enable model & data quality checks incl. error tracking (default: true). Use --quality false for a structural-only load.',
|
|
1038
|
+
})
|
|
1039
|
+
.option('max-memory', {
|
|
1040
|
+
type: 'number',
|
|
1041
|
+
describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
|
|
1042
|
+
}), async (argv) => {
|
|
724
1043
|
const { validateCommand } = await import('./functions/app/commands/validate.js');
|
|
725
1044
|
const output = (0, output_1.createOutput)(argv.json);
|
|
726
1045
|
try {
|
|
@@ -731,6 +1050,7 @@ function buildCli(rawArgs) {
|
|
|
731
1050
|
projectId: argv['project-id'],
|
|
732
1051
|
apiKey: argv['api-key'],
|
|
733
1052
|
version: argv.version,
|
|
1053
|
+
cdnBaseUrl: argv['cdn-base-url'],
|
|
734
1054
|
appKey: argv['app-key'],
|
|
735
1055
|
env: argv.env,
|
|
736
1056
|
tag: argv.tag,
|
|
@@ -745,40 +1065,123 @@ function buildCli(rawArgs) {
|
|
|
745
1065
|
}
|
|
746
1066
|
})
|
|
747
1067
|
.command('app <subcommand>', 'Run local dcupl daemons to query and analyze tabular data', (yy) => {
|
|
748
|
-
return yy
|
|
1068
|
+
return (yy
|
|
749
1069
|
.command('create', 'Start a new daemon and register an app', (a) => a
|
|
750
1070
|
.option('app', { type: 'string', describe: 'App id (auto-generated if omitted)' })
|
|
751
1071
|
.option('idle-timeout', { type: 'number', default: 30, describe: 'Idle timeout in minutes' })
|
|
752
|
-
.option('auto-update', {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
1072
|
+
.option('auto-update', {
|
|
1073
|
+
type: 'boolean',
|
|
1074
|
+
default: false,
|
|
1075
|
+
describe: 'Auto-run update() after every mutation. Default (off): mutations stage changes, run `dcupl app build` to apply (mirrors the SDK).',
|
|
1076
|
+
})
|
|
1077
|
+
.option('auto-generate-properties', {
|
|
1078
|
+
type: 'boolean',
|
|
1079
|
+
default: false,
|
|
1080
|
+
describe: 'Infer model schema from the data on first ingest. Daemon-wide default; override per call on `app data <verb>`.',
|
|
1081
|
+
})
|
|
1082
|
+
.option('auto-generate-deep', {
|
|
1083
|
+
type: 'boolean',
|
|
1084
|
+
default: false,
|
|
1085
|
+
describe: 'When inferring model schema, walk every row and reconcile types (handles row-1 blanks). Implies --auto-generate-properties.',
|
|
1086
|
+
})
|
|
1087
|
+
.option('auto-generate-sample-size', {
|
|
1088
|
+
type: 'number',
|
|
1089
|
+
describe: 'When inferring model schema, sample at most N rows (implies deep). Useful for large CSVs where row 1 may not represent the schema.',
|
|
1090
|
+
})
|
|
1091
|
+
.option('quality', {
|
|
1092
|
+
type: 'boolean',
|
|
1093
|
+
describe: 'Enable model & data quality checks (default: true). Use `--quality false` to opt out.',
|
|
1094
|
+
})
|
|
757
1095
|
.option('cache', { type: 'boolean', describe: 'Enable internal API caching (default: true)' })
|
|
758
|
-
.option('clone', {
|
|
759
|
-
|
|
760
|
-
|
|
1096
|
+
.option('clone', {
|
|
1097
|
+
type: 'boolean',
|
|
1098
|
+
describe: 'Enable deep data clones to avoid mutation side-effects (default: false)',
|
|
1099
|
+
})
|
|
1100
|
+
.option('analytics', {
|
|
1101
|
+
type: 'boolean',
|
|
1102
|
+
describe: 'Enable analytics instrumentation (default: true)',
|
|
1103
|
+
})
|
|
1104
|
+
.option('reference-metadata', {
|
|
1105
|
+
type: 'boolean',
|
|
1106
|
+
describe: 'Enable reference metadata resolution (default: true)',
|
|
1107
|
+
})
|
|
761
1108
|
.option('logging-level', { type: 'string', choices: init_options_js_1.LOG_LEVELS, describe: 'Minimum SDK log level' })
|
|
762
|
-
.option('logging-format', {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
1109
|
+
.option('logging-format', {
|
|
1110
|
+
type: 'string',
|
|
1111
|
+
choices: [...init_options_js_1.LOG_FORMATS],
|
|
1112
|
+
describe: 'SDK log output format',
|
|
1113
|
+
})
|
|
1114
|
+
.option('max-memory', {
|
|
1115
|
+
type: 'number',
|
|
1116
|
+
describe: 'Daemon heap limit in MB (Node --max-old-space-size). Default: V8 default.',
|
|
1117
|
+
})
|
|
1118
|
+
.option('max-body', {
|
|
1119
|
+
type: 'string',
|
|
1120
|
+
default: '2gb',
|
|
1121
|
+
describe: 'Max request body size, e.g. 2gb, 500mb',
|
|
1122
|
+
})
|
|
1123
|
+
.option('load', {
|
|
1124
|
+
type: 'boolean',
|
|
1125
|
+
describe: 'After creating the daemon, register, process, and build a loader so the app is immediately queryable',
|
|
1126
|
+
})
|
|
766
1127
|
.option('key', { type: 'string', describe: 'Loader key for --load (auto-generated if omitted)' })
|
|
767
|
-
.option('source', {
|
|
768
|
-
|
|
769
|
-
|
|
1128
|
+
.option('source', {
|
|
1129
|
+
type: 'string',
|
|
1130
|
+
choices: ['local', 'remote', 'url'],
|
|
1131
|
+
describe: 'Loader source for --load (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
|
|
1132
|
+
})
|
|
1133
|
+
.option('workspace', {
|
|
1134
|
+
type: 'boolean',
|
|
1135
|
+
describe: 'Use local dcupl workspace as loader source (--load)',
|
|
1136
|
+
})
|
|
1137
|
+
.option('project-id', {
|
|
1138
|
+
type: 'string',
|
|
1139
|
+
describe: 'dcupl Console project id (cdn loader source, --load). CDN host: see --cdn-base-url',
|
|
1140
|
+
})
|
|
770
1141
|
.option('api-key', { type: 'string', describe: 'Console API key (--load)' })
|
|
771
|
-
.option('version', {
|
|
1142
|
+
.option('version', {
|
|
1143
|
+
type: 'string',
|
|
1144
|
+
describe: 'Console version id (cdn loader source, default: draft)',
|
|
1145
|
+
})
|
|
1146
|
+
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
772
1147
|
.option('base-url', { type: 'string', describe: 'Custom base URL loader source (--load)' })
|
|
773
|
-
.option('loader-file', {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
.option('
|
|
1148
|
+
.option('loader-file', {
|
|
1149
|
+
type: 'string',
|
|
1150
|
+
describe: 'Loader file name for base-url source (--load)',
|
|
1151
|
+
})
|
|
1152
|
+
.option('header', {
|
|
1153
|
+
type: 'array',
|
|
1154
|
+
string: true,
|
|
1155
|
+
describe: 'HTTP headers for base-url source KEY=VALUE (repeatable, --load)',
|
|
1156
|
+
})
|
|
1157
|
+
.option('lc-json', {
|
|
1158
|
+
type: 'string',
|
|
1159
|
+
describe: 'Path to loader config file (workspace source, --load)',
|
|
1160
|
+
})
|
|
1161
|
+
.option('auto-serve', {
|
|
1162
|
+
type: 'boolean',
|
|
1163
|
+
describe: 'Auto-spawn dcupl serve if not running (workspace source, --load)',
|
|
1164
|
+
})
|
|
1165
|
+
.option('auto-serve-port', {
|
|
1166
|
+
type: 'string',
|
|
1167
|
+
describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned (--load)',
|
|
1168
|
+
})
|
|
778
1169
|
.option('app-key', { type: 'string', describe: 'Application key for process step (--load)' })
|
|
779
|
-
.option('env', {
|
|
780
|
-
|
|
781
|
-
|
|
1170
|
+
.option('env', {
|
|
1171
|
+
type: 'array',
|
|
1172
|
+
string: true,
|
|
1173
|
+
describe: 'Environment keys for process step (repeatable, --load)',
|
|
1174
|
+
})
|
|
1175
|
+
.option('tag', {
|
|
1176
|
+
type: 'array',
|
|
1177
|
+
string: true,
|
|
1178
|
+
describe: 'Resource tags for process step (repeatable, comma-separate for AND, --load)',
|
|
1179
|
+
})
|
|
1180
|
+
.option('var', {
|
|
1181
|
+
type: 'array',
|
|
1182
|
+
string: true,
|
|
1183
|
+
describe: 'Variables KEY=VALUE for process step (repeatable, --load)',
|
|
1184
|
+
}), async (argv) => {
|
|
782
1185
|
const { createCommand } = await import('./functions/app/commands/create.js');
|
|
783
1186
|
const output = (0, output_1.createOutput)(argv.json);
|
|
784
1187
|
try {
|
|
@@ -806,6 +1209,7 @@ function buildCli(rawArgs) {
|
|
|
806
1209
|
projectId: argv['project-id'],
|
|
807
1210
|
apiKey: argv['api-key'],
|
|
808
1211
|
version: argv.version,
|
|
1212
|
+
cdnBaseUrl: argv['cdn-base-url'],
|
|
809
1213
|
baseUrl: argv['base-url'],
|
|
810
1214
|
loaderFile: argv['loader-file'],
|
|
811
1215
|
header: argv.header,
|
|
@@ -822,12 +1226,14 @@ function buildCli(rawArgs) {
|
|
|
822
1226
|
});
|
|
823
1227
|
}
|
|
824
1228
|
catch (err) {
|
|
825
|
-
output.error(err.message, err.code || 'CREATE_FAILED');
|
|
1229
|
+
output.error(err.message, err.code || 'CREATE_FAILED', err.details === undefined ? undefined : { details: err.details });
|
|
826
1230
|
}
|
|
827
1231
|
})
|
|
828
|
-
.command('destroy', 'Stop a daemon', (a) => a
|
|
829
|
-
|
|
830
|
-
|
|
1232
|
+
.command('destroy', 'Stop a daemon', (a) => a.option('app', { type: 'string' }).option('keep-logs', {
|
|
1233
|
+
type: 'boolean',
|
|
1234
|
+
default: false,
|
|
1235
|
+
describe: 'Keep the daemon log file after destroy',
|
|
1236
|
+
}), async (argv) => {
|
|
831
1237
|
const { destroyCommand } = await import('./functions/app/commands/destroy.js');
|
|
832
1238
|
const output = (0, output_1.createOutput)(argv.json);
|
|
833
1239
|
try {
|
|
@@ -903,12 +1309,17 @@ function buildCli(rawArgs) {
|
|
|
903
1309
|
.command('set', 'Set a model from a JSON file or inline content', (a) => a
|
|
904
1310
|
.option('app', { type: 'string' })
|
|
905
1311
|
.option('file', { type: 'string', describe: 'Path to model JSON file' })
|
|
906
|
-
.option('content', {
|
|
1312
|
+
.option('content', {
|
|
1313
|
+
type: 'string',
|
|
1314
|
+
describe: 'Inline JSON model definition (use "-" to read from stdin)',
|
|
1315
|
+
}), async (argv) => {
|
|
907
1316
|
const { setCommand } = await import('./functions/app/commands/models/set.js');
|
|
908
1317
|
const output = (0, output_1.createOutput)(argv.json);
|
|
909
1318
|
try {
|
|
910
1319
|
const content = argv.content !== undefined
|
|
911
|
-
?
|
|
1320
|
+
? argv.content === '' && argv._.includes('-')
|
|
1321
|
+
? '-'
|
|
1322
|
+
: argv.content
|
|
912
1323
|
: undefined;
|
|
913
1324
|
await setCommand(output, { appId: argv.app, file: argv.file, content });
|
|
914
1325
|
}
|
|
@@ -930,26 +1341,49 @@ function buildCli(rawArgs) {
|
|
|
930
1341
|
.command('data <verb>', 'Ingest data', (yyy) => {
|
|
931
1342
|
const dataOpts = (a) => a
|
|
932
1343
|
.option('app', { type: 'string' })
|
|
933
|
-
.option('file', {
|
|
1344
|
+
.option('file', {
|
|
1345
|
+
type: 'string',
|
|
1346
|
+
describe: 'Path to a local data file (CSV/JSON/NDJSON) to ingest',
|
|
1347
|
+
})
|
|
934
1348
|
.option('url', { type: 'string', describe: 'Remote URL to fetch the data payload from' })
|
|
935
1349
|
.option('content', { type: 'string', describe: 'Inline payload (use "-" to read from stdin)' })
|
|
936
1350
|
.option('format', { type: 'string', choices: ['csv', 'json', 'ndjson'] })
|
|
937
1351
|
.option('model', { type: 'string', demandOption: true })
|
|
938
|
-
.option('key-property', {
|
|
1352
|
+
.option('key-property', {
|
|
1353
|
+
type: 'string',
|
|
1354
|
+
describe: 'Property holding the record key. Comma-separate for a composite key (a,b → "a::b")',
|
|
1355
|
+
})
|
|
939
1356
|
.option('auto-generate-key', { type: 'boolean', default: false })
|
|
940
|
-
.option('auto-generate-properties', {
|
|
941
|
-
|
|
942
|
-
|
|
1357
|
+
.option('auto-generate-properties', {
|
|
1358
|
+
type: 'boolean',
|
|
1359
|
+
describe: 'Override daemon default for this call (use --no-auto-generate-properties to force off)',
|
|
1360
|
+
})
|
|
1361
|
+
.option('auto-generate-deep', {
|
|
1362
|
+
type: 'boolean',
|
|
1363
|
+
describe: 'Walk every row when inferring (implies --auto-generate-properties)',
|
|
1364
|
+
})
|
|
1365
|
+
.option('auto-generate-sample-size', {
|
|
1366
|
+
type: 'number',
|
|
1367
|
+
describe: 'Sample N rows when inferring (implies deep)',
|
|
1368
|
+
});
|
|
943
1369
|
const handler = (mod, exportName, code) => async (argv) => {
|
|
944
1370
|
const m = await import(`./functions/app/commands/data/${mod}.js`);
|
|
945
1371
|
const output = (0, output_1.createOutput)(argv.json);
|
|
946
1372
|
try {
|
|
947
1373
|
const content = argv.content !== undefined
|
|
948
|
-
?
|
|
1374
|
+
? argv.content === '' && argv._.includes('-')
|
|
1375
|
+
? '-'
|
|
1376
|
+
: argv.content
|
|
949
1377
|
: undefined;
|
|
950
1378
|
await m[exportName](output, {
|
|
951
|
-
appId: argv.app,
|
|
952
|
-
|
|
1379
|
+
appId: argv.app,
|
|
1380
|
+
file: argv.file,
|
|
1381
|
+
url: argv.url,
|
|
1382
|
+
content,
|
|
1383
|
+
format: argv.format,
|
|
1384
|
+
model: argv.model,
|
|
1385
|
+
keyProperty: argv.keyProperty,
|
|
1386
|
+
autoGenerateKey: argv.autoGenerateKey,
|
|
953
1387
|
autoGenerateProperties: argv.autoGenerateProperties,
|
|
954
1388
|
autoGenerateDeep: argv.autoGenerateDeep,
|
|
955
1389
|
autoGenerateSampleSize: argv.autoGenerateSampleSize,
|
|
@@ -960,8 +1394,8 @@ function buildCli(rawArgs) {
|
|
|
960
1394
|
}
|
|
961
1395
|
};
|
|
962
1396
|
return yyy
|
|
963
|
-
.command('update', '
|
|
964
|
-
.command('upsert', '
|
|
1397
|
+
.command('update', 'Update existing records by key; rows with unknown keys are skipped (use upsert to add them)', dataOpts, handler('update', 'updateCommand', 'DATA_UPDATE_FAILED'))
|
|
1398
|
+
.command('upsert', 'Add new records and update existing ones by key', dataOpts, handler('upsert', 'upsertCommand', 'DATA_UPSERT_FAILED'))
|
|
965
1399
|
.command('set', 'Replace all records for model', dataOpts, handler('set', 'setCommand', 'DATA_SET_FAILED'))
|
|
966
1400
|
.command('remove', 'Remove records by key', dataOpts, handler('remove', 'removeCommand', 'DATA_REMOVE_FAILED'))
|
|
967
1401
|
.command('reset', 'Drop all data for model', (a) => a.option('app', { type: 'string' }).option('model', { type: 'string', demandOption: true }), async (argv) => {
|
|
@@ -977,7 +1411,10 @@ function buildCli(rawArgs) {
|
|
|
977
1411
|
.demandCommand(1);
|
|
978
1412
|
})
|
|
979
1413
|
.command('query <verb>', 'Query records', (yyy) => yyy
|
|
980
|
-
.command('one', 'Fetch single record', (a) => a
|
|
1414
|
+
.command('one', 'Fetch single record', (a) => a
|
|
1415
|
+
.option('app', { type: 'string' })
|
|
1416
|
+
.option('model', { type: 'string', demandOption: true })
|
|
1417
|
+
.option('item-key', { type: 'string', demandOption: true }), async (argv) => {
|
|
981
1418
|
const { oneCommand } = await import('./functions/app/commands/query/one.js');
|
|
982
1419
|
const output = (0, output_1.createOutput)(argv.json);
|
|
983
1420
|
try {
|
|
@@ -1000,9 +1437,13 @@ function buildCli(rawArgs) {
|
|
|
1000
1437
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1001
1438
|
try {
|
|
1002
1439
|
await executeCommand(output, {
|
|
1003
|
-
appId: argv.app,
|
|
1004
|
-
|
|
1005
|
-
|
|
1440
|
+
appId: argv.app,
|
|
1441
|
+
model: argv.model,
|
|
1442
|
+
query: argv.query,
|
|
1443
|
+
queryFile: argv.queryFile,
|
|
1444
|
+
sort: argv.sort,
|
|
1445
|
+
limit: argv.limit,
|
|
1446
|
+
start: argv.start,
|
|
1006
1447
|
projection: argv.projection,
|
|
1007
1448
|
});
|
|
1008
1449
|
}
|
|
@@ -1027,15 +1468,32 @@ function buildCli(rawArgs) {
|
|
|
1027
1468
|
choices: ['size-desc', 'size-asc', 'value-asc', 'value-desc'],
|
|
1028
1469
|
describe: 'Deterministic ordering (opt-in; walks all keys). Use size-desc for top-N-by-count.',
|
|
1029
1470
|
})
|
|
1030
|
-
.option('full', {
|
|
1031
|
-
|
|
1471
|
+
.option('full', {
|
|
1472
|
+
type: 'boolean',
|
|
1473
|
+
default: false,
|
|
1474
|
+
describe: 'Return full SDK facet shape (resultKeys, entry, enabled, selected)',
|
|
1475
|
+
})
|
|
1476
|
+
.option('include-results', {
|
|
1477
|
+
type: 'boolean',
|
|
1478
|
+
default: false,
|
|
1479
|
+
describe: 'Keep resultKeys in compact output',
|
|
1480
|
+
}), async (argv) => {
|
|
1032
1481
|
const { facetsCommand } = await import('./functions/app/commands/fn/facets.js');
|
|
1033
1482
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1034
1483
|
try {
|
|
1035
1484
|
await facetsCommand(output, {
|
|
1036
|
-
appId: argv.app,
|
|
1037
|
-
|
|
1038
|
-
|
|
1485
|
+
appId: argv.app,
|
|
1486
|
+
model: argv.model,
|
|
1487
|
+
attribute: argv.attribute,
|
|
1488
|
+
excludeZeros: argv.excludeZeros,
|
|
1489
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1490
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1491
|
+
query: argv.query,
|
|
1492
|
+
queryFile: argv.queryFile,
|
|
1493
|
+
limit: argv.limit,
|
|
1494
|
+
sort: argv.sort,
|
|
1495
|
+
full: argv.full,
|
|
1496
|
+
includeResults: argv.includeResults,
|
|
1039
1497
|
});
|
|
1040
1498
|
}
|
|
1041
1499
|
catch (err) {
|
|
@@ -1046,11 +1504,21 @@ function buildCli(rawArgs) {
|
|
|
1046
1504
|
.option('app', { type: 'string' })
|
|
1047
1505
|
.option('model', { type: 'string', demandOption: true })
|
|
1048
1506
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1049
|
-
.option('types', {
|
|
1507
|
+
.option('types', {
|
|
1508
|
+
type: 'string',
|
|
1509
|
+
describe: 'Comma-separated: distinct,count,sum,avg,min,max,group. Optional when --bins/--group-options supply grouping.',
|
|
1510
|
+
})
|
|
1050
1511
|
.option('query', { type: 'string' })
|
|
1051
1512
|
.option('query-file', { type: 'string' })
|
|
1052
|
-
.option('include-keys', {
|
|
1053
|
-
|
|
1513
|
+
.option('include-keys', {
|
|
1514
|
+
type: 'boolean',
|
|
1515
|
+
default: false,
|
|
1516
|
+
describe: 'Include row keys in distinct results',
|
|
1517
|
+
})
|
|
1518
|
+
.option('bins', {
|
|
1519
|
+
type: 'string',
|
|
1520
|
+
describe: 'Numeric ranges for grouping, e.g. 0-100,100-200,200-',
|
|
1521
|
+
})
|
|
1054
1522
|
.option('group-options', { type: 'string', describe: 'Full groupOptions JSON' })
|
|
1055
1523
|
.option('group-options-file', { type: 'string', describe: 'Path to groupOptions JSON' })
|
|
1056
1524
|
.option('distinct-limit', { type: 'number', describe: 'Cap distinct values' })
|
|
@@ -1061,10 +1529,20 @@ function buildCli(rawArgs) {
|
|
|
1061
1529
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1062
1530
|
try {
|
|
1063
1531
|
await aggregateCommand(output, {
|
|
1064
|
-
appId: argv.app,
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1532
|
+
appId: argv.app,
|
|
1533
|
+
model: argv.model,
|
|
1534
|
+
attribute: argv.attribute,
|
|
1535
|
+
types: argv.types,
|
|
1536
|
+
query: argv.query,
|
|
1537
|
+
queryFile: argv.queryFile,
|
|
1538
|
+
includeKeys: argv.includeKeys,
|
|
1539
|
+
bins: argv.bins,
|
|
1540
|
+
groupOptions: argv.groupOptions,
|
|
1541
|
+
groupOptionsFile: argv.groupOptionsFile,
|
|
1542
|
+
distinctLimit: argv.distinctLimit,
|
|
1543
|
+
excludeZeros: argv.excludeZeros,
|
|
1544
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1545
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1068
1546
|
});
|
|
1069
1547
|
}
|
|
1070
1548
|
catch (err) {
|
|
@@ -1077,20 +1555,35 @@ function buildCli(rawArgs) {
|
|
|
1077
1555
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1078
1556
|
.option('query', { type: 'string' })
|
|
1079
1557
|
.option('query-file', { type: 'string' })
|
|
1080
|
-
.option('aggregate', {
|
|
1558
|
+
.option('aggregate', {
|
|
1559
|
+
type: 'array',
|
|
1560
|
+
describe: 'Per-group aggregates, format <attribute>:<type[,type...]>. Repeat to combine.',
|
|
1561
|
+
})
|
|
1081
1562
|
.option('exclude-zeros', { type: 'boolean' })
|
|
1082
1563
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1083
1564
|
.option('exclude-unresolved', { type: 'boolean' })
|
|
1084
|
-
.option('sort', {
|
|
1565
|
+
.option('sort', {
|
|
1566
|
+
type: 'string',
|
|
1567
|
+
describe: 'Group order <key>[:ASC|DESC][,...]: key, size or <attribute>_<type> of a --aggregate (e.g. inStock_sum:DESC); a model attribute orders the items inside each group',
|
|
1568
|
+
})
|
|
1085
1569
|
.option('limit', { type: 'number' })
|
|
1086
1570
|
.option('start', { type: 'number', describe: '0-based offset' }), async (argv) => {
|
|
1087
1571
|
const { groupByCommand } = await import('./functions/app/commands/fn/group-by.js');
|
|
1088
1572
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1089
1573
|
try {
|
|
1090
1574
|
await groupByCommand(output, {
|
|
1091
|
-
appId: argv.app,
|
|
1092
|
-
|
|
1093
|
-
|
|
1575
|
+
appId: argv.app,
|
|
1576
|
+
model: argv.model,
|
|
1577
|
+
attribute: argv.attribute,
|
|
1578
|
+
query: argv.query,
|
|
1579
|
+
queryFile: argv.queryFile,
|
|
1580
|
+
aggregate: argv.aggregate,
|
|
1581
|
+
excludeZeros: argv.excludeZeros,
|
|
1582
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1583
|
+
excludeUnresolved: argv.excludeUnresolved,
|
|
1584
|
+
sort: argv.sort,
|
|
1585
|
+
limit: argv.limit,
|
|
1586
|
+
start: argv.start,
|
|
1094
1587
|
});
|
|
1095
1588
|
}
|
|
1096
1589
|
catch (err) {
|
|
@@ -1105,7 +1598,12 @@ function buildCli(rawArgs) {
|
|
|
1105
1598
|
const { metadataCommand } = await import('./functions/app/commands/fn/metadata.js');
|
|
1106
1599
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1107
1600
|
try {
|
|
1108
|
-
await metadataCommand(output, {
|
|
1601
|
+
await metadataCommand(output, {
|
|
1602
|
+
appId: argv.app,
|
|
1603
|
+
model: argv.model,
|
|
1604
|
+
query: argv.query,
|
|
1605
|
+
queryFile: argv.queryFile,
|
|
1606
|
+
});
|
|
1109
1607
|
}
|
|
1110
1608
|
catch (err) {
|
|
1111
1609
|
output.error(err.message, err.code || 'FN_METADATA_FAILED');
|
|
@@ -1114,11 +1612,20 @@ function buildCli(rawArgs) {
|
|
|
1114
1612
|
.command('pivot', 'Multi-dimensional cross-tab (rows x columns x values)', (a) => a
|
|
1115
1613
|
.option('app', { type: 'string' })
|
|
1116
1614
|
.option('model', { type: 'string', demandOption: true })
|
|
1117
|
-
.option('rows', {
|
|
1118
|
-
|
|
1615
|
+
.option('rows', {
|
|
1616
|
+
type: 'array',
|
|
1617
|
+
describe: 'Row attribute(s); append :totals for row totals. Repeatable.',
|
|
1618
|
+
})
|
|
1619
|
+
.option('columns', {
|
|
1620
|
+
type: 'array',
|
|
1621
|
+
describe: 'Column attribute(s); append :totals. Repeatable.',
|
|
1622
|
+
})
|
|
1119
1623
|
.option('values', { type: 'array', describe: 'Aggregations <attr>:<type[,type]>. Repeatable.' })
|
|
1120
1624
|
.option('totals', { type: 'boolean', describe: 'Compute grand totals' })
|
|
1121
|
-
.option('spec', {
|
|
1625
|
+
.option('spec', {
|
|
1626
|
+
type: 'string',
|
|
1627
|
+
describe: 'Full PivotOptions JSON (mutually exclusive with shorthand flags)',
|
|
1628
|
+
})
|
|
1122
1629
|
.option('spec-file', { type: 'string', describe: 'Path to PivotOptions JSON' })
|
|
1123
1630
|
.option('query', { type: 'string' })
|
|
1124
1631
|
.option('query-file', { type: 'string' }), async (argv) => {
|
|
@@ -1126,10 +1633,16 @@ function buildCli(rawArgs) {
|
|
|
1126
1633
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1127
1634
|
try {
|
|
1128
1635
|
await pivotCommand(output, {
|
|
1129
|
-
appId: argv.app,
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1636
|
+
appId: argv.app,
|
|
1637
|
+
model: argv.model,
|
|
1638
|
+
rows: argv.rows,
|
|
1639
|
+
columns: argv.columns,
|
|
1640
|
+
values: argv.values,
|
|
1641
|
+
totals: argv.totals,
|
|
1642
|
+
spec: argv.spec,
|
|
1643
|
+
specFile: argv.specFile,
|
|
1644
|
+
query: argv.query,
|
|
1645
|
+
queryFile: argv.queryFile,
|
|
1133
1646
|
});
|
|
1134
1647
|
}
|
|
1135
1648
|
catch (err) {
|
|
@@ -1142,7 +1655,10 @@ function buildCli(rawArgs) {
|
|
|
1142
1655
|
.option('attribute', { type: 'string', demandOption: true })
|
|
1143
1656
|
.option('value', { type: 'string', demandOption: true })
|
|
1144
1657
|
.option('max', { type: 'number' })
|
|
1145
|
-
.option('relevant-data', {
|
|
1658
|
+
.option('relevant-data', {
|
|
1659
|
+
type: 'string',
|
|
1660
|
+
choices: ['filtered', 'all', 'excludeQuery'],
|
|
1661
|
+
})
|
|
1146
1662
|
.option('calculate-result-keys', { type: 'boolean' })
|
|
1147
1663
|
.option('exclude-undefineds', { type: 'boolean' })
|
|
1148
1664
|
.option('exclude-nulls', { type: 'boolean' })
|
|
@@ -1154,11 +1670,19 @@ function buildCli(rawArgs) {
|
|
|
1154
1670
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1155
1671
|
try {
|
|
1156
1672
|
await suggestCommand(output, {
|
|
1157
|
-
appId: argv.app,
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1673
|
+
appId: argv.app,
|
|
1674
|
+
model: argv.model,
|
|
1675
|
+
attribute: argv.attribute,
|
|
1676
|
+
value: argv.value,
|
|
1677
|
+
max: argv.max,
|
|
1678
|
+
relevantData: argv.relevantData,
|
|
1679
|
+
calculateResultKeys: argv.calculateResultKeys,
|
|
1680
|
+
excludeUndefineds: argv.excludeUndefineds,
|
|
1681
|
+
excludeNulls: argv.excludeNulls,
|
|
1682
|
+
excludeQuery: argv.excludeQuery,
|
|
1683
|
+
excludeQueryFile: argv.excludeQueryFile,
|
|
1684
|
+
query: argv.query,
|
|
1685
|
+
queryFile: argv.queryFile,
|
|
1162
1686
|
});
|
|
1163
1687
|
}
|
|
1164
1688
|
catch (err) {
|
|
@@ -1170,17 +1694,38 @@ function buildCli(rawArgs) {
|
|
|
1170
1694
|
.command('add', 'Register a loader source', (a) => a
|
|
1171
1695
|
.option('app', { type: 'string', describe: 'App id' })
|
|
1172
1696
|
.option('key', { type: 'string', describe: 'Loader key (auto-generated if omitted)' })
|
|
1173
|
-
.option('source', {
|
|
1697
|
+
.option('source', {
|
|
1698
|
+
type: 'string',
|
|
1699
|
+
choices: ['local', 'remote', 'url'],
|
|
1700
|
+
describe: 'Loader source (default: local in a workspace). Aliases: --workspace/--project-id/--base-url',
|
|
1701
|
+
})
|
|
1174
1702
|
.option('workspace', { type: 'boolean', describe: 'Use local dcupl workspace as source' })
|
|
1175
|
-
.option('project-id', {
|
|
1703
|
+
.option('project-id', {
|
|
1704
|
+
type: 'string',
|
|
1705
|
+
describe: 'dcupl Console project id (cdn source). CDN host: see --cdn-base-url',
|
|
1706
|
+
})
|
|
1176
1707
|
.option('api-key', { type: 'string', describe: 'Console API key' })
|
|
1177
|
-
.option('version', {
|
|
1708
|
+
.option('version', {
|
|
1709
|
+
type: 'string',
|
|
1710
|
+
describe: 'Console version id (cdn source, default: draft)',
|
|
1711
|
+
})
|
|
1712
|
+
.option('cdn-base-url', { type: 'string', describe: CDN_BASE_URL_DESCRIBE })
|
|
1178
1713
|
.option('base-url', { type: 'string', describe: 'Custom base URL source' })
|
|
1179
1714
|
.option('loader-file', { type: 'string', describe: 'Loader file name for base-url source' })
|
|
1180
|
-
.option('header', {
|
|
1715
|
+
.option('header', {
|
|
1716
|
+
type: 'array',
|
|
1717
|
+
string: true,
|
|
1718
|
+
describe: 'HTTP headers for base-url source (KEY=VALUE, repeatable)',
|
|
1719
|
+
})
|
|
1181
1720
|
.option('lc-json', { type: 'string', describe: 'Path to loader config (workspace source)' })
|
|
1182
|
-
.option('auto-serve', {
|
|
1183
|
-
|
|
1721
|
+
.option('auto-serve', {
|
|
1722
|
+
type: 'boolean',
|
|
1723
|
+
describe: 'Auto-spawn dcupl serve if not running (workspace source)',
|
|
1724
|
+
})
|
|
1725
|
+
.option('auto-serve-port', {
|
|
1726
|
+
type: 'string',
|
|
1727
|
+
describe: 'Override dcupl serve port for --auto-serve. Numeric port or "auto" for OS-assigned',
|
|
1728
|
+
}), async (argv) => {
|
|
1184
1729
|
const { addLoaderCommand } = await import('./functions/app/commands/loaders/add.js');
|
|
1185
1730
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1186
1731
|
try {
|
|
@@ -1193,6 +1738,7 @@ function buildCli(rawArgs) {
|
|
|
1193
1738
|
projectId: argv['project-id'],
|
|
1194
1739
|
apiKey: argv['api-key'],
|
|
1195
1740
|
version: argv.version,
|
|
1741
|
+
cdnBaseUrl: argv['cdn-base-url'],
|
|
1196
1742
|
baseUrl: argv['base-url'],
|
|
1197
1743
|
loaderFile: argv['loader-file'],
|
|
1198
1744
|
header: argv.header,
|
|
@@ -1203,7 +1749,7 @@ function buildCli(rawArgs) {
|
|
|
1203
1749
|
});
|
|
1204
1750
|
}
|
|
1205
1751
|
catch (err) {
|
|
1206
|
-
output.error(err.message, err.code || 'LOADERS_ADD_FAILED');
|
|
1752
|
+
output.error(err.message, err.code || 'LOADERS_ADD_FAILED', err.details === undefined ? undefined : { details: err.details });
|
|
1207
1753
|
}
|
|
1208
1754
|
})
|
|
1209
1755
|
.command('process', 'Process (re-load) a loader', (a) => a
|
|
@@ -1211,7 +1757,11 @@ function buildCli(rawArgs) {
|
|
|
1211
1757
|
.option('loader', { type: 'string', describe: 'Loader key (defaults to sole loader)' })
|
|
1212
1758
|
.option('app-key', { type: 'string', describe: 'Application key' })
|
|
1213
1759
|
.option('env', { type: 'array', string: true, describe: 'Environment keys (repeatable)' })
|
|
1214
|
-
.option('tag', {
|
|
1760
|
+
.option('tag', {
|
|
1761
|
+
type: 'array',
|
|
1762
|
+
string: true,
|
|
1763
|
+
describe: 'Resource tags (repeatable, comma-separate for AND)',
|
|
1764
|
+
})
|
|
1215
1765
|
.option('var', { type: 'array', string: true, describe: 'Variables KEY=VALUE (repeatable)' }), async (argv) => {
|
|
1216
1766
|
const { processLoaderCommand } = await import('./functions/app/commands/loaders/process.js');
|
|
1217
1767
|
const output = (0, output_1.createOutput)(argv.json);
|
|
@@ -1266,7 +1816,8 @@ function buildCli(rawArgs) {
|
|
|
1266
1816
|
}
|
|
1267
1817
|
})
|
|
1268
1818
|
.demandCommand(1))
|
|
1269
|
-
.demandCommand(1)
|
|
1819
|
+
.demandCommand(1)
|
|
1820
|
+
.epilogue(exports.APP_SCRIPTS_TRUST_NOTE));
|
|
1270
1821
|
}, () => { })
|
|
1271
1822
|
.command('version', 'Print the CLI version and the resolved @dcupl/* package versions', () => { }, (argv) => {
|
|
1272
1823
|
(0, command_js_2.versionCommand)((0, output_1.createOutput)(argv.json));
|
|
@@ -1274,26 +1825,6 @@ function buildCli(rawArgs) {
|
|
|
1274
1825
|
.command(['welcome', 'hey', 'rocks', '🚀'], 'You are awesome!', () => { }, async (_argv) => {
|
|
1275
1826
|
const { welcomeFn } = await import('./functions/welcome.js');
|
|
1276
1827
|
welcomeFn();
|
|
1277
|
-
})
|
|
1278
|
-
.command('test', '[experimental] Run generic tests', (args) => {
|
|
1279
|
-
return args
|
|
1280
|
-
.option('base-url', {
|
|
1281
|
-
describe: 'Base URL of the running dcupl instance to test against',
|
|
1282
|
-
default: 'http://localhost:8083',
|
|
1283
|
-
})
|
|
1284
|
-
.option('loader-file-name', {
|
|
1285
|
-
describe: 'Loader configuration file name (dcupl.lc.json)',
|
|
1286
|
-
default: 'dcupl.lc.json',
|
|
1287
|
-
})
|
|
1288
|
-
.option('application-key', {
|
|
1289
|
-
describe: 'The App key you want to test',
|
|
1290
|
-
default: 'default',
|
|
1291
|
-
})
|
|
1292
|
-
.option('environment-key', {
|
|
1293
|
-
describe: 'Environment key to run the tests in (empty for the default environment)',
|
|
1294
|
-
default: '',
|
|
1295
|
-
});
|
|
1296
|
-
}, (_argv) => {
|
|
1297
1828
|
})
|
|
1298
1829
|
.command('files:push', 'Upload files — deprecated, use `dcupl files push`', (args) => {
|
|
1299
1830
|
return args.option('name', {
|
|
@@ -1304,8 +1835,8 @@ function buildCli(rawArgs) {
|
|
|
1304
1835
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1305
1836
|
if (!output.isJson()) {
|
|
1306
1837
|
process.stderr.write(`⚠️ Deprecation: 'dcupl files:push' is deprecated and will be removed in a future release.\n` +
|
|
1307
|
-
` Use 'dcupl files push' (sync-aware
|
|
1308
|
-
`
|
|
1838
|
+
` Use 'dcupl files push' (sync-aware, changed-only; accepts .csv, .json, .txt, .md, .js).\n` +
|
|
1839
|
+
` This legacy zip upload keeps only .csv, .json and .js and silently drops everything else.\n`);
|
|
1309
1840
|
}
|
|
1310
1841
|
const { pushFiles } = await import('./functions/files/files-push.js');
|
|
1311
1842
|
pushFiles(argv, output);
|
|
@@ -1319,9 +1850,8 @@ function buildCli(rawArgs) {
|
|
|
1319
1850
|
const output = (0, output_1.createOutput)(argv.json);
|
|
1320
1851
|
if (!output.isJson()) {
|
|
1321
1852
|
process.stderr.write(`⚠️ Deprecation: 'dcupl files:pull' is deprecated and will be removed in a future release.\n` +
|
|
1322
|
-
` Use 'dcupl files pull' (sync-aware) instead.
|
|
1323
|
-
`
|
|
1324
|
-
` via 'files:push' should continue using 'files:pull' to stay in lockstep.\n`);
|
|
1853
|
+
` Use 'dcupl files pull' (sync-aware, changed-only) instead. The dcupl CDN stores text files\n` +
|
|
1854
|
+
` only, so there is nothing the new command cannot round-trip.\n`);
|
|
1325
1855
|
}
|
|
1326
1856
|
const { pullFiles } = await import('./functions/files/files-pull.js');
|
|
1327
1857
|
pullFiles(argv, output);
|
|
@@ -1339,7 +1869,12 @@ function buildCli(rawArgs) {
|
|
|
1339
1869
|
try {
|
|
1340
1870
|
const { copyVersionCommand } = await import('./functions/files/commands/versions/copy.js');
|
|
1341
1871
|
const client = (0, api_client_1.createApiClient)();
|
|
1342
|
-
await copyVersionCommand(client, output, {
|
|
1872
|
+
await copyVersionCommand(client, output, {
|
|
1873
|
+
from: argv.from,
|
|
1874
|
+
to: argv.to,
|
|
1875
|
+
yes: true,
|
|
1876
|
+
dryRun: false,
|
|
1877
|
+
});
|
|
1343
1878
|
}
|
|
1344
1879
|
catch (err) {
|
|
1345
1880
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
@@ -1360,6 +1895,6 @@ function buildCli(rawArgs) {
|
|
|
1360
1895
|
output.error(err.error || err.message, err.code || 'UNKNOWN');
|
|
1361
1896
|
}
|
|
1362
1897
|
})
|
|
1363
|
-
.demandCommand(1);
|
|
1898
|
+
.demandCommand(1));
|
|
1364
1899
|
}
|
|
1365
1900
|
//# sourceMappingURL=cli.js.map
|