@aifabrix/builder 2.43.0 → 2.44.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/anchor-docs.mdc +15 -0
- package/README.md +1 -1
- package/anchor-docs/README.md +10 -0
- package/anchor-docs/_TEMPLATE +24 -0
- package/bin/aifabrix.js +13 -4
- package/integration/hubspot-test/README.md +31 -0
- package/integration/hubspot-test/create-hubspot.js +5 -5
- package/integration/hubspot-test/hubspot-test-datasource-company.json +58 -462
- package/integration/hubspot-test/hubspot-test-datasource-contact.json +61 -555
- package/integration/hubspot-test/hubspot-test-datasource-deal.json +63 -506
- package/integration/hubspot-test/hubspot-test-datasource-users.json +42 -83
- package/integration/hubspot-test/hubspot-test-deploy.json +3 -3
- package/integration/hubspot-test/test-dataplane-down-tests.js +1 -7
- package/integration/hubspot-test/test-dataplane-down.js +3 -3
- package/integration/hubspot-test/test.js +35 -43
- package/integration/hubspot-test/wizard-hubspot-test-headless.yaml +23 -0
- package/integration/roundtrip-test-local/README.md +144 -0
- package/integration/roundtrip-test-local/application.yaml +13 -0
- package/integration/roundtrip-test-local/env.template +15 -0
- package/integration/roundtrip-test-local/roundtrip-test-local-datasource-roundtrip-test-company.yaml +14 -0
- package/integration/roundtrip-test-local/roundtrip-test-local-deploy.json +61 -0
- package/integration/roundtrip-test-local/roundtrip-test-local-system.yaml +25 -0
- package/integration/roundtrip-test-local2/README.md +144 -0
- package/integration/roundtrip-test-local2/application.yaml +13 -0
- package/integration/roundtrip-test-local2/env.template +15 -0
- package/integration/roundtrip-test-local2/roundtrip-test-local2-datasource-company.yaml +31 -0
- package/integration/roundtrip-test-local2/roundtrip-test-local2-deploy.json +86 -0
- package/integration/roundtrip-test-local2/roundtrip-test-local2-system.yaml +25 -0
- package/integration/test/wizard.yaml +8 -0
- package/jest.config.default.js +10 -0
- package/jest.config.integration.fixtures.js +22 -0
- package/jest.config.integration.js +21 -18
- package/jest.config.isolated.js +10 -0
- package/jest.projects.js +288 -0
- package/lib/api/datasources-core.api.js +3 -3
- package/lib/api/dev-mtls-request.js +110 -0
- package/lib/api/dev-server-https.js +145 -0
- package/lib/api/dev.api.js +133 -144
- package/lib/api/index.js +0 -1
- package/lib/api/pipeline.api.js +67 -20
- package/lib/api/types/dev.types.js +4 -3
- package/lib/api/types/pipeline.types.js +8 -5
- package/lib/api/types/validation-run.types.js +56 -0
- package/lib/api/validation-run.api.js +99 -0
- package/lib/api/validation-runner.js +99 -0
- package/lib/app/config.js +1 -1
- package/lib/app/deploy-status-display.js +2 -2
- package/lib/app/deploy.js +7 -6
- package/lib/app/display.js +2 -1
- package/lib/app/dockerfile.js +3 -2
- package/lib/app/down.js +2 -1
- package/lib/app/helpers.js +6 -5
- package/lib/app/index.js +27 -8
- package/lib/app/list.js +7 -6
- package/lib/app/push.js +4 -3
- package/lib/app/register.js +16 -7
- package/lib/app/rotate-secret.js +14 -13
- package/lib/app/run-container-start.js +184 -0
- package/lib/app/run-docker-fallback.js +108 -0
- package/lib/app/run-env-compose.js +30 -42
- package/lib/app/run-helpers.js +49 -126
- package/lib/app/run-infra-requirements.js +30 -0
- package/lib/app/run-resolve-image.js +21 -0
- package/lib/app/run.js +74 -21
- package/lib/app/show-display.js +1 -1
- package/lib/app/show.js +1 -1
- package/lib/build/index.js +13 -10
- package/lib/cli/index.js +2 -0
- package/lib/cli/setup-app.help.js +67 -0
- package/lib/cli/setup-app.js +57 -121
- package/lib/cli/setup-app.test-commands.js +179 -0
- package/lib/cli/setup-auth.js +19 -5
- package/lib/cli/setup-credential-deployment.js +22 -8
- package/lib/cli/setup-dev-path-commands.js +124 -0
- package/lib/cli/setup-dev.js +170 -113
- package/lib/cli/setup-environment.js +7 -1
- package/lib/cli/setup-external-system.js +62 -22
- package/lib/cli/setup-infra.js +126 -47
- package/lib/cli/setup-parameters.js +32 -0
- package/lib/cli/setup-secrets.js +106 -8
- package/lib/cli/setup-service-user.js +1 -1
- package/lib/cli/setup-utility.js +36 -20
- package/lib/commands/app-down.js +5 -7
- package/lib/commands/app-install.js +14 -7
- package/lib/commands/app-logs.js +13 -10
- package/lib/commands/app-shell.js +4 -1
- package/lib/commands/app-test.js +25 -19
- package/lib/commands/app.js +22 -10
- package/lib/commands/auth-config.js +6 -6
- package/lib/commands/auth-status.js +4 -3
- package/lib/commands/credential-env.js +4 -3
- package/lib/commands/credential-list.js +5 -4
- package/lib/commands/credential-push.js +4 -3
- package/lib/commands/datasource-unified-test-cli.js +495 -0
- package/lib/commands/datasource-unified-test-cli.options.js +149 -0
- package/lib/commands/datasource-validation-cli.js +129 -0
- package/lib/commands/datasource.js +105 -98
- package/lib/commands/deployment-list.js +6 -5
- package/lib/commands/dev-cli-handlers.js +122 -18
- package/lib/commands/dev-down.js +4 -3
- package/lib/commands/dev-init.js +231 -116
- package/lib/commands/dev-show-display.js +473 -0
- package/lib/commands/login-credentials.js +3 -2
- package/lib/commands/login-device.js +4 -3
- package/lib/commands/login.js +5 -4
- package/lib/commands/logout.js +8 -7
- package/lib/commands/parameters-validate.js +54 -0
- package/lib/commands/repair-datasource.js +314 -68
- package/lib/commands/repair-env-template.js +2 -2
- package/lib/commands/repair.js +21 -3
- package/lib/commands/secrets-list.js +23 -12
- package/lib/commands/secrets-remove-all.js +220 -0
- package/lib/commands/secrets-remove.js +21 -12
- package/lib/commands/secrets-set.js +21 -12
- package/lib/commands/secrets-validate.js +4 -4
- package/lib/commands/secure.js +10 -9
- package/lib/commands/service-user.js +26 -25
- package/lib/commands/test-e2e-external.js +27 -1
- package/lib/commands/up-common.js +3 -2
- package/lib/commands/up-dataplane.js +29 -16
- package/lib/commands/up-miso.js +19 -29
- package/lib/commands/upload.js +138 -39
- package/lib/commands/wizard-core-helpers.js +1 -1
- package/lib/commands/wizard-dataplane.js +4 -3
- package/lib/commands/wizard-helpers.js +3 -3
- package/lib/commands/wizard.js +2 -2
- package/lib/core/admin-secrets.js +14 -5
- package/lib/core/audit-logger.js +12 -4
- package/lib/core/config-attach-extensions.js +46 -0
- package/lib/core/config-runtime-paths.js +29 -0
- package/lib/core/config.js +55 -56
- package/lib/core/diff.js +3 -2
- package/lib/core/ensure-encryption-key.js +1 -1
- package/lib/core/secrets-ensure-infra.js +77 -0
- package/lib/core/secrets-ensure.js +120 -64
- package/lib/core/secrets-env-write.js +35 -7
- package/lib/core/secrets-infra-placeholder-sync.js +61 -0
- package/lib/core/secrets.js +200 -37
- package/lib/core/templates-env.js +4 -3
- package/lib/datasource/abac-validator.js +1 -10
- package/lib/datasource/deploy.js +75 -53
- package/lib/datasource/field-reference-validator.js +9 -6
- package/lib/datasource/integration-context.js +63 -0
- package/lib/datasource/list.js +8 -7
- package/lib/datasource/log-viewer.js +84 -53
- package/lib/datasource/resolve-app.js +4 -4
- package/lib/datasource/test-e2e.js +95 -146
- package/lib/datasource/test-integration.js +114 -122
- package/lib/datasource/unified-validation-run-body.js +65 -0
- package/lib/datasource/unified-validation-run-post.js +23 -0
- package/lib/datasource/unified-validation-run-resolve.js +43 -0
- package/lib/datasource/unified-validation-run.js +92 -0
- package/lib/datasource/validate.js +157 -13
- package/lib/deployment/deployer.js +4 -3
- package/lib/deployment/environment.js +7 -6
- package/lib/deployment/push.js +17 -8
- package/lib/external-system/delete.js +4 -3
- package/lib/external-system/deploy.js +131 -53
- package/lib/external-system/download-helpers.js +1 -1
- package/lib/external-system/download.js +7 -6
- package/lib/external-system/generator.js +92 -6
- package/lib/external-system/integration-test-dispatch.js +26 -0
- package/lib/external-system/test-execution.js +5 -1
- package/lib/external-system/test-helpers.js +0 -4
- package/lib/external-system/test-system-level-helpers.js +110 -0
- package/lib/external-system/test-system-level.js +83 -44
- package/lib/external-system/test.js +59 -8
- package/lib/generator/builders.js +23 -11
- package/lib/generator/deploy-manifest-azure-kv.js +81 -0
- package/lib/generator/external.js +16 -4
- package/lib/generator/helpers.js +58 -3
- package/lib/generator/index.js +4 -0
- package/lib/generator/split-readme.js +12 -7
- package/lib/generator/split-variables.js +2 -1
- package/lib/generator/split.js +1 -1
- package/lib/generator/wizard-readme.js +3 -3
- package/lib/generator/wizard.js +8 -8
- package/lib/infrastructure/compose.js +60 -6
- package/lib/infrastructure/helpers.js +201 -29
- package/lib/infrastructure/index.js +28 -17
- package/lib/infrastructure/services.js +21 -15
- package/lib/internal/fs-real-sync.js +104 -0
- package/lib/internal/node-fs.js +98 -0
- package/lib/parameters/database-secret-values.js +173 -0
- package/lib/parameters/infra-kv-discovery.js +121 -0
- package/lib/parameters/infra-parameter-catalog.js +458 -0
- package/lib/parameters/infra-parameter-validate.js +64 -0
- package/lib/schema/application-schema.json +37 -17
- package/lib/schema/datasource-test-run.schema.json +493 -0
- package/lib/schema/deployment-rules.yaml +102 -63
- package/lib/schema/external-datasource.schema.json +1200 -442
- package/lib/schema/external-system.schema.json +181 -5
- package/lib/schema/flag-map-validation-run.json +31 -0
- package/lib/schema/infra-parameter.schema.json +106 -0
- package/lib/schema/infra.parameter.yaml +421 -0
- package/lib/schema/type/credential-auth-templates.json +40 -0
- package/lib/schema/type/document-storage.json +213 -0
- package/lib/schema/type/message-service.json +123 -0
- package/lib/schema/type/vector-store.json +88 -0
- package/lib/utils/aifabrix-runtime-config-dir.js +132 -0
- package/lib/utils/api-error-handler.js +2 -2
- package/lib/utils/api.js +49 -14
- package/lib/utils/app-register-api.js +3 -2
- package/lib/utils/app-register-auth.js +1 -1
- package/lib/utils/app-register-config.js +4 -4
- package/lib/utils/app-register-display.js +3 -2
- package/lib/utils/app-register-validator.js +3 -2
- package/lib/utils/app-run-containers.js +26 -22
- package/lib/utils/app-scoped-config.js +31 -0
- package/lib/utils/app-service-env-from-builder.js +164 -0
- package/lib/utils/build-copy.js +1 -1
- package/lib/utils/build-helpers.js +20 -20
- package/lib/utils/build-resolve-image.js +165 -0
- package/lib/utils/cli-layout-chalk.js +8 -0
- package/lib/utils/cli-test-layout-chalk.js +267 -0
- package/lib/utils/cli-utils.js +88 -11
- package/lib/utils/compose-db-passwords.js +138 -0
- package/lib/utils/compose-generate-docker-compose.js +216 -0
- package/lib/utils/compose-generator.js +197 -291
- package/lib/utils/compose-miso-env.js +18 -0
- package/lib/utils/compose-traefik-ingress-base.js +158 -0
- package/lib/utils/config-paths.js +166 -7
- package/lib/utils/config-scoped-resources-preference.js +41 -0
- package/lib/utils/controller-deployment-outcome.js +68 -0
- package/lib/utils/credential-display.js +2 -2
- package/lib/utils/dataplane-pipeline-warning.js +4 -3
- package/lib/utils/datasource-test-run-capability-scope.js +43 -0
- package/lib/utils/datasource-test-run-debug-display.js +137 -0
- package/lib/utils/datasource-test-run-debug-slice.js +93 -0
- package/lib/utils/datasource-test-run-display.js +442 -0
- package/lib/utils/datasource-test-run-exit.js +58 -0
- package/lib/utils/datasource-test-run-legacy-adapter.js +93 -0
- package/lib/utils/datasource-test-run-report-version.js +51 -0
- package/lib/utils/datasource-test-run-schema-sync.js +59 -0
- package/lib/utils/datasource-test-run-tty-log.js +81 -0
- package/lib/utils/datasource-validation-watch.js +266 -0
- package/lib/utils/declarative-url-ports.js +47 -0
- package/lib/utils/derive-env-key-from-client-id.js +41 -0
- package/lib/utils/dev-ca-install.js +185 -23
- package/lib/utils/dev-cert-helper.js +266 -17
- package/lib/utils/dev-hosts-helper.js +307 -0
- package/lib/utils/dev-init-cert-hints.js +37 -0
- package/lib/utils/dev-init-health-messages.js +52 -0
- package/lib/utils/dev-init-resolve.js +86 -0
- package/lib/utils/dev-init-ssh-merge.js +65 -0
- package/lib/utils/dev-ssh-config-helper.js +196 -0
- package/lib/utils/dev-user-groups.js +93 -0
- package/lib/utils/docker-build.js +42 -17
- package/lib/utils/docker-exec.js +28 -0
- package/lib/utils/docker-manifest-public-port.js +116 -0
- package/lib/utils/docker-not-running-hint.js +52 -0
- package/lib/utils/docker.js +98 -11
- package/lib/utils/ensure-dev-certs-for-remote-docker.js +192 -0
- package/lib/utils/env-config-loader.js +10 -91
- package/lib/utils/env-copy.js +19 -10
- package/lib/utils/env-map.js +35 -8
- package/lib/utils/env-template.js +2 -2
- package/lib/utils/environment-scoped-resources.js +144 -0
- package/lib/utils/error-formatter.js +92 -13
- package/lib/utils/error-formatters/http-status-errors.js +6 -5
- package/lib/utils/error-formatters/network-errors.js +2 -1
- package/lib/utils/error-formatters/permission-errors.js +2 -1
- package/lib/utils/error-formatters/validation-errors.js +2 -1
- package/lib/utils/external-readme.js +8 -1
- package/lib/utils/external-system-display.js +234 -136
- package/lib/utils/external-system-local-test-tty.js +389 -0
- package/lib/utils/external-system-readiness-core.js +377 -0
- package/lib/utils/external-system-readiness-deploy-display.js +270 -0
- package/lib/utils/external-system-readiness-display-internals.js +150 -0
- package/lib/utils/external-system-readiness-display.js +186 -0
- package/lib/utils/external-system-test-helpers.js +24 -6
- package/lib/utils/external-system-validators.js +30 -12
- package/lib/utils/health-check-url.js +119 -0
- package/lib/utils/health-check.js +59 -25
- package/lib/utils/help-builder.js +11 -8
- package/lib/utils/image-version.js +4 -8
- package/lib/utils/infra-containers.js +4 -7
- package/lib/utils/infra-env-defaults.js +162 -0
- package/lib/utils/infra-status-display.js +167 -0
- package/lib/utils/infra-status.js +16 -8
- package/lib/utils/local-secrets.js +3 -4
- package/lib/utils/paths.js +134 -47
- package/lib/utils/port-resolver.js +10 -23
- package/lib/utils/redis-env-scope.js +62 -0
- package/lib/utils/register-aifabrix-shell-env.js +204 -0
- package/lib/utils/remote-builder-validation.js +99 -0
- package/lib/utils/remote-dev-auth.js +117 -21
- package/lib/utils/remote-docker-env.js +67 -15
- package/lib/utils/remote-secrets-loader.js +13 -4
- package/lib/utils/resolve-docker-image-ref.js +124 -0
- package/lib/utils/schema-loader.js +22 -9
- package/lib/utils/secrets-bash-kv.js +25 -0
- package/lib/utils/secrets-generator.js +169 -49
- package/lib/utils/secrets-helpers.js +70 -59
- package/lib/utils/secrets-kv-scope.js +60 -0
- package/lib/utils/secrets-utils.js +32 -38
- package/lib/utils/secrets-validation.js +3 -1
- package/lib/utils/secrets-yaml-preserve.js +109 -0
- package/lib/utils/ssh-key-helper.js +4 -2
- package/lib/utils/template-helpers.js +2 -2
- package/lib/utils/test-log-writer.js +3 -3
- package/lib/utils/token-manager.js +1 -2
- package/lib/utils/url-declarative-public-base.js +188 -0
- package/lib/utils/url-declarative-resolve-build.js +493 -0
- package/lib/utils/url-declarative-resolve-load-doc.js +51 -0
- package/lib/utils/url-declarative-resolve.js +220 -0
- package/lib/utils/url-declarative-token-parse.js +74 -0
- package/lib/utils/url-declarative-url-flags.js +50 -0
- package/lib/utils/url-declarative-vdir-inactive-env.js +99 -0
- package/lib/utils/url-public-path-prefix.js +34 -0
- package/lib/utils/urls-local-registry.js +220 -0
- package/lib/utils/validation-report-tty-kit.js +77 -0
- package/lib/utils/validation-run-poll.js +89 -0
- package/lib/utils/validation-run-post-retry.js +73 -0
- package/lib/utils/validation-run-request.js +98 -0
- package/lib/utils/variable-transformer.js +21 -4
- package/lib/utils/yaml-preserve.js +33 -14
- package/lib/validation/datasource-warnings.js +56 -0
- package/lib/validation/env-template-auth.js +1 -1
- package/lib/validation/external-manifest-validator.js +27 -7
- package/lib/validation/validate-display.js +37 -31
- package/lib/validation/validate.js +4 -13
- package/lib/validation/validator-unresolved-placeholders.js +98 -0
- package/lib/validation/validator.js +22 -65
- package/lib/validation/wizard-config-validator.js +2 -1
- package/package.json +7 -3
- package/scripts/check-datasource-test-run-schema-sync.js +34 -0
- package/scripts/diagnose-cli.js +150 -0
- package/scripts/install-local.js +304 -55
- package/templates/README.md +15 -2
- package/templates/applications/dataplane/application.yaml +52 -2
- package/templates/applications/dataplane/env.template +75 -17
- package/templates/applications/dataplane/rbac.yaml +8 -0
- package/templates/applications/keycloak/application.yaml +9 -1
- package/templates/applications/keycloak/env.template +15 -6
- package/templates/applications/miso-controller/application.yaml +10 -2
- package/templates/applications/miso-controller/env.template +42 -12
- package/templates/applications/miso-controller/rbac.yaml +5 -0
- package/templates/external-system/README.md.hbs +20 -7
- package/templates/external-system/deploy.js.hbs +5 -5
- package/templates/external-system/external-datasource.yaml.hbs +197 -118
- package/templates/infra/compose.yaml.hbs +20 -4
- package/templates/python/docker-compose.hbs +16 -0
- package/templates/typescript/docker-compose.hbs +16 -0
- package/lib/api/external-test.api.js +0 -111
- package/lib/schema/env-config.yaml +0 -60
|
@@ -5,113 +5,72 @@
|
|
|
5
5
|
"systemKey": "hubspot-test",
|
|
6
6
|
"enabled": true,
|
|
7
7
|
"entityType": "recordStorage",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"description": "HubSpot users datasource (minimal v2.4 fixture)",
|
|
9
|
+
"primaryKey": [
|
|
10
|
+
"id"
|
|
11
|
+
],
|
|
12
|
+
"labelKey": [
|
|
13
|
+
"email"
|
|
14
|
+
],
|
|
10
15
|
"metadataSchema": {
|
|
11
16
|
"type": "object",
|
|
17
|
+
"required": [
|
|
18
|
+
"id",
|
|
19
|
+
"externalId",
|
|
20
|
+
"properties"
|
|
21
|
+
],
|
|
12
22
|
"properties": {
|
|
13
23
|
"id": {
|
|
14
24
|
"type": "string",
|
|
15
|
-
"
|
|
16
|
-
},
|
|
17
|
-
"properties": {
|
|
18
|
-
"type": "object",
|
|
19
|
-
"description": "User properties object containing all CRM fields",
|
|
20
|
-
"additionalProperties": true,
|
|
21
|
-
"properties": {
|
|
22
|
-
"email": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"format": "email",
|
|
25
|
-
"description": "User email address"
|
|
26
|
-
},
|
|
27
|
-
"firstName": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"description": "User first name"
|
|
30
|
-
},
|
|
31
|
-
"lastName": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"description": "User last name"
|
|
34
|
-
},
|
|
35
|
-
"role": {
|
|
36
|
-
"type": "string",
|
|
37
|
-
"description": "User role"
|
|
38
|
-
},
|
|
39
|
-
"timezone": {
|
|
40
|
-
"type": "string",
|
|
41
|
-
"description": "User timezone"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"createdAt": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"format": "date-time",
|
|
48
|
-
"description": "User creation timestamp"
|
|
49
|
-
},
|
|
50
|
-
"updatedAt": {
|
|
51
|
-
"type": "string",
|
|
52
|
-
"format": "date-time",
|
|
53
|
-
"description": "User last update timestamp"
|
|
54
|
-
},
|
|
55
|
-
"archived": {
|
|
56
|
-
"type": "boolean",
|
|
57
|
-
"description": "Whether the user is archived"
|
|
58
|
-
},
|
|
59
|
-
"archivedAt": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"format": "date-time",
|
|
62
|
-
"description": "User archive timestamp"
|
|
63
|
-
},
|
|
64
|
-
"associations": {
|
|
65
|
-
"type": "object",
|
|
66
|
-
"description": "Associated records",
|
|
67
|
-
"additionalProperties": true
|
|
25
|
+
"index": true
|
|
68
26
|
},
|
|
69
|
-
"
|
|
27
|
+
"externalId": {
|
|
70
28
|
"type": "string",
|
|
71
|
-
"
|
|
72
|
-
"description": "HubSpot object URL"
|
|
29
|
+
"index": true
|
|
73
30
|
},
|
|
74
|
-
"
|
|
31
|
+
"email": {
|
|
75
32
|
"type": "string",
|
|
76
|
-
"
|
|
33
|
+
"filter": true
|
|
77
34
|
},
|
|
78
|
-
"
|
|
35
|
+
"properties": {
|
|
79
36
|
"type": "object",
|
|
80
|
-
"description": "Properties with change history",
|
|
81
37
|
"additionalProperties": true
|
|
82
38
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"dimensions": {
|
|
42
|
+
"department": {
|
|
43
|
+
"type": "local",
|
|
44
|
+
"field": "department"
|
|
45
|
+
}
|
|
87
46
|
},
|
|
88
47
|
"fieldMappings": {
|
|
89
48
|
"attributes": {
|
|
90
49
|
"id": {
|
|
91
|
-
"expression": "{{id}}"
|
|
92
|
-
|
|
93
|
-
|
|
50
|
+
"expression": "{{raw.id}}"
|
|
51
|
+
},
|
|
52
|
+
"externalId": {
|
|
53
|
+
"expression": "{{raw.id}}"
|
|
54
|
+
},
|
|
55
|
+
"email": {
|
|
56
|
+
"expression": "{{raw.properties.email.value}} | trim"
|
|
94
57
|
},
|
|
95
58
|
"department": {
|
|
96
|
-
"expression": "{{
|
|
97
|
-
"type": "string",
|
|
98
|
-
"indexed": true,
|
|
99
|
-
"description": "Default dimension for catalog compatibility"
|
|
59
|
+
"expression": "{{raw.properties.department.value}} | trim"
|
|
100
60
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"exposed": {
|
|
64
|
+
"schema": {
|
|
65
|
+
"id": "metadata.id",
|
|
66
|
+
"externalId": "metadata.externalId",
|
|
67
|
+
"email": "metadata.email",
|
|
103
68
|
"department": "metadata.department"
|
|
104
69
|
}
|
|
105
70
|
},
|
|
106
71
|
"sync": {
|
|
107
72
|
"mode": "pull",
|
|
108
73
|
"schedule": "0 */6 * * *",
|
|
109
|
-
"batchSize": 100
|
|
110
|
-
"maxParallelRequests": 5,
|
|
111
|
-
"pagination": {
|
|
112
|
-
"strategy": "cursor",
|
|
113
|
-
"cursorField": "$.paging.next.after",
|
|
114
|
-
"cursorParam": "after"
|
|
115
|
-
}
|
|
74
|
+
"batchSize": 100
|
|
116
75
|
}
|
|
117
|
-
}
|
|
76
|
+
}
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
"displayName": "HubSpot Company",
|
|
263
263
|
"description": "HubSpot companies datasource with field mappings for CRM company data",
|
|
264
264
|
"systemKey": "hubspot-test",
|
|
265
|
-
"entityType": "
|
|
265
|
+
"entityType": "recordStorage",
|
|
266
266
|
"resourceType": "customer",
|
|
267
267
|
"enabled": true,
|
|
268
268
|
"version": "1.0.0",
|
|
@@ -806,7 +806,7 @@
|
|
|
806
806
|
"displayName": "HubSpot Contact",
|
|
807
807
|
"description": "HubSpot contacts datasource with field mappings for CRM contact data",
|
|
808
808
|
"systemKey": "hubspot-test",
|
|
809
|
-
"entityType": "
|
|
809
|
+
"entityType": "recordStorage",
|
|
810
810
|
"resourceType": "contact",
|
|
811
811
|
"enabled": true,
|
|
812
812
|
"version": "1.0.0",
|
|
@@ -1448,7 +1448,7 @@
|
|
|
1448
1448
|
"displayName": "HubSpot Deal",
|
|
1449
1449
|
"description": "HubSpot deals datasource with field mappings for CRM deal data",
|
|
1450
1450
|
"systemKey": "hubspot-test",
|
|
1451
|
-
"entityType": "
|
|
1451
|
+
"entityType": "recordStorage",
|
|
1452
1452
|
"resourceType": "deal",
|
|
1453
1453
|
"enabled": true,
|
|
1454
1454
|
"version": "1.0.0",
|
|
@@ -200,13 +200,7 @@ async function createTestDatasource(datasourcePath) {
|
|
|
200
200
|
* @returns {string[]} Command arguments
|
|
201
201
|
*/
|
|
202
202
|
function buildDatasourceUploadArgs(datasourcePath) {
|
|
203
|
-
return [
|
|
204
|
-
'bin/aifabrix.js',
|
|
205
|
-
'datasource',
|
|
206
|
-
'upload',
|
|
207
|
-
'test-app',
|
|
208
|
-
datasourcePath
|
|
209
|
-
];
|
|
203
|
+
return ['bin/aifabrix.js', 'datasource', 'upload', datasourcePath];
|
|
210
204
|
}
|
|
211
205
|
|
|
212
206
|
/**
|
|
@@ -152,15 +152,15 @@ async function runTests() {
|
|
|
152
152
|
results.push(result);
|
|
153
153
|
|
|
154
154
|
if (result.success) {
|
|
155
|
-
logSuccess(
|
|
155
|
+
logSuccess(`✔ ${result.name}: Error handling validated`);
|
|
156
156
|
} else {
|
|
157
|
-
logError(
|
|
157
|
+
logError(`✖ ${result.name}: Error handling failed`);
|
|
158
158
|
if (result.output) {
|
|
159
159
|
logWarn(` Output: ${result.output.substring(0, 200)}...`);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
} catch (error) {
|
|
163
|
-
logError(
|
|
163
|
+
logError(`✖ ${testFn.name}: Unexpected error: ${error.message}`);
|
|
164
164
|
results.push({
|
|
165
165
|
name: testFn.name,
|
|
166
166
|
success: false,
|
|
@@ -430,7 +430,7 @@ async function validateAuth(context, options) {
|
|
|
430
430
|
throw new Error('Authentication check failed. Run: node bin/aifabrix.js login --controller <url> --method device');
|
|
431
431
|
}
|
|
432
432
|
const output = `${result.stdout}\n${result.stderr}`;
|
|
433
|
-
// Only treat "Not authenticated" as failure; "
|
|
433
|
+
// Only treat "Not authenticated" as failure; "✖ Not reachable" (dataplane) is not auth failure
|
|
434
434
|
if (output.includes('Not authenticated')) {
|
|
435
435
|
throw new Error('Not authenticated. Run: node bin/aifabrix.js login --controller <url> --method device');
|
|
436
436
|
}
|
|
@@ -1216,7 +1216,7 @@ function buildNegativeCredentialTestCases(context) {
|
|
|
1216
1216
|
* @param {string} appName - Application name
|
|
1217
1217
|
* @param {Object} context - Test context
|
|
1218
1218
|
* @param {Object} options - Options object
|
|
1219
|
-
* @param {string} expectedMessage - Expected error
|
|
1219
|
+
* @param {string|string[]} expectedMessage - Expected error substring(s); any match passes
|
|
1220
1220
|
* @returns {Promise<void>} Resolves when validation fails as expected
|
|
1221
1221
|
* @throws {Error} If validation succeeds or expected message not found
|
|
1222
1222
|
*/
|
|
@@ -1228,8 +1228,12 @@ async function runValidationExpectFailure(appName, context, options, expectedMes
|
|
|
1228
1228
|
}
|
|
1229
1229
|
if (expectedMessage) {
|
|
1230
1230
|
const combined = `${result.stdout}\n${result.stderr}`;
|
|
1231
|
-
|
|
1232
|
-
|
|
1231
|
+
const needles = Array.isArray(expectedMessage) ? expectedMessage : [expectedMessage];
|
|
1232
|
+
const found = needles.some(n => combined.includes(n));
|
|
1233
|
+
if (!found) {
|
|
1234
|
+
throw new Error(
|
|
1235
|
+
`Expected error message not found (any of): ${needles.join(' | ')}\nActual output: ${combined}`
|
|
1236
|
+
);
|
|
1233
1237
|
}
|
|
1234
1238
|
}
|
|
1235
1239
|
}
|
|
@@ -1315,20 +1319,16 @@ async function getFirstDatasourcePath(appPath) {
|
|
|
1315
1319
|
}
|
|
1316
1320
|
|
|
1317
1321
|
/**
|
|
1318
|
-
* Corrupts
|
|
1322
|
+
* Corrupts root v2.4 ``dimensions``: local binding without required ``field`` (schema failure).
|
|
1319
1323
|
* @async
|
|
1320
|
-
* @function
|
|
1324
|
+
* @function corruptDatasourceLocalBindingMissingField
|
|
1321
1325
|
* @param {string} datasourcePath - Datasource file path
|
|
1322
1326
|
* @returns {Promise<void>} Resolves when file is corrupted
|
|
1323
1327
|
*/
|
|
1324
|
-
async function
|
|
1328
|
+
async function corruptDatasourceLocalBindingMissingField(datasourcePath) {
|
|
1325
1329
|
const datasourceContent = await fs.readFile(datasourcePath, 'utf8');
|
|
1326
1330
|
const datasourceJson = JSON.parse(datasourceContent);
|
|
1327
|
-
|
|
1328
|
-
delete datasourceJson.fieldMappings.dimensions;
|
|
1329
|
-
} else {
|
|
1330
|
-
datasourceJson.fieldMappings = {};
|
|
1331
|
-
}
|
|
1331
|
+
datasourceJson.dimensions = { orphan_local: { type: 'local' } };
|
|
1332
1332
|
await fs.writeFile(datasourcePath, JSON.stringify(datasourceJson, null, 2), 'utf8');
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
@@ -1342,13 +1342,9 @@ async function corruptDatasourceRemoveDimensions(datasourcePath) {
|
|
|
1342
1342
|
async function corruptDatasourceInvalidDimensionKey(datasourcePath) {
|
|
1343
1343
|
const datasourceContent = await fs.readFile(datasourcePath, 'utf8');
|
|
1344
1344
|
const datasourceJson = JSON.parse(datasourceContent);
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
}
|
|
1348
|
-
if (!datasourceJson.fieldMappings.dimensions) {
|
|
1349
|
-
datasourceJson.fieldMappings.dimensions = {};
|
|
1350
|
-
}
|
|
1351
|
-
datasourceJson.fieldMappings.dimensions['invalid-key-with-hyphen'] = 'metadata.id';
|
|
1345
|
+
datasourceJson.dimensions = {
|
|
1346
|
+
'invalid-key-with-hyphen': { type: 'local', field: 'id' }
|
|
1347
|
+
};
|
|
1352
1348
|
await fs.writeFile(datasourcePath, JSON.stringify(datasourceJson, null, 2), 'utf8');
|
|
1353
1349
|
}
|
|
1354
1350
|
|
|
@@ -1362,30 +1358,23 @@ async function corruptDatasourceInvalidDimensionKey(datasourcePath) {
|
|
|
1362
1358
|
async function corruptDatasourceInvalidAttributePath(datasourcePath) {
|
|
1363
1359
|
const datasourceContent = await fs.readFile(datasourcePath, 'utf8');
|
|
1364
1360
|
const datasourceJson = JSON.parse(datasourceContent);
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
if (!datasourceJson.fieldMappings.dimensions) {
|
|
1369
|
-
datasourceJson.fieldMappings.dimensions = {};
|
|
1370
|
-
}
|
|
1371
|
-
datasourceJson.fieldMappings.dimensions['valid_key'] = 'metadata.id-with-invalid-chars@';
|
|
1361
|
+
datasourceJson.dimensions = {
|
|
1362
|
+
valid_key: { type: 'local', field: 'id-with-invalid-chars@' }
|
|
1363
|
+
};
|
|
1372
1364
|
await fs.writeFile(datasourcePath, JSON.stringify(datasourceJson, null, 2), 'utf8');
|
|
1373
1365
|
}
|
|
1374
1366
|
|
|
1375
1367
|
/**
|
|
1376
|
-
* Corrupts
|
|
1368
|
+
* Corrupts root ``dimensions`` with a non-object JSON value (schema type error).
|
|
1377
1369
|
* @async
|
|
1378
|
-
* @function
|
|
1370
|
+
* @function corruptDatasourceDimensionsWrongJsonType
|
|
1379
1371
|
* @param {string} datasourcePath - Datasource file path
|
|
1380
1372
|
* @returns {Promise<void>} Resolves when file is corrupted
|
|
1381
1373
|
*/
|
|
1382
|
-
async function
|
|
1374
|
+
async function corruptDatasourceDimensionsWrongJsonType(datasourcePath) {
|
|
1383
1375
|
const datasourceContent = await fs.readFile(datasourcePath, 'utf8');
|
|
1384
1376
|
const datasourceJson = JSON.parse(datasourceContent);
|
|
1385
|
-
|
|
1386
|
-
datasourceJson.fieldMappings = {};
|
|
1387
|
-
}
|
|
1388
|
-
datasourceJson.fieldMappings.dimensions = ['invalid', 'array', 'format'];
|
|
1377
|
+
datasourceJson.dimensions = ['invalid', 'array', 'format'];
|
|
1389
1378
|
await fs.writeFile(datasourcePath, JSON.stringify(datasourceJson, null, 2), 'utf8');
|
|
1390
1379
|
}
|
|
1391
1380
|
|
|
@@ -1421,7 +1410,10 @@ function buildNegativeRbacTestCases(context) {
|
|
|
1421
1410
|
}
|
|
1422
1411
|
const appPath = await createSystemForNegativeTest(appName, 'wizard-valid-for-rbac-yaml-test', context, options);
|
|
1423
1412
|
await corruptRbacFile(appPath);
|
|
1424
|
-
await runValidationExpectFailure(appName, context, options,
|
|
1413
|
+
await runValidationExpectFailure(appName, context, options, [
|
|
1414
|
+
'Invalid syntax in rbac.yaml',
|
|
1415
|
+
'Invalid YAML syntax'
|
|
1416
|
+
]);
|
|
1425
1417
|
await cleanupAppArtifacts(appName, options);
|
|
1426
1418
|
}
|
|
1427
1419
|
}
|
|
@@ -1451,23 +1443,23 @@ function buildNegativeDimensionTestCases(context) {
|
|
|
1451
1443
|
return [
|
|
1452
1444
|
createTestCase(
|
|
1453
1445
|
'2.14',
|
|
1454
|
-
'Datasource missing
|
|
1446
|
+
'Datasource dimensions: local binding missing required field',
|
|
1455
1447
|
'wizard-e2e-negative-dimension-missing',
|
|
1456
1448
|
'wizard-valid-for-dimension-test',
|
|
1457
|
-
|
|
1458
|
-
'Missing required property "
|
|
1449
|
+
corruptDatasourceLocalBindingMissingField,
|
|
1450
|
+
'Missing required property "field"'
|
|
1459
1451
|
),
|
|
1460
1452
|
createTestCase(
|
|
1461
1453
|
'2.15',
|
|
1462
|
-
'Datasource invalid dimension key
|
|
1454
|
+
'Datasource invalid dimension key (root dimensions propertyNames)',
|
|
1463
1455
|
'wizard-e2e-negative-dimension-invalid-key',
|
|
1464
1456
|
'wizard-valid-for-dimension-key-test',
|
|
1465
1457
|
corruptDatasourceInvalidDimensionKey,
|
|
1466
|
-
'
|
|
1458
|
+
['letters, numbers, and underscores only', 'property name must be valid']
|
|
1467
1459
|
),
|
|
1468
1460
|
createTestCase(
|
|
1469
1461
|
'2.16',
|
|
1470
|
-
'Datasource invalid
|
|
1462
|
+
'Datasource invalid dimension binding field pattern',
|
|
1471
1463
|
'wizard-e2e-negative-dimension-invalid-path',
|
|
1472
1464
|
'wizard-valid-for-dimension-path-test',
|
|
1473
1465
|
corruptDatasourceInvalidAttributePath,
|
|
@@ -1475,11 +1467,11 @@ function buildNegativeDimensionTestCases(context) {
|
|
|
1475
1467
|
),
|
|
1476
1468
|
createTestCase(
|
|
1477
1469
|
'2.17',
|
|
1478
|
-
'Datasource dimensions
|
|
1470
|
+
'Datasource dimensions wrong JSON type (array)',
|
|
1479
1471
|
'wizard-e2e-negative-dimension-array',
|
|
1480
1472
|
'wizard-valid-for-dimension-array-test',
|
|
1481
|
-
|
|
1482
|
-
'Expected object
|
|
1473
|
+
corruptDatasourceDimensionsWrongJsonType,
|
|
1474
|
+
'Expected object'
|
|
1483
1475
|
)
|
|
1484
1476
|
];
|
|
1485
1477
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Headless wizard: regenerate HubSpot integration under integration/hubspot-test/
|
|
2
|
+
# Requires dataplane access (controller → dataplane) and auth (login or client credentials).
|
|
3
|
+
#
|
|
4
|
+
# From repo root:
|
|
5
|
+
# node bin/aifabrix.js wizard --config integration/hubspot-test/wizard-hubspot-test-headless.yaml \
|
|
6
|
+
# --controller <CONTROLLER_URL> --environment <ENV>
|
|
7
|
+
#
|
|
8
|
+
# Or set deployment.controller / deployment.environment below and omit CLI flags if your
|
|
9
|
+
# wizard runner merges them (see docs/commands/external-integration.md).
|
|
10
|
+
|
|
11
|
+
appName: hubspot-test
|
|
12
|
+
mode: create-system
|
|
13
|
+
source:
|
|
14
|
+
type: known-platform
|
|
15
|
+
platform: hubspot
|
|
16
|
+
credential:
|
|
17
|
+
action: skip
|
|
18
|
+
preferences:
|
|
19
|
+
intent: "HubSpot CRM integration (hubspot-test fixtures)"
|
|
20
|
+
fieldOnboardingLevel: standard
|
|
21
|
+
deployment:
|
|
22
|
+
controller: http://localhost:3110
|
|
23
|
+
environment: dev
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Roundtrip Test
|
|
2
|
+
|
|
3
|
+
Roundtrip validation test
|
|
4
|
+
|
|
5
|
+
## System Information
|
|
6
|
+
|
|
7
|
+
- **System Key**: `roundtrip-test-local`
|
|
8
|
+
- **System Type**: `openapi`
|
|
9
|
+
- **Datasources**: 1
|
|
10
|
+
|
|
11
|
+
## Files
|
|
12
|
+
|
|
13
|
+
- `application.yaml` – Application configuration with `app` and `externalIntegration` blocks
|
|
14
|
+
- `roundtrip-test-local-system.yaml` – External system definition (authentication, OpenAPI/MCP, RBAC)
|
|
15
|
+
- `roundtrip-test-local-datasource-roundtrip-test-company.yaml` – Datasource: Company
|
|
16
|
+
- `env.template` – Environment variables template (secrets, API keys)
|
|
17
|
+
- `roundtrip-test-local-deploy.json` – Deployment manifest (generated by `aifabrix json roundtrip-test-local`)
|
|
18
|
+
- `deploy.js` – Deploy script for the integration
|
|
19
|
+
- `wizard.yaml` – Wizard configuration (if created via wizard)
|
|
20
|
+
|
|
21
|
+
Optional: `rbac.yaml` – Roles and permissions merged into the system when present.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
Login to your controller
|
|
26
|
+
```bash
|
|
27
|
+
aifabrix auth config --set-controller <url> --set-environment dev
|
|
28
|
+
aifabrix login
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 1. Extend External System
|
|
32
|
+
|
|
33
|
+
Use the interactive wizard to extend your existing system:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
aifabrix wizard --app roundtrip-test-local
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Configure Authentication and Datasources
|
|
40
|
+
|
|
41
|
+
Edit files in `integration/roundtrip-test-local/`:
|
|
42
|
+
|
|
43
|
+
- **Authentication**: `roundtrip-test-local-system.yaml` (auth type, credentials placeholders)
|
|
44
|
+
- **Field mappings**: `roundtrip-test-local-datasource-*-datasource.yaml` (dimensions, attributes, operations)
|
|
45
|
+
- **Credential and configuration**: `env.template` (security settings and configuration variables)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Secrets
|
|
49
|
+
|
|
50
|
+
Secrets are resolved from `.aifabrix` or key vault. Set them with:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
aifabrix secret set roundtrip-test-local/apiKey <your value> # API Key
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### 3. Validate Configuration
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
aifabrix validate roundtrip-test-local
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 4. Repair Deployment Manifest
|
|
64
|
+
|
|
65
|
+
**Run repair regularly.** It keeps naming conventions, filenames, and the deployment manifest aligned with AI Fabrix platform best practices. Use it after editing datasources, env.template, or system config—and run it often to catch drift early.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
aifabrix repair roundtrip-test-local
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Options:
|
|
72
|
+
--auth <method> Set authentication method (oauth2, aad, apikey, basic, queryParam, oidc, hmac, none); updates system file and env.template
|
|
73
|
+
--dry-run Report changes only; do not write
|
|
74
|
+
--rbac Ensure RBAC permissions per datasource and add default Admin/Reader roles if none exist
|
|
75
|
+
--expose Set exposed.attributes on each datasource to all fieldMappings.attributes keys
|
|
76
|
+
--sync Add default sync section to datasources that lack it
|
|
77
|
+
--test Generate testPayload.payloadTemplate and testPayload.expectedResult from attributes
|
|
78
|
+
|
|
79
|
+
### 5. Upload to dataplane
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
aifabrix upload roundtrip-test-local
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Testing
|
|
86
|
+
|
|
87
|
+
### Unit Tests (Local Validation, No API)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
aifabrix test roundtrip-test-local
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Integration Tests (Via Dataplane)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
aifabrix test-integration roundtrip-test-local
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### End-to-end Tests (Via Dataplane)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
aifabrix test-e2e roundtrip-test-local
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Options:
|
|
106
|
+
-e, --env <env> Environment: dev, tst, or pro (builder: dev/tst for container)
|
|
107
|
+
-v, --verbose Show detailed step output and poll progress
|
|
108
|
+
--debug Include debug output and write log to integration/roundtrip-test-local/logs/
|
|
109
|
+
--no-async Use sync mode (no polling); single POST per datasource
|
|
110
|
+
|
|
111
|
+
### E2E tests per datasource
|
|
112
|
+
|
|
113
|
+
To run a full E2E test for a single datasource (config, credential, sync, data, CIP), use `aifabrix datasource test-e2e` with the datasource key and app:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Company
|
|
117
|
+
aifabrix datasource test-e2e roundtrip-test-company --app roundtrip-test-local
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Options:
|
|
122
|
+
-a, --app roundtrip-test-local App key (default: resolve from cwd if inside integration/roundtrip-test-local/)
|
|
123
|
+
-e, --env <env> Environment: dev, tst, or pro
|
|
124
|
+
-v, --verbose Show detailed step output and poll progress
|
|
125
|
+
--debug Include debug output and write log to integration/roundtrip-test-local/logs/
|
|
126
|
+
--test-crud Enable CRUD lifecycle test (body testCrud: true)
|
|
127
|
+
--record-id <id> Record ID for test (body recordId)
|
|
128
|
+
--no-cleanup Disable cleanup after test (body cleanup: false)
|
|
129
|
+
--primary-key-value <value|@path> Primary key value or path to JSON file (e.g. @pk.json) for body primaryKeyValue
|
|
130
|
+
--no-async Use sync mode (no polling); single POST, no asyncRun
|
|
131
|
+
|
|
132
|
+
## Deployment
|
|
133
|
+
|
|
134
|
+
Deploy via miso-controller pipeline (same as regular apps). Auth and controller come from `aifabrix login` and `aifabrix auth config`:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
aifabrix deploy roundtrip-test-local
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Troubleshooting
|
|
141
|
+
|
|
142
|
+
- **Validation errors**: Run `aifabrix validate roundtrip-test-local` to see schema and manifest errors.
|
|
143
|
+
- **Deployment / auth**: Run `aifabrix auth config --set-controller <url> --set-environment <env>` and `aifabrix login` before `aifabrix deploy`.
|
|
144
|
+
- **File not found**: Run commands from the project root (where `package.json` and `integration/` live).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
app:
|
|
2
|
+
key: roundtrip-test-local
|
|
3
|
+
displayName: Roundtrip Test
|
|
4
|
+
description: Roundtrip validation test
|
|
5
|
+
type: external
|
|
6
|
+
externalIntegration:
|
|
7
|
+
schemaBasePath: ./
|
|
8
|
+
systems:
|
|
9
|
+
- roundtrip-test-local-system.yaml
|
|
10
|
+
dataSources:
|
|
11
|
+
- roundtrip-test-local-datasource-roundtrip-test-company.yaml
|
|
12
|
+
autopublish: true
|
|
13
|
+
version: 1.0.0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Environment variables for external system integration
|
|
2
|
+
# Use kv:// (or aifabrix secret set) for sensitive values; plain values for non-sensitive configuration.
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
# Authentication
|
|
6
|
+
# Type: oauth2
|
|
7
|
+
KV_ROUNDTRIP_TEST_LOCAL_CLIENTID=kv://roundtrip-test-local/clientId
|
|
8
|
+
KV_ROUNDTRIP_TEST_LOCAL_CLIENTSECRET=kv://roundtrip-test-local/clientSecret
|
|
9
|
+
# Non-secure (e.g. URLs): baseUrl, tokenUrl, authorizationUrl
|
|
10
|
+
|
|
11
|
+
# Configuration
|
|
12
|
+
# KV_ROUNDTRIP_TEST_CLIENTID
|
|
13
|
+
KV_ROUNDTRIP_TEST_CLIENTID=kv://roundtrip-test/clientId
|
|
14
|
+
# KV_ROUNDTRIP_TEST_CLIENTSECRET
|
|
15
|
+
KV_ROUNDTRIP_TEST_CLIENTSECRET=kv://roundtrip-test/clientSecret
|
package/integration/roundtrip-test-local/roundtrip-test-local-datasource-roundtrip-test-company.yaml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
key: roundtrip-test-company
|
|
2
|
+
displayName: Company
|
|
3
|
+
systemKey: roundtrip-test-local
|
|
4
|
+
entityType: record-storage
|
|
5
|
+
resourceType: customer
|
|
6
|
+
primaryKey:
|
|
7
|
+
- country
|
|
8
|
+
fieldMappings:
|
|
9
|
+
dimensions:
|
|
10
|
+
country: metadata.country
|
|
11
|
+
attributes:
|
|
12
|
+
country:
|
|
13
|
+
expression: '{{metadata.country}}'
|
|
14
|
+
type: string
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"system": {
|
|
3
|
+
"key": "roundtrip-test-local",
|
|
4
|
+
"displayName": "Roundtrip Test",
|
|
5
|
+
"description": "Roundtrip validation test",
|
|
6
|
+
"type": "openapi",
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"authentication": {
|
|
9
|
+
"method": "oauth2",
|
|
10
|
+
"variables": {
|
|
11
|
+
"baseUrl": "https://api.example.com",
|
|
12
|
+
"tokenUrl": "https://api.example.com/oauth/token",
|
|
13
|
+
"authorizationUrl": "https://api.example.com/oauth/authorize"
|
|
14
|
+
},
|
|
15
|
+
"security": {
|
|
16
|
+
"clientId": "kv://roundtrip-test/clientId",
|
|
17
|
+
"clientSecret": "kv://roundtrip-test/clientSecret"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"configuration": [
|
|
21
|
+
{
|
|
22
|
+
"name": "KV_ROUNDTRIP_TEST_CLIENTID",
|
|
23
|
+
"value": "roundtrip-test/clientId",
|
|
24
|
+
"location": "keyvault",
|
|
25
|
+
"required": true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "KV_ROUNDTRIP_TEST_CLIENTSECRET",
|
|
29
|
+
"value": "roundtrip-test/clientSecret",
|
|
30
|
+
"location": "keyvault",
|
|
31
|
+
"required": true
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"dataSources": [
|
|
35
|
+
"roundtrip-test-company"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"dataSources": [
|
|
39
|
+
{
|
|
40
|
+
"key": "roundtrip-test-company",
|
|
41
|
+
"displayName": "Company",
|
|
42
|
+
"systemKey": "roundtrip-test-local",
|
|
43
|
+
"entityType": "record-storage",
|
|
44
|
+
"resourceType": "customer",
|
|
45
|
+
"primaryKey": [
|
|
46
|
+
"country"
|
|
47
|
+
],
|
|
48
|
+
"fieldMappings": {
|
|
49
|
+
"dimensions": {
|
|
50
|
+
"country": "metadata.country"
|
|
51
|
+
},
|
|
52
|
+
"attributes": {
|
|
53
|
+
"country": {
|
|
54
|
+
"expression": "{{metadata.country}}",
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|