@aifabrix/builder 2.45.5 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/rules/cli-layout.mdc +2 -0
- package/.cursor/rules/cli-product-neutral.mdc +43 -0
- package/.cursor/rules/project-rules.mdc +1 -0
- package/README.md +43 -17
- package/integration/hubspot-test/test-artifacts/wizard-hubspot-credential-real.yaml +1 -1
- package/integration/hubspot-test/test-artifacts/wizard-hubspot-env-vars.yaml +1 -1
- package/jest.config.default.js +2 -1
- package/jest.config.isolated.js +2 -1
- package/jest.global-live-fabrix-hooks.js +36 -0
- package/jest.isolated-projects.js +130 -0
- package/jest.projects.js +41 -136
- package/lib/api/api-response-errors.js +124 -0
- package/lib/api/governance-scenario-pack.api.js +159 -0
- package/lib/api/index.js +43 -3
- package/lib/api/lifecycle.api.js +77 -0
- package/lib/api/pipeline.api.js +3 -1
- package/lib/api/records-bulk.api.js +14 -1
- package/lib/api/validation-runner.js +3 -1
- package/lib/app/deploy-config.js +4 -1
- package/lib/app/down.js +20 -1
- package/lib/app/push.js +4 -5
- package/lib/app/register.js +7 -4
- package/lib/app/run-env-compose.js +84 -30
- package/lib/build/index.js +5 -0
- package/lib/certification/sync-system-certification.js +13 -6
- package/lib/cli/index.js +4 -0
- package/lib/cli/infra-guided-auth.js +109 -0
- package/lib/cli/infra-guided.js +84 -81
- package/lib/cli/setup-app.help.js +0 -31
- package/lib/cli/setup-app.js +28 -2
- package/lib/cli/setup-app.test-commands.js +5 -57
- package/lib/cli/setup-auth.js +25 -0
- package/lib/cli/setup-certification-commands.js +147 -0
- package/lib/cli/setup-certification.help.js +141 -0
- package/lib/cli/setup-environment.js +19 -2
- package/lib/cli/setup-external-system-help.js +62 -0
- package/lib/cli/setup-external-system.js +25 -3
- package/lib/cli/setup-infra.js +9 -1
- package/lib/cli/setup-platform.js +6 -1
- package/lib/cli/setup-secrets.js +33 -1
- package/lib/cli/setup-utility-help-after.js +22 -2
- package/lib/cli/setup-utility-repair.js +198 -0
- package/lib/cli/setup-utility-resolve.js +40 -4
- package/lib/cli/setup-utility-validate.js +197 -0
- package/lib/cli/setup-utility.js +4 -239
- package/lib/commands/auth-status-client-tokens.js +214 -0
- package/lib/commands/auth-status-dataplane-version.js +58 -20
- package/lib/commands/auth-status.js +41 -47
- package/lib/commands/datasource-test-trust-cli.js +27 -23
- package/lib/commands/datasource-unified-test-cli.js +6 -3
- package/lib/commands/datasource-unified-test-cli.options.js +5 -1
- package/lib/commands/datasource.js +7 -7
- package/lib/commands/dev-show-display.js +8 -1
- package/lib/commands/governance-cli-shared.js +94 -0
- package/lib/commands/governance-command-action.js +132 -0
- package/lib/commands/governance-download-external.js +34 -0
- package/lib/commands/governance-generate-external.js +71 -0
- package/lib/commands/governance-upload-external.js +36 -0
- package/lib/commands/governance-verify-external.js +64 -0
- package/lib/commands/governance.js +144 -0
- package/lib/commands/lifecycle-command-action.js +123 -0
- package/lib/commands/lifecycle-external.js +268 -0
- package/lib/commands/login.js +11 -2
- package/lib/commands/repair-auth-apply.js +127 -0
- package/lib/commands/repair-changed-files.js +41 -0
- package/lib/commands/repair-datasource-keys.js +4 -1
- package/lib/commands/repair-datasource-run.js +59 -0
- package/lib/commands/repair-datasource-test-payload.js +259 -0
- package/lib/commands/repair-datasource.js +1 -51
- package/lib/commands/repair-env-template.js +64 -13
- package/lib/commands/repair-external-run.js +216 -0
- package/lib/commands/repair-openapi-sync.js +23 -0
- package/lib/commands/repair-persist.js +4 -0
- package/lib/commands/repair-rbac.js +52 -1
- package/lib/commands/repair-steps.js +145 -0
- package/lib/commands/repair.js +29 -296
- package/lib/commands/secrets-get.js +184 -0
- package/lib/commands/secrets-remove-all.js +3 -1
- package/lib/commands/setup-image-refresh.js +146 -0
- package/lib/commands/setup-modes.js +158 -162
- package/lib/commands/setup-platform-auth.js +76 -0
- package/lib/commands/setup-prompts-admin.js +244 -0
- package/lib/commands/setup-prompts-platform-mode.js +67 -0
- package/lib/commands/setup-prompts-validators.js +36 -0
- package/lib/commands/setup-prompts.js +24 -76
- package/lib/commands/setup-run-context.js +45 -0
- package/lib/commands/setup-spinners.js +39 -0
- package/lib/commands/setup.js +27 -5
- package/lib/commands/teardown.js +39 -0
- package/lib/commands/test-e2e-external.js +24 -8
- package/lib/commands/test-governance-external.js +3 -24
- package/lib/commands/test-trust-external.js +20 -21
- package/lib/commands/up-common.js +25 -13
- package/lib/commands/up-dataplane.js +50 -13
- package/lib/commands/upload-publish-context.js +75 -0
- package/lib/commands/upload-sidecar-followups.js +89 -0
- package/lib/commands/upload.js +90 -108
- package/lib/commands/verify-governance-combined-external.js +61 -0
- package/lib/commands/verify-governance-command-action.js +64 -0
- package/lib/commands/verify-governance-db.js +102 -0
- package/lib/commands/verify-governance-external.js +77 -0
- package/lib/commands/verify-governance-result-builders.js +71 -0
- package/lib/commands/verify-operations-command-action.js +68 -0
- package/lib/commands/verify-operations-external.js +268 -0
- package/lib/commands/verify-operations-persist.js +75 -0
- package/lib/commands/verify-operations-step-plan.js +68 -0
- package/lib/commands/verify-operations-steps.js +111 -0
- package/lib/commands/verify-trust-command-action.js +70 -0
- package/lib/commands/verify-trust-external.js +67 -0
- package/lib/commands/wizard-config-normalizer.js +43 -23
- package/lib/commands/wizard-core.js +2 -0
- package/lib/core/admin-password-generator.js +38 -0
- package/lib/core/admin-secrets-bundle.js +111 -0
- package/lib/core/admin-secrets-env-overlay.js +62 -0
- package/lib/core/admin-secrets.js +32 -4
- package/lib/core/config-attach-extensions.js +3 -0
- package/lib/core/config-platform-controller.js +44 -0
- package/lib/core/config-setup-installation-profile.js +42 -0
- package/lib/core/config-setup-platform-mode.js +46 -0
- package/lib/core/config.js +46 -36
- package/lib/core/secrets-admin-env.js +6 -2
- package/lib/core/secrets-ensure.js +4 -0
- package/lib/core/secrets-env-content.js +54 -48
- package/lib/core/secrets-env-write.js +10 -1
- package/lib/core/secrets-infra-placeholder-sync.js +2 -0
- package/lib/core/setup-installation-profile.js +43 -0
- package/lib/core/setup-platform-mode.js +55 -0
- package/lib/datasource/agent-trust-debug-log.js +1 -1
- package/lib/datasource/agent-trust-run.js +5 -3
- package/lib/datasource/audit-evidence-extract-debug.js +30 -18
- package/lib/datasource/audit-evidence-extract.js +7 -4
- package/lib/datasource/audit-evidence-verify-matrix.js +54 -26
- package/lib/datasource/bulk-loader-run-batches.js +15 -3
- package/lib/datasource/datasource-load-export-context.js +3 -0
- package/lib/datasource/log-cleaner.js +2 -2
- package/lib/datasource/log-viewer.js +8 -8
- package/lib/datasource/test-e2e.js +4 -1
- package/lib/datasource/unified-validation-run-body.js +3 -1
- package/lib/datasource/unified-validation-run.js +5 -2
- package/lib/deployment/environment-poll-status.js +138 -0
- package/lib/deployment/environment.js +42 -34
- package/lib/external-system/download.js +21 -20
- package/lib/external-system/generator.js +5 -1
- package/lib/external-system/integration-auth-context.js +45 -0
- package/lib/external-system/test-auth.js +12 -5
- package/lib/external-system/test.js +6 -6
- package/lib/generator/external-controller-manifest.js +15 -0
- package/lib/governance/governance-cli-errors.js +96 -0
- package/lib/governance/governance-download-display.js +38 -0
- package/lib/governance/governance-run-display.js +215 -25
- package/lib/infrastructure/admin-secrets-apply.js +84 -0
- package/lib/infrastructure/admin-secrets-ensure.js +130 -0
- package/lib/infrastructure/admin-secrets-resolve.js +95 -0
- package/lib/infrastructure/admin-secrets-sync.js +91 -0
- package/lib/infrastructure/helpers.js +23 -129
- package/lib/infrastructure/index.js +5 -6
- package/lib/infrastructure/orphan-infra-docker-teardown.js +11 -5
- package/lib/lifecycle/certification-progress.js +231 -0
- package/lib/lifecycle/dataplane-ui-url.js +145 -0
- package/lib/lifecycle/exit-codes.js +24 -0
- package/lib/lifecycle/json-envelope.js +25 -0
- package/lib/lifecycle/lifecycle-governance-options.js +51 -0
- package/lib/lifecycle/logger-quiet.js +29 -0
- package/lib/lifecycle/open-api-published.js +59 -0
- package/lib/lifecycle/operations-readiness-metrics.js +101 -0
- package/lib/lifecycle/product-model.js +196 -0
- package/lib/lifecycle/report-display.js +471 -0
- package/lib/lifecycle/scenario-upload.js +191 -0
- package/lib/lifecycle/verify-step-progress.js +87 -0
- package/lib/parameters/infra-kv-discovery.js +27 -2
- package/lib/protection/auth-context.js +10 -4
- package/lib/schema/application-schema.json +1 -1
- package/lib/schema/datasource-test-run.schema.json +89 -6
- package/lib/schema/external-datasource.schema.json +2636 -2622
- package/lib/schema/external-system.schema.json +1089 -761
- package/lib/schema/infra.parameter.yaml +45 -0
- package/lib/schema/type/credential-field-registry.json +103 -97
- package/lib/utils/aifabrix-test-runtime-guard.js +125 -0
- package/lib/utils/api.js +55 -31
- package/lib/utils/app-relative-path-env.js +112 -0
- package/lib/utils/cli-secrets-error-format.js +83 -21
- package/lib/utils/cli-utils.js +16 -4
- package/lib/utils/compose-generate-docker-compose.js +4 -0
- package/lib/utils/compose-traefik-ingress-base.js +16 -1
- package/lib/utils/config-secrets-path.js +46 -0
- package/lib/utils/controller-url.js +88 -1
- package/lib/utils/credential-secrets-env.js +137 -9
- package/lib/utils/dataplane-resolver.js +129 -2
- package/lib/utils/declarative-url-ports.js +3 -3
- package/lib/utils/deployment-auth-mode.js +41 -0
- package/lib/utils/developer-volume-id.js +33 -0
- package/lib/utils/env-copy.js +14 -9
- package/lib/utils/env-kv-orphan-lines.js +43 -0
- package/lib/utils/error-formatters/network-errors.js +13 -4
- package/lib/utils/external-env-template.js +1 -0
- package/lib/utils/external-system-readiness-core.js +10 -0
- package/lib/utils/external-system-readiness-display.js +80 -23
- package/lib/utils/health-check.js +4 -1
- package/lib/utils/help-builder.js +11 -8
- package/lib/utils/keycloak-realm-ready.js +101 -0
- package/lib/utils/load-cip-capacity-display-config.js +61 -15
- package/lib/utils/manifest-source-emit.js +2 -0
- package/lib/utils/pipeline-upload-auth-retry.js +82 -0
- package/lib/utils/platform-controller-url.js +156 -0
- package/lib/utils/postgres-platform-bootstrap.js +199 -0
- package/lib/utils/postgres-wipe.js +9 -2
- package/lib/utils/resolve-env-mode.js +47 -0
- package/lib/utils/secrets-generator.js +31 -25
- package/lib/utils/secrets-missing-error.js +164 -0
- package/lib/utils/service-url-label.js +81 -0
- package/lib/utils/setup-quiet-output.js +25 -0
- package/lib/utils/template-helpers.js +15 -0
- package/lib/utils/token-manager-client-credentials.js +201 -0
- package/lib/utils/token-manager-messages.js +8 -0
- package/lib/utils/token-manager-refresh.js +12 -2
- package/lib/utils/token-manager.js +86 -105
- package/lib/utils/upload-pipeline-ui.js +12 -5
- package/lib/utils/upload-sync-options.js +42 -0
- package/lib/utils/url-declarative-public-base.js +21 -3
- package/lib/utils/url-declarative-vdir-inactive-env.js +14 -4
- package/lib/utils/validation-poll-ui.js +8 -0
- package/lib/utils/validation-run-stage.js +45 -0
- package/package.json +1 -1
- package/templates/applications/dataplane/application.yaml +2 -1
- package/templates/applications/dataplane/env.template +24 -1
- package/templates/applications/miso-controller/env.template +16 -0
- package/templates/external-system/README.md.hbs +74 -17
- package/templates/python/docker-compose.hbs +19 -18
- package/templates/typescript/docker-compose.hbs +18 -17
- package/lib/commands/test-governance-command-action.js +0 -55
- package/lib/commands/test-trust-command-action.js +0 -118
package/lib/cli/setup-app.js
CHANGED
|
@@ -31,8 +31,34 @@ Prefer aifabrix wizard [systemKey] for guided external setup.
|
|
|
31
31
|
|
|
32
32
|
const DEPLOY_HELP_AFTER = `
|
|
33
33
|
Examples:
|
|
34
|
-
|
|
35
|
-
$ aifabrix deploy
|
|
34
|
+
# Local — builder app (builder/<appKey>/)
|
|
35
|
+
$ aifabrix deploy myapp
|
|
36
|
+
$ aifabrix deploy myapp --local
|
|
37
|
+
|
|
38
|
+
# Local — external system (integration/<systemKey>/); manifest regenerated on deploy
|
|
39
|
+
$ aifabrix deploy hubspot-demo
|
|
40
|
+
$ aifabrix deploy hubspot-demo --local
|
|
41
|
+
$ aifabrix deploy hubspot-demo --probe
|
|
42
|
+
|
|
43
|
+
# CI/CD — builder app (GitHub Actions / Azure DevOps; pipeline client credentials in secrets)
|
|
44
|
+
$ aifabrix validate myapp
|
|
45
|
+
$ aifabrix build myapp
|
|
46
|
+
$ aifabrix push myapp --registry $ACR_REGISTRY --tag $IMAGE_TAG
|
|
47
|
+
$ aifabrix deploy myapp \\
|
|
48
|
+
--client-id "$DEV_MISO_CLIENTID" \\
|
|
49
|
+
--client-secret "$DEV_MISO_CLIENTSECRET" \\
|
|
50
|
+
--no-poll
|
|
51
|
+
|
|
52
|
+
# CI/CD — external integration (after upload/tests; promote to controller)
|
|
53
|
+
$ aifabrix validate hubspot-demo
|
|
54
|
+
$ aifabrix upload hubspot-demo --probe
|
|
55
|
+
$ aifabrix deploy hubspot-demo --probe --no-poll
|
|
56
|
+
|
|
57
|
+
Notes:
|
|
58
|
+
- Login or set MISO_CONTROLLER_URL + environment (aifabrix login / aifabrix auth).
|
|
59
|
+
- CI: register once (aifabrix app register <appKey>), store DEV_MISO_CLIENTID and DEV_MISO_CLIENTSECRET in pipeline secrets.
|
|
60
|
+
- upload = dataplane publish for dev iteration; deploy = controller validate + deploy (Azure or local Docker).
|
|
61
|
+
- --repository-url overrides repo URL for pipeline validate (default: application.yaml repository.repositoryUrl).
|
|
36
62
|
`;
|
|
37
63
|
|
|
38
64
|
const PUSH_HELP_AFTER = `
|
|
@@ -10,9 +10,7 @@ const { handleCommandError } = require('../utils/cli-utils');
|
|
|
10
10
|
const { cliOptsSkipCertSync } = require('../certification/cli-cert-sync-skip');
|
|
11
11
|
const {
|
|
12
12
|
TEST_HELP_AFTER,
|
|
13
|
-
TEST_E2E_HELP_AFTER
|
|
14
|
-
TEST_TRUST_HELP_AFTER,
|
|
15
|
-
TEST_GOVERNANCE_HELP_AFTER
|
|
13
|
+
TEST_E2E_HELP_AFTER
|
|
16
14
|
} = require('./setup-app.help');
|
|
17
15
|
|
|
18
16
|
function setupTestCommand(program) {
|
|
@@ -177,6 +175,10 @@ function setupTestE2eCommand(program) {
|
|
|
177
175
|
'--no-sync',
|
|
178
176
|
'Skip publishing local integration files; E2E uses the system config already on the dataplane (external integration only)'
|
|
179
177
|
)
|
|
178
|
+
.option(
|
|
179
|
+
'--force',
|
|
180
|
+
'With default sync, pass force to upload (bypass active-datasource schema replacement guards; same as aifabrix upload --force)'
|
|
181
|
+
)
|
|
180
182
|
.option('--warnings-as-errors', 'Treat aggregate warn as failure (exit 1)')
|
|
181
183
|
.option('--require-cert', 'Require certification passed on every datasource (exit 2 if not)')
|
|
182
184
|
.option(
|
|
@@ -222,64 +224,10 @@ function setupLintCommand(program) {
|
|
|
222
224
|
});
|
|
223
225
|
}
|
|
224
226
|
|
|
225
|
-
function collectScenarioId(value, previous) {
|
|
226
|
-
return previous.concat([value]);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function setupTestGovernanceCommand(program) {
|
|
230
|
-
const { testGovernanceCommandHandler } = require('../commands/test-governance-command-action');
|
|
231
|
-
program
|
|
232
|
-
.command('test-governance <appKey|systemKey>')
|
|
233
|
-
.description(
|
|
234
|
-
'Governance scenario acceptance: ABAC visibility via governed search (key sets only)'
|
|
235
|
-
)
|
|
236
|
-
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
237
|
-
.option('--pack <path>', 'Scenario pack YAML (default: scenarios/default.yaml or <systemKey>-v1.yaml)')
|
|
238
|
-
.option('-a, --app <path>', 'Integration folder override')
|
|
239
|
-
.option(
|
|
240
|
-
'--scenario <id>',
|
|
241
|
-
'Run subset of scenario ids (repeatable)',
|
|
242
|
-
collectScenarioId,
|
|
243
|
-
[]
|
|
244
|
-
)
|
|
245
|
-
.option('--no-sync', 'Skip publishing local integration files before run')
|
|
246
|
-
.option('-v, --verbose', 'Per-scenario verdict lines with subject and counts')
|
|
247
|
-
.option('--json', 'Machine-readable redacted result (same allowlist as API)')
|
|
248
|
-
.addHelpText('after', TEST_GOVERNANCE_HELP_AFTER)
|
|
249
|
-
.action((appName, options, cmd) => testGovernanceCommandHandler(appName, options, cmd));
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
function setupTestTrustCommand(program) {
|
|
253
|
-
const { testTrustCommandHandler } = require('../commands/test-trust-command-action');
|
|
254
|
-
program
|
|
255
|
-
.command('test-trust <appKey|systemKey>')
|
|
256
|
-
.description(
|
|
257
|
-
'Semantic agent metadata validation for external system (all datasources via dataplane 404.5)'
|
|
258
|
-
)
|
|
259
|
-
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
260
|
-
.option('-v, --verbose', 'Show findings and observed business model')
|
|
261
|
-
.option('-d, --debug', 'Write debug log under integration/<systemKey>/logs/')
|
|
262
|
-
.option('--no-sync', 'Skip publishing local integration files before validate')
|
|
263
|
-
.option('--revalidate', 'Force new validation for each datasource')
|
|
264
|
-
.option(
|
|
265
|
-
'--timeout <ms>',
|
|
266
|
-
'HTTP timeout for validate/latest requests (ms)',
|
|
267
|
-
'120000'
|
|
268
|
-
)
|
|
269
|
-
.option('--strict', 'Exit 1 unless every datasource is trusted')
|
|
270
|
-
.option('--warnings-as-errors', 'Exit 1 when any datasource is usableWithWarnings')
|
|
271
|
-
.option('--json', 'Print JSON array of trust runs')
|
|
272
|
-
.option('--summary', 'One line per datasource')
|
|
273
|
-
.addHelpText('after', TEST_TRUST_HELP_AFTER)
|
|
274
|
-
.action((appName, options, cmd) => testTrustCommandHandler(appName, options, cmd));
|
|
275
|
-
}
|
|
276
|
-
|
|
277
227
|
function setupInstallTestE2eLintCommands(program) {
|
|
278
228
|
setupInstallCommand(program);
|
|
279
229
|
setupTestCommand(program);
|
|
280
230
|
setupTestE2eCommand(program);
|
|
281
|
-
setupTestGovernanceCommand(program);
|
|
282
|
-
setupTestTrustCommand(program);
|
|
283
231
|
setupLintCommand(program);
|
|
284
232
|
}
|
|
285
233
|
|
package/lib/cli/setup-auth.js
CHANGED
|
@@ -31,11 +31,31 @@ Aliases:
|
|
|
31
31
|
Subcommand: auth status [--validate] for CI/scripts (exit codes 0/1/3).
|
|
32
32
|
`;
|
|
33
33
|
|
|
34
|
+
const LOGOUT_HELP_AFTER = `
|
|
35
|
+
Examples:
|
|
36
|
+
$ aifabrix logout
|
|
37
|
+
$ aifabrix logout -c http://localhost:3600
|
|
38
|
+
$ aifabrix logout -e dev
|
|
39
|
+
$ aifabrix logout -e dev -a hubspot-e2e
|
|
40
|
+
|
|
41
|
+
Notes:
|
|
42
|
+
- With no flags: clears all device tokens and all client tokens in config.yaml.
|
|
43
|
+
- Device tokens are keyed by controller URL (-c).
|
|
44
|
+
- Client tokens are per environment and app (-e and optional -a).
|
|
45
|
+
- Run aifabrix auth status to list stored app tokens and copy-paste logout commands.
|
|
46
|
+
`;
|
|
47
|
+
|
|
34
48
|
const AUTH_STATUS_HELP_AFTER = `
|
|
35
49
|
Examples:
|
|
36
50
|
$ aifabrix auth status
|
|
37
51
|
$ aifabrix auth status --validate
|
|
38
52
|
|
|
53
|
+
Client token refresh:
|
|
54
|
+
- Expired application tokens are refreshed automatically when client id/secret
|
|
55
|
+
exist in ~/.aifabrix/secrets.local.yaml (pattern <app>-client-idKeyVault) or env
|
|
56
|
+
(MISO_CLIENTID / MISO_CLIENTSECRET).
|
|
57
|
+
- Lists each stored app token with aifabrix logout -e <env> -a <app> to clear it.
|
|
58
|
+
|
|
39
59
|
Exit codes (--validate only):
|
|
40
60
|
0 Authenticated and Builder CLI meets dataplane minimum (or no minimum configured)
|
|
41
61
|
1 Not authenticated — run aifabrix login
|
|
@@ -152,6 +172,10 @@ function setupLoginCommand(program) {
|
|
|
152
172
|
.option('-e, --environment <env>', 'Environment key (updates root-level environment in config.yaml, e.g., miso, dev, tst, pro)')
|
|
153
173
|
.option('--online', 'Request online-only token (excludes offline_access scope, device flow only)')
|
|
154
174
|
.option('--scope <scopes>', 'Custom OAuth2 scope string (device flow only, default: "openid profile email offline_access")')
|
|
175
|
+
.option(
|
|
176
|
+
'--skip-version-cache',
|
|
177
|
+
'Skip post-login dataplane version cache refresh (faster exit when controller/dataplane URLs are slow)'
|
|
178
|
+
)
|
|
155
179
|
.action(async(options) => {
|
|
156
180
|
try {
|
|
157
181
|
await handleLogin(options);
|
|
@@ -168,6 +192,7 @@ function setupLogoutCommand(program) {
|
|
|
168
192
|
.option('-c, --controller <url>', 'Clear device tokens for specific controller')
|
|
169
193
|
.option('-e, --environment <env>', 'Clear client tokens for specific environment')
|
|
170
194
|
.option('-a, --app <app>', 'Clear client tokens for specific app (requires --environment)')
|
|
195
|
+
.addHelpText('after', LOGOUT_HELP_AFTER)
|
|
171
196
|
.action(async(options) => {
|
|
172
197
|
try {
|
|
173
198
|
await handleLogout(options);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Enterprise AI Certification CLI commands (plan 150.0).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
VERIFY_OPERATIONS_HELP_AFTER,
|
|
9
|
+
VERIFY_TRUST_HELP_AFTER,
|
|
10
|
+
VERIFY_GOVERNANCE_HELP_AFTER,
|
|
11
|
+
LIFECYCLE_HELP_AFTER
|
|
12
|
+
} = require('./setup-certification.help');
|
|
13
|
+
const { collectString } = require('../commands/governance');
|
|
14
|
+
|
|
15
|
+
function setupVerifyOperationsCommand(program) {
|
|
16
|
+
const { verifyOperationsCommandHandler } = require('../commands/verify-operations-command-action');
|
|
17
|
+
program
|
|
18
|
+
.command('verify-operations <systemKey>')
|
|
19
|
+
.description('Operational readiness: validate, unit, integration, and E2E (system scope)')
|
|
20
|
+
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
21
|
+
.option('-v, --verbose', 'Readiness breakdown and verification step checklist')
|
|
22
|
+
.option('-d, --debug', 'Write debug logs under integration/<systemKey>/logs/')
|
|
23
|
+
.option('--no-sync', 'Skip publishing local integration files before dataplane steps')
|
|
24
|
+
.option(
|
|
25
|
+
'--force',
|
|
26
|
+
'With default sync, pass force to upload (same as aifabrix upload --force)'
|
|
27
|
+
)
|
|
28
|
+
.option('--continue', 'Continue after a failed step (still reports FAILED verdict)')
|
|
29
|
+
.option('--json', 'Machine-readable product envelope')
|
|
30
|
+
.addHelpText('after', VERIFY_OPERATIONS_HELP_AFTER)
|
|
31
|
+
.action((systemKey, options, cmd) => verifyOperationsCommandHandler(systemKey, options, cmd));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function setupVerifyTrustCommand(program) {
|
|
35
|
+
const { verifyTrustCommandHandler } = require('../commands/verify-trust-command-action');
|
|
36
|
+
program
|
|
37
|
+
.command('verify-trust <systemKey>')
|
|
38
|
+
.description('AI business context confidence for every datasource (semantic metadata trust)')
|
|
39
|
+
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
40
|
+
.option('-v, --verbose', 'Per-datasource breakdown')
|
|
41
|
+
.option('-d, --debug', 'Write debug log under integration/<systemKey>/logs/')
|
|
42
|
+
.option('--no-sync', 'Skip publishing local integration files before validate')
|
|
43
|
+
.option(
|
|
44
|
+
'--force',
|
|
45
|
+
'With default sync, pass force to upload (same as aifabrix upload --force)'
|
|
46
|
+
)
|
|
47
|
+
.option('--revalidate', 'Force new validation for each datasource')
|
|
48
|
+
.option('--timeout <ms>', 'HTTP timeout for validate/latest requests (ms)', '120000')
|
|
49
|
+
.option('--json', 'Machine-readable product envelope')
|
|
50
|
+
.addHelpText('after', VERIFY_TRUST_HELP_AFTER)
|
|
51
|
+
.action((systemKey, options, cmd) => verifyTrustCommandHandler(systemKey, options, cmd));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function setupVerifyGovernanceCommand(program) {
|
|
55
|
+
const { verifyGovernanceCommandHandler } = require('../commands/verify-governance-command-action');
|
|
56
|
+
program
|
|
57
|
+
.command('verify-governance <systemKey>')
|
|
58
|
+
.description(
|
|
59
|
+
'Generate integration validation packs, then verify governance (upload local YAML when present)'
|
|
60
|
+
)
|
|
61
|
+
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
62
|
+
.option('-v, --verbose', 'Per-datasource breakdown and pipeline detail')
|
|
63
|
+
.option('-d, --debug', 'Write debug logs under integration/<systemKey>/logs/')
|
|
64
|
+
.option('--no-sync', 'Skip publishing local integration files before dataplane steps')
|
|
65
|
+
.option(
|
|
66
|
+
'--force',
|
|
67
|
+
'With default sync, pass force to upload (same as aifabrix upload --force)'
|
|
68
|
+
)
|
|
69
|
+
.option(
|
|
70
|
+
'--certification-profile <profile>',
|
|
71
|
+
'Certification profile for generate (bronze, silver, gold, …)',
|
|
72
|
+
'bronze'
|
|
73
|
+
)
|
|
74
|
+
.option(
|
|
75
|
+
'--subject-user-id <id>',
|
|
76
|
+
'Subject user id for generated scenarios (repeatable)',
|
|
77
|
+
collectString,
|
|
78
|
+
[]
|
|
79
|
+
)
|
|
80
|
+
.option(
|
|
81
|
+
'--subject-email <email>',
|
|
82
|
+
'Subject email for generated scenarios (repeatable)',
|
|
83
|
+
collectString,
|
|
84
|
+
[]
|
|
85
|
+
)
|
|
86
|
+
.option(
|
|
87
|
+
'--max-samples-per-partition <n>',
|
|
88
|
+
'Max keys per mustInclude/mustExclude partition',
|
|
89
|
+
'25'
|
|
90
|
+
)
|
|
91
|
+
.option(
|
|
92
|
+
'--pack <path>',
|
|
93
|
+
'Authoring override: local YAML only (skips generate and local upload)'
|
|
94
|
+
)
|
|
95
|
+
.option('-a, --app <path>', 'Integration folder override (with --pack)')
|
|
96
|
+
.option('--scenario <id>', 'Scenario subset when using --pack (repeatable)', collectString, [])
|
|
97
|
+
.option('--json', 'Machine-readable product envelope')
|
|
98
|
+
.addHelpText('after', VERIFY_GOVERNANCE_HELP_AFTER)
|
|
99
|
+
.action((systemKey, options, cmd) => verifyGovernanceCommandHandler(systemKey, options, cmd));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function setupLifecycleCommand(program) {
|
|
103
|
+
const { lifecycleCommandHandler } = require('../commands/lifecycle-command-action');
|
|
104
|
+
program
|
|
105
|
+
.command('lifecycle <systemKey>')
|
|
106
|
+
.description('Enterprise AI certification report (default: read persisted results from dataplane)')
|
|
107
|
+
.option('-e, --env <env>', 'Environment: dev, tst, or pro', 'dev')
|
|
108
|
+
.option('-v, --verbose', 'Per-datasource breakdown in the report')
|
|
109
|
+
.option('-d, --debug', 'Write debug logs under integration/<systemKey>/logs/ when --run')
|
|
110
|
+
.option('--run', 'Run missing verify steps, then print certification report')
|
|
111
|
+
.option('--no-sync', 'With --run, skip publishing local integration files before verify')
|
|
112
|
+
.option(
|
|
113
|
+
'--force',
|
|
114
|
+
'With default sync on --run, pass force to upload (same as aifabrix upload --force)'
|
|
115
|
+
)
|
|
116
|
+
.option(
|
|
117
|
+
'--subject-user-id <id>',
|
|
118
|
+
'Subject user id for governance generate when --run (repeatable)',
|
|
119
|
+
collectString,
|
|
120
|
+
[]
|
|
121
|
+
)
|
|
122
|
+
.option(
|
|
123
|
+
'--subject-email <email>',
|
|
124
|
+
'Subject email for governance generate when --run (repeatable)',
|
|
125
|
+
collectString,
|
|
126
|
+
[]
|
|
127
|
+
)
|
|
128
|
+
.option(
|
|
129
|
+
'--certification-profile <profile>',
|
|
130
|
+
'Certification profile for governance generate on --run (bronze, silver, gold, …)',
|
|
131
|
+
'bronze'
|
|
132
|
+
)
|
|
133
|
+
.option('--json', 'Machine-readable certification envelope')
|
|
134
|
+
.addHelpText('after', LIFECYCLE_HELP_AFTER)
|
|
135
|
+
.action((systemKey, options, cmd) => lifecycleCommandHandler(systemKey, options, cmd));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function setupCertificationCommands(program) {
|
|
139
|
+
setupVerifyOperationsCommand(program);
|
|
140
|
+
setupVerifyTrustCommand(program);
|
|
141
|
+
setupVerifyGovernanceCommand(program);
|
|
142
|
+
setupLifecycleCommand(program);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
module.exports = {
|
|
146
|
+
setupCertificationCommands
|
|
147
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Help text for Enterprise AI Certification CLI commands (plan 150.0).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const VERIFY_OPERATIONS_HELP_AFTER = `
|
|
8
|
+
Examples:
|
|
9
|
+
$ aifabrix verify-operations hubspot
|
|
10
|
+
$ aifabrix verify-operations hubspot -v
|
|
11
|
+
$ aifabrix verify-operations hubspot --no-sync
|
|
12
|
+
|
|
13
|
+
Notes:
|
|
14
|
+
- Orchestrates validate → test → test-integration → test-e2e for the system.
|
|
15
|
+
- Default output shows Operational Readiness % and OPERATIONS VERIFIED/FAILED only.
|
|
16
|
+
- -v / --verbose adds readiness breakdown and verification step checklist at the end.
|
|
17
|
+
- -v does not enable upload sidecar logs or inner E2E poll spinners (use aifabrix upload -v for upload detail).
|
|
18
|
+
- Low-level commands (validate, test, test-integration, test-e2e) remain for debugging.
|
|
19
|
+
- Generate or upload integration validation packs: aifabrix governance generate|upload <systemKey>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const VERIFY_TRUST_HELP_AFTER = `
|
|
23
|
+
Examples:
|
|
24
|
+
$ aifabrix verify-trust hubspot
|
|
25
|
+
$ aifabrix verify-trust hubspot -v --revalidate
|
|
26
|
+
$ aifabrix verify-trust hubspot --no-sync --json
|
|
27
|
+
|
|
28
|
+
Notes:
|
|
29
|
+
- For one datasource: aifabrix datasource verify-trust <datasourceKey>
|
|
30
|
+
- Does not call external vendor APIs (use verify-operations / test-e2e for connectivity).
|
|
31
|
+
- Local integration files are published before run unless --no-sync.
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const VERIFY_GOVERNANCE_HELP_AFTER = `
|
|
35
|
+
Examples:
|
|
36
|
+
$ aifabrix verify-governance hubspot-e2e --subject-email us.sales@example.com
|
|
37
|
+
$ aifabrix verify-governance hubspot-e2e --subject-email a@x.com,b@y.com -v
|
|
38
|
+
$ aifabrix verify-governance hubspot-e2e --certification-profile gold --json
|
|
39
|
+
|
|
40
|
+
Notes:
|
|
41
|
+
- All-in-one: publishes local integration (unless --no-sync), generates packs on the dataplane,
|
|
42
|
+
then runs governance verification (dataplane-first; no local YAML upload).
|
|
43
|
+
- Requires at least one --subject-user-id or --subject-email (repeatable or comma-separated).
|
|
44
|
+
- Prefer this over separate generate + verify when certifying an integration.
|
|
45
|
+
- --pack skips generate and runs a single local YAML override (authoring only).
|
|
46
|
+
- Granular steps: aifabrix governance generate|verify|upload|download <systemKey>
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const GOVERNANCE_GENERATE_HELP_AFTER = `
|
|
50
|
+
Examples:
|
|
51
|
+
$ aifabrix governance generate hubspot-e2e --subject-email us.sales@example.com
|
|
52
|
+
$ aifabrix governance generate hubspot-e2e --subject-user-id user-a --subject-user-id user-b -v
|
|
53
|
+
$ aifabrix governance generate hubspot-e2e --certification-profile gold --no-sync
|
|
54
|
+
|
|
55
|
+
Notes:
|
|
56
|
+
- Dataplane generates keys, coverage, and generationState; the CLI never authors partitions locally.
|
|
57
|
+
- Requires at least one --subject-user-id or --subject-email per datasource fan-out.
|
|
58
|
+
- Publishes local integration files before generate unless --no-sync.
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
const GOVERNANCE_VERIFY_HELP_AFTER = `
|
|
62
|
+
Examples:
|
|
63
|
+
$ aifabrix governance verify hubspot-e2e
|
|
64
|
+
$ aifabrix governance verify hubspot-e2e -v
|
|
65
|
+
$ aifabrix governance verify hubspot-e2e --pack scenarios/custom.yaml
|
|
66
|
+
|
|
67
|
+
Notes:
|
|
68
|
+
- Default: runs persisted scenario packs from the dataplane (after governance generate).
|
|
69
|
+
- --pack is an authoring override only; product path uses DB packs per datasource.
|
|
70
|
+
- Does not call vendor APIs (use verify-operations for connectivity).
|
|
71
|
+
- All-in-one cert path: aifabrix verify-governance <systemKey> --subject-email <email>
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
const GOVERNANCE_UPLOAD_HELP_AFTER = `
|
|
75
|
+
Examples:
|
|
76
|
+
$ aifabrix governance upload hubspot-e2e
|
|
77
|
+
$ aifabrix governance upload hubspot-e2e --no-sync
|
|
78
|
+
|
|
79
|
+
Notes:
|
|
80
|
+
- Expert path: pushes integration/<systemKey>/scenarios/*.yaml to the dataplane.
|
|
81
|
+
- Packs must satisfy the 424.0 schema (spec.coverage, metadata.generationState). Use governance generate
|
|
82
|
+
or verify-governance for dataplane-first packs.
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
const GOVERNANCE_DOWNLOAD_HELP_AFTER = `
|
|
86
|
+
Examples:
|
|
87
|
+
$ aifabrix governance download hubspot-e2e
|
|
88
|
+
$ aifabrix governance download hubspot-e2e --json
|
|
89
|
+
|
|
90
|
+
Notes:
|
|
91
|
+
- Pulls active packs to integration/<systemKey>/scenarios/<datasourceKey>.yaml.
|
|
92
|
+
- Does not publish the integration (read-only against the dataplane).
|
|
93
|
+
- When no pack exists, lists datasources and suggests governance generate.
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
const LIFECYCLE_HELP_AFTER = `
|
|
97
|
+
Examples:
|
|
98
|
+
$ aifabrix lifecycle hubspot
|
|
99
|
+
$ aifabrix lifecycle hubspot -v
|
|
100
|
+
$ aifabrix lifecycle hubspot --run
|
|
101
|
+
$ aifabrix lifecycle hubspot --run --no-sync
|
|
102
|
+
$ aifabrix lifecycle hubspot-e2e --run --subject-email us.sales@example.com
|
|
103
|
+
$ aifabrix lifecycle hubspot-e2e --run --subject-email a@x.com,b@y.com -v
|
|
104
|
+
|
|
105
|
+
Notes:
|
|
106
|
+
- Default: certification report only (GET persisted pillar results from dataplane).
|
|
107
|
+
- --run executes missing verify steps, then prints the report (publishes local files first unless --no-sync).
|
|
108
|
+
- With --run, --subject-email / --subject-user-id generate and verify governance packs (same as verify-governance).
|
|
109
|
+
- Repeat the flag or use comma-separated values: --subject-email a@x.com,b@y.com
|
|
110
|
+
- One-shot cert path: lifecycle <systemKey> --run --subject-email <email>
|
|
111
|
+
- Tier is never inflated — incomplete pillars show NOT VERIFIED and actionable recommendations.
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
const GOVERNANCE_PARENT_HELP_AFTER = `
|
|
115
|
+
Subcommands:
|
|
116
|
+
generate Create versioned packs on the dataplane (dataplane-first)
|
|
117
|
+
verify Run persisted packs (governance:evaluate)
|
|
118
|
+
upload Push local scenarios/*.yaml (expert path)
|
|
119
|
+
download Pull active packs to integration/<systemKey>/scenarios/
|
|
120
|
+
|
|
121
|
+
All-in-one certification:
|
|
122
|
+
$ aifabrix verify-governance <systemKey> --subject-email <email>
|
|
123
|
+
|
|
124
|
+
Per-command help:
|
|
125
|
+
$ aifabrix governance generate --help
|
|
126
|
+
$ aifabrix governance verify --help
|
|
127
|
+
$ aifabrix governance upload --help
|
|
128
|
+
$ aifabrix governance download --help
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
module.exports = {
|
|
132
|
+
VERIFY_OPERATIONS_HELP_AFTER,
|
|
133
|
+
VERIFY_TRUST_HELP_AFTER,
|
|
134
|
+
VERIFY_GOVERNANCE_HELP_AFTER,
|
|
135
|
+
GOVERNANCE_GENERATE_HELP_AFTER,
|
|
136
|
+
GOVERNANCE_VERIFY_HELP_AFTER,
|
|
137
|
+
GOVERNANCE_UPLOAD_HELP_AFTER,
|
|
138
|
+
GOVERNANCE_DOWNLOAD_HELP_AFTER,
|
|
139
|
+
GOVERNANCE_PARENT_HELP_AFTER,
|
|
140
|
+
LIFECYCLE_HELP_AFTER
|
|
141
|
+
};
|
|
@@ -26,10 +26,27 @@ function setupEnvironmentCommands(program) {
|
|
|
26
26
|
const deployExamples = `
|
|
27
27
|
Examples:
|
|
28
28
|
$ aifabrix env deploy dev
|
|
29
|
-
$ aifabrix env deploy tst
|
|
30
|
-
$ aifabrix env deploy
|
|
29
|
+
$ aifabrix env deploy tst
|
|
30
|
+
$ aifabrix env deploy pro --preset m
|
|
31
|
+
$ aifabrix env deploy dev --preset xl
|
|
32
|
+
$ aifabrix env deploy dev --config ./env-config.json
|
|
33
|
+
$ aifabrix env deploy dev --no-poll
|
|
34
|
+
|
|
35
|
+
Prerequisites: aifabrix login (device token; controller permission controller:deploy).
|
|
36
|
+
Environment keys: miso, dev, tst, pro. Default size preset: s (use --preset s|m|l|xl).
|
|
37
|
+
Run this before aifabrix deploy <app> — the environment must exist first.`;
|
|
31
38
|
|
|
32
39
|
const ENV_GROUP_HELP_AFTER = `
|
|
40
|
+
Examples:
|
|
41
|
+
$ aifabrix env deploy dev
|
|
42
|
+
$ aifabrix env deploy dev --preset m
|
|
43
|
+
$ aifabrix env deploy dev --help
|
|
44
|
+
|
|
45
|
+
Typical workflow:
|
|
46
|
+
1. aifabrix login
|
|
47
|
+
2. aifabrix env deploy dev
|
|
48
|
+
3. aifabrix deploy <app>
|
|
49
|
+
|
|
33
50
|
Subcommands:
|
|
34
51
|
deploy <env> Provision/update environment in Miso Controller (see env deploy --help)
|
|
35
52
|
`;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Help-after blocks for external system lifecycle CLI commands.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const UPLOAD_HELP_AFTER = `
|
|
8
|
+
Examples:
|
|
9
|
+
# Publish integration/<systemKey>/ to the dataplane (typical lab flow after validate + resolve)
|
|
10
|
+
$ aifabrix upload hubspot-demo
|
|
11
|
+
$ aifabrix upload hubspot-demo --verbose
|
|
12
|
+
$ aifabrix upload hubspot-demo --probe
|
|
13
|
+
|
|
14
|
+
# Build and validate payload only (no API calls)
|
|
15
|
+
$ aifabrix upload hubspot-demo --dry-run
|
|
16
|
+
|
|
17
|
+
# Short summary after publish
|
|
18
|
+
$ aifabrix upload hubspot-demo --minimal
|
|
19
|
+
|
|
20
|
+
# Protection manifests (integration/.protection/ at repo root)
|
|
21
|
+
$ aifabrix upload .protection
|
|
22
|
+
$ aifabrix upload .protection --warnings-as-errors --no-sync
|
|
23
|
+
|
|
24
|
+
Notes:
|
|
25
|
+
- Requires login (aifabrix auth status).
|
|
26
|
+
- Reads files under integration/<systemKey>/ (system JSON, datasources, credentials).
|
|
27
|
+
- --probe runs dataplane runtime checks after publish (slower; common in Session 1).
|
|
28
|
+
- test-e2e and test-integration publish local files first by default; use --no-sync on those commands to skip.
|
|
29
|
+
- After dimension/FK edits on active datasources, use --force (or test-e2e / test-integration / datasource test-* with --sync --force).
|
|
30
|
+
- For one datasource only: aifabrix datasource upload <datasourceKey>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const DOWNLOAD_HELP_AFTER = `
|
|
34
|
+
Examples:
|
|
35
|
+
# Pull an existing system from the dataplane into integration/<systemKey>/
|
|
36
|
+
$ aifabrix download hubspot-demo
|
|
37
|
+
$ aifabrix download hubspot-demo --format yaml
|
|
38
|
+
|
|
39
|
+
# Preview without writing files
|
|
40
|
+
$ aifabrix download hubspot-demo --dry-run
|
|
41
|
+
|
|
42
|
+
Notes:
|
|
43
|
+
- Requires login and a system that already exists on the dataplane.
|
|
44
|
+
- Overwrite prompts apply when integration/<systemKey>/ already exists (--force for README).
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const DELETE_HELP_AFTER = `
|
|
48
|
+
Examples:
|
|
49
|
+
# Remove system and datasources from the dataplane
|
|
50
|
+
$ aifabrix delete hubspot-demo
|
|
51
|
+
$ aifabrix delete hubspot-demo --yes
|
|
52
|
+
|
|
53
|
+
Notes:
|
|
54
|
+
- Does not delete local files under integration/<systemKey>/.
|
|
55
|
+
- Use when cleaning up test systems or fixing upload schema overlap (then re-run wizard).
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
UPLOAD_HELP_AFTER,
|
|
60
|
+
DOWNLOAD_HELP_AFTER,
|
|
61
|
+
DELETE_HELP_AFTER
|
|
62
|
+
};
|
|
@@ -15,12 +15,19 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
const { handleCommandError } = require('../utils/cli-utils');
|
|
18
|
+
const { cliOptsSkipSync } = require('../utils/cli-sync-options');
|
|
18
19
|
const { cliOptsSkipCertSync } = require('../certification/cli-cert-sync-skip');
|
|
19
20
|
const { TEST_INTEGRATION_HELP_AFTER } = require('./setup-app.help');
|
|
21
|
+
const {
|
|
22
|
+
UPLOAD_HELP_AFTER,
|
|
23
|
+
DOWNLOAD_HELP_AFTER,
|
|
24
|
+
DELETE_HELP_AFTER
|
|
25
|
+
} = require('./setup-external-system-help');
|
|
20
26
|
|
|
21
27
|
function setupDownloadCommand(program) {
|
|
22
28
|
program.command('download <systemKey>')
|
|
23
29
|
.description('Pull external system from dataplane into integration/<key>/')
|
|
30
|
+
.addHelpText('after', DOWNLOAD_HELP_AFTER)
|
|
24
31
|
.option('--format <format>', 'Output format: json | yaml (default: yaml or config format)')
|
|
25
32
|
.option('--dry-run', 'Show what would be downloaded without actually downloading')
|
|
26
33
|
.option('--force', 'Overwrite existing README.md without prompting')
|
|
@@ -43,6 +50,7 @@ function setupDownloadCommand(program) {
|
|
|
43
50
|
function setupUploadCommand(program) {
|
|
44
51
|
program.command('upload <systemKey>')
|
|
45
52
|
.description('Validate, publish to dataplane, and register with controller (draft application); or upload .protection batch')
|
|
53
|
+
.addHelpText('after', UPLOAD_HELP_AFTER)
|
|
46
54
|
.option('--dry-run', 'Validate and build payload only; no API calls')
|
|
47
55
|
.option('--no-sync', 'For .protection: skip datasource sync after upload')
|
|
48
56
|
.option('--json', 'For .protection: JSON output')
|
|
@@ -55,6 +63,10 @@ function setupUploadCommand(program) {
|
|
|
55
63
|
'--no-cert-sync',
|
|
56
64
|
'Skip updating the system file certification block from the dataplane active certificate after publish'
|
|
57
65
|
)
|
|
66
|
+
.option(
|
|
67
|
+
'--force',
|
|
68
|
+
'Bypass schema guards on active datasources during publish (dangerous; shows a warning)'
|
|
69
|
+
)
|
|
58
70
|
.action(async(systemKey, options) => {
|
|
59
71
|
try {
|
|
60
72
|
const { isProtectionScope } = require('../protection/scope');
|
|
@@ -97,6 +109,7 @@ function setupUploadCommand(program) {
|
|
|
97
109
|
function setupDeleteCommand(program) {
|
|
98
110
|
program.command('delete <systemKey>')
|
|
99
111
|
.description('Remove external system and its datasources from dataplane')
|
|
112
|
+
.addHelpText('after', DELETE_HELP_AFTER)
|
|
100
113
|
.option('--type <type>', 'Application type (default: external; use "external" to target integration/<systemKey>)')
|
|
101
114
|
.option('--yes', 'Skip confirmation prompt')
|
|
102
115
|
.option('--force', 'Skip confirmation prompt (alias for --yes)')
|
|
@@ -168,7 +181,7 @@ async function runExternalSystemTestIntegration(appName, options) {
|
|
|
168
181
|
environment: options.env || options.environment,
|
|
169
182
|
debug: options.debug,
|
|
170
183
|
perDatasource: options.perDatasource,
|
|
171
|
-
|
|
184
|
+
noSync: cliOptsSkipSync(options)
|
|
172
185
|
};
|
|
173
186
|
const results = await test.testExternalSystemIntegration(appName, opts);
|
|
174
187
|
test.displayIntegrationTestResults(results, options.verbose, { debug: options.debug, runType: 'integration' });
|
|
@@ -225,9 +238,17 @@ function setupExternalSystemTestCommands(program) {
|
|
|
225
238
|
.option('-e, --env <env>', 'Environment: dev, tst, or pro (builder: dev/tst for container)', 'dev')
|
|
226
239
|
.option('-v, --verbose', 'Show detailed test output')
|
|
227
240
|
.option('-d, --debug', 'Include debug output and write log to integration/<systemKey>/logs/')
|
|
241
|
+
.option(
|
|
242
|
+
'--no-sync',
|
|
243
|
+
'Skip publishing local integration files; use system config already on the dataplane'
|
|
244
|
+
)
|
|
228
245
|
.option(
|
|
229
246
|
'--sync',
|
|
230
|
-
'Publish local system and datasource files
|
|
247
|
+
'Publish local system and datasource files before tests (default for external integration; same as upload)'
|
|
248
|
+
)
|
|
249
|
+
.option(
|
|
250
|
+
'--force',
|
|
251
|
+
'With --sync, pass force to upload (bypass active-datasource schema replacement guards; same as aifabrix upload --force)'
|
|
231
252
|
)
|
|
232
253
|
.option('--warnings-as-errors', 'Treat aggregate warn as failure (exit 1)')
|
|
233
254
|
.option('--require-cert', 'Require certification passed on every datasource (exit 2 if not)')
|
|
@@ -242,7 +263,8 @@ function setupExternalSystemTestCommands(program) {
|
|
|
242
263
|
const envExplicit = rawArgs.includes('-e') || rawArgs.includes('--env');
|
|
243
264
|
const opts = {
|
|
244
265
|
...options,
|
|
245
|
-
env: envExplicit ? options.env : undefined
|
|
266
|
+
env: envExplicit ? options.env : undefined,
|
|
267
|
+
noSync: cliOptsSkipSync(options, cmd)
|
|
246
268
|
};
|
|
247
269
|
await runTestIntegrationCommand(appName, opts);
|
|
248
270
|
} catch (error) {
|
package/lib/cli/setup-infra.js
CHANGED
|
@@ -134,6 +134,8 @@ async function runUpInfraCommand(options) {
|
|
|
134
134
|
const cfg = await config.getConfig();
|
|
135
135
|
await persistOptionalInfraFlagsFromCli(options, cfg);
|
|
136
136
|
await maybePersistTlsFromUpInfra(options, cfg);
|
|
137
|
+
const { passwordBundleFromCliOptions } = require('../core/admin-secrets-bundle');
|
|
138
|
+
const bundle = passwordBundleFromCliOptions(options);
|
|
137
139
|
const adminPass = options.adminPassword || options.adminPwd;
|
|
138
140
|
const tlsEnabledEffective = cfg.tlsEnabled === true;
|
|
139
141
|
const effective = computeEffectiveInfraOptionalFlags(cfg, options);
|
|
@@ -145,6 +147,8 @@ async function runUpInfraCommand(options) {
|
|
|
145
147
|
adminPwd: adminPass,
|
|
146
148
|
adminEmail: options.adminEmail,
|
|
147
149
|
userPassword: options.userPassword,
|
|
150
|
+
passwordBundle: bundle,
|
|
151
|
+
syncAdminKv: options.syncAdminKv === true,
|
|
148
152
|
tlsEnabled: tlsEnabledEffective
|
|
149
153
|
});
|
|
150
154
|
await persistMissingInfraOptionalServiceFlags(cfg, effective);
|
|
@@ -156,8 +160,12 @@ function setupUpInfraCommand(program) {
|
|
|
156
160
|
.addHelpText('after', UP_INFRA_HELP_AFTER)
|
|
157
161
|
.option('-d, --developer <id>', 'Set developer ID and start infrastructure')
|
|
158
162
|
.option('--verbose', 'Show full orchestration output (default is guided summary)')
|
|
159
|
-
.option('--adminPassword <password>', 'Override
|
|
163
|
+
.option('--adminPassword <password>', 'Override admin password (dev: all roles; pro manual-single)')
|
|
160
164
|
.option('--adminEmail <email>', 'Override {{adminEmail}} default (e.g. pgAdmin login email)')
|
|
165
|
+
.option('--infraAdminPassword <password>', 'Pro profile: infra DB/pgAdmin/Redis Commander password')
|
|
166
|
+
.option('--keycloakAdminPassword <password>', 'Pro profile: Keycloak install admin password')
|
|
167
|
+
.option('--platformAdminPassword <password>', 'Pro profile: platform UI login password (user admin)')
|
|
168
|
+
.option('--syncAdminKv', 'Also sync {{adminPassword}} catalog keys into secrets.local.yaml (legacy)')
|
|
161
169
|
.option('--userPassword <password>', 'Override {{userPassword}} default (e.g. Keycloak default user password)')
|
|
162
170
|
.option('--pgAdmin', 'Include pgAdmin web UI and save to config')
|
|
163
171
|
.option('--no-pgAdmin', 'Exclude pgAdmin and save to config')
|