@aifabrix/builder 2.40.2 → 2.42.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.
Files changed (198) hide show
  1. package/.cursor/rules/docs-rules.mdc +30 -0
  2. package/README.md +7 -5
  3. package/integration/hubspot/README.md +8 -4
  4. package/integration/hubspot/application.json +54 -0
  5. package/integration/hubspot/create-hubspot.js +9 -136
  6. package/integration/hubspot/env.template +3 -4
  7. package/integration/hubspot/hubspot-datasource-company.json +343 -5
  8. package/integration/hubspot/hubspot-datasource-contact.json +413 -5
  9. package/integration/hubspot/hubspot-datasource-deal.json +341 -4
  10. package/integration/hubspot/hubspot-datasource-users.json +116 -0
  11. package/integration/hubspot/hubspot-deploy.json +1250 -108
  12. package/integration/hubspot/hubspot-system.json +15 -32
  13. package/integration/hubspot/test-dataplane-down-tests.js +17 -16
  14. package/integration/hubspot/test-dataplane-down.js +2 -2
  15. package/integration/hubspot/test.js +1 -1
  16. package/jest.config.manual.js +2 -1
  17. package/lib/api/credential.api.js +40 -0
  18. package/lib/api/dev.api.js +423 -0
  19. package/lib/api/external-test.api.js +111 -0
  20. package/lib/api/index.js +42 -19
  21. package/lib/api/pipeline.api.js +66 -120
  22. package/lib/api/types/credential.types.js +23 -0
  23. package/lib/api/types/dev.types.js +140 -0
  24. package/lib/api/types/pipeline.types.js +37 -0
  25. package/lib/api/wizard-platform.api.js +61 -0
  26. package/lib/api/wizard.api.js +34 -1
  27. package/lib/app/config.js +44 -11
  28. package/lib/app/down.js +2 -1
  29. package/lib/app/index.js +12 -1
  30. package/lib/app/prompts.js +44 -29
  31. package/lib/app/push.js +36 -12
  32. package/lib/app/readme.js +9 -6
  33. package/lib/app/run-env-compose.js +264 -0
  34. package/lib/app/run-helpers.js +121 -118
  35. package/lib/app/run.js +148 -28
  36. package/lib/app/show-display.js +1 -1
  37. package/lib/app/show.js +5 -2
  38. package/lib/build/index.js +11 -3
  39. package/lib/cli/setup-app.js +172 -15
  40. package/lib/cli/setup-credential-deployment.js +31 -6
  41. package/lib/cli/setup-dev.js +206 -16
  42. package/lib/cli/setup-environment.js +16 -6
  43. package/lib/cli/setup-external-system.js +89 -24
  44. package/lib/cli/setup-infra.js +82 -15
  45. package/lib/cli/setup-secrets.js +52 -5
  46. package/lib/cli/setup-utility.js +129 -24
  47. package/lib/commands/app-install.js +172 -0
  48. package/lib/commands/app-shell.js +75 -0
  49. package/lib/commands/app-test.js +282 -0
  50. package/lib/commands/app.js +1 -1
  51. package/lib/commands/credential-env.js +162 -0
  52. package/lib/commands/credential-list.js +17 -22
  53. package/lib/commands/credential-push.js +96 -0
  54. package/lib/commands/datasource.js +77 -6
  55. package/lib/commands/dev-cli-handlers.js +141 -0
  56. package/lib/commands/dev-down.js +114 -0
  57. package/lib/commands/dev-init.js +347 -0
  58. package/lib/commands/repair-auth-config.js +99 -0
  59. package/lib/commands/repair-datasource-keys.js +208 -0
  60. package/lib/commands/repair-datasource.js +235 -0
  61. package/lib/commands/repair-env-template.js +348 -0
  62. package/lib/commands/repair-internal.js +85 -0
  63. package/lib/commands/repair-rbac.js +158 -0
  64. package/lib/commands/repair.js +507 -0
  65. package/lib/commands/secrets-list.js +118 -0
  66. package/lib/commands/secrets-remove.js +97 -0
  67. package/lib/commands/secrets-set.js +30 -17
  68. package/lib/commands/secrets-validate.js +50 -0
  69. package/lib/commands/test-e2e-external.js +165 -0
  70. package/lib/commands/up-dataplane.js +2 -2
  71. package/lib/commands/up-miso.js +0 -25
  72. package/lib/commands/upload.js +96 -40
  73. package/lib/commands/wizard-core-helpers.js +226 -4
  74. package/lib/commands/wizard-core.js +67 -29
  75. package/lib/commands/wizard-dataplane.js +1 -1
  76. package/lib/commands/wizard-entity-selection.js +43 -0
  77. package/lib/commands/wizard-headless.js +44 -5
  78. package/lib/commands/wizard-helpers.js +7 -3
  79. package/lib/commands/wizard.js +86 -64
  80. package/lib/core/admin-secrets.js +96 -0
  81. package/lib/core/config.js +7 -1
  82. package/lib/core/secrets-ensure.js +378 -0
  83. package/lib/core/secrets-env-write.js +157 -0
  84. package/lib/core/secrets.js +176 -89
  85. package/lib/datasource/deploy.js +12 -3
  86. package/lib/datasource/field-reference-validator.js +91 -0
  87. package/lib/datasource/test-e2e.js +219 -0
  88. package/lib/datasource/test-integration.js +154 -0
  89. package/lib/datasource/validate.js +21 -3
  90. package/lib/deployment/deployer.js +7 -5
  91. package/lib/deployment/environment-config.js +137 -0
  92. package/lib/deployment/environment.js +21 -98
  93. package/lib/deployment/push.js +32 -2
  94. package/lib/external-system/download.js +188 -203
  95. package/lib/external-system/generator.js +204 -56
  96. package/lib/external-system/test-auth.js +7 -3
  97. package/lib/external-system/test-execution.js +2 -1
  98. package/lib/external-system/test-system-level.js +73 -0
  99. package/lib/external-system/test.js +56 -19
  100. package/lib/generator/external-controller-manifest.js +29 -2
  101. package/lib/generator/external-schema-utils.js +1 -1
  102. package/lib/generator/external.js +10 -3
  103. package/lib/generator/index.js +177 -25
  104. package/lib/generator/split-readme.js +1 -0
  105. package/lib/generator/split-variables.js +7 -1
  106. package/lib/generator/split.js +194 -54
  107. package/lib/generator/wizard-prompts-secondary.js +294 -0
  108. package/lib/generator/wizard-prompts.js +105 -106
  109. package/lib/generator/wizard-readme.js +88 -0
  110. package/lib/generator/wizard.js +155 -158
  111. package/lib/infrastructure/compose.js +11 -1
  112. package/lib/infrastructure/helpers.js +103 -20
  113. package/lib/infrastructure/index.js +98 -12
  114. package/lib/infrastructure/services.js +88 -22
  115. package/lib/schema/application-schema.json +32 -8
  116. package/lib/schema/external-datasource.schema.json +49 -26
  117. package/lib/schema/external-system.schema.json +509 -411
  118. package/lib/schema/wizard-config.schema.json +16 -0
  119. package/lib/utils/api.js +41 -13
  120. package/lib/utils/app-register-auth.js +25 -3
  121. package/lib/utils/auth-headers.js +8 -7
  122. package/lib/utils/cli-utils.js +20 -0
  123. package/lib/utils/compose-generator.js +77 -76
  124. package/lib/utils/compose-handlebars-helpers.js +54 -0
  125. package/lib/utils/compose-vector-helper.js +18 -0
  126. package/lib/utils/config-format-preference.js +51 -0
  127. package/lib/utils/config-format.js +36 -0
  128. package/lib/utils/config-paths.js +127 -2
  129. package/lib/utils/configuration-env-resolver.js +179 -0
  130. package/lib/utils/credential-display.js +83 -0
  131. package/lib/utils/credential-secrets-env.js +357 -0
  132. package/lib/utils/dataplane-pipeline-warning.js +28 -0
  133. package/lib/utils/deployment-validation-helpers.js +4 -4
  134. package/lib/utils/dev-ca-install.js +139 -0
  135. package/lib/utils/dev-cert-helper.js +122 -0
  136. package/lib/utils/device-code-helpers.js +224 -0
  137. package/lib/utils/device-code.js +37 -336
  138. package/lib/utils/docker-build.js +40 -8
  139. package/lib/utils/env-copy.js +103 -13
  140. package/lib/utils/env-map.js +35 -5
  141. package/lib/utils/env-template.js +6 -5
  142. package/lib/utils/error-formatters/http-status-errors.js +20 -2
  143. package/lib/utils/error-formatters/permission-errors.js +0 -1
  144. package/lib/utils/error-formatters/validation-errors.js +0 -1
  145. package/lib/utils/external-readme.js +56 -29
  146. package/lib/utils/external-system-display.js +59 -1
  147. package/lib/utils/external-system-test-helpers.js +21 -8
  148. package/lib/utils/external-system-validators.js +3 -0
  149. package/lib/utils/file-upload.js +20 -50
  150. package/lib/utils/help-builder.js +16 -2
  151. package/lib/utils/infra-status.js +80 -45
  152. package/lib/utils/local-secrets.js +7 -52
  153. package/lib/utils/mutagen-install.js +195 -0
  154. package/lib/utils/mutagen.js +146 -0
  155. package/lib/utils/paths.js +128 -37
  156. package/lib/utils/port-resolver.js +28 -16
  157. package/lib/utils/remote-dev-auth.js +38 -0
  158. package/lib/utils/remote-docker-env.js +43 -0
  159. package/lib/utils/remote-secrets-loader.js +60 -0
  160. package/lib/utils/secrets-canonical.js +93 -0
  161. package/lib/utils/secrets-generator.js +114 -6
  162. package/lib/utils/secrets-helpers.js +108 -114
  163. package/lib/utils/secrets-path.js +2 -2
  164. package/lib/utils/secrets-utils.js +52 -1
  165. package/lib/utils/secrets-validation.js +84 -0
  166. package/lib/utils/ssh-key-helper.js +116 -0
  167. package/lib/utils/test-log-writer.js +56 -0
  168. package/lib/utils/token-manager-messages.js +90 -0
  169. package/lib/utils/token-manager.js +29 -36
  170. package/lib/utils/variable-transformer.js +3 -3
  171. package/lib/validation/env-template-auth.js +157 -0
  172. package/lib/validation/env-template-kv.js +41 -0
  173. package/lib/validation/external-manifest-validator.js +25 -0
  174. package/lib/validation/external-system-auth-rules.js +86 -0
  175. package/lib/validation/validate-batch.js +149 -0
  176. package/lib/validation/validate-datasource-keys-api.js +33 -0
  177. package/lib/validation/validate-display.js +94 -16
  178. package/lib/validation/validate.js +25 -12
  179. package/lib/validation/validator.js +72 -9
  180. package/lib/validation/wizard-datasource-validation.js +50 -0
  181. package/package.json +8 -3
  182. package/scripts/install-local.js +34 -15
  183. package/templates/README.md +0 -1
  184. package/templates/applications/README.md.hbs +4 -4
  185. package/templates/applications/dataplane/application.yaml +6 -5
  186. package/templates/applications/dataplane/env.template +15 -10
  187. package/templates/applications/dataplane/rbac.yaml +2 -2
  188. package/templates/applications/keycloak/env.template +2 -0
  189. package/templates/applications/miso-controller/application.yaml +1 -0
  190. package/templates/applications/miso-controller/env.template +12 -10
  191. package/templates/external-system/README.md.hbs +65 -25
  192. package/templates/external-system/deploy.js.hbs +4 -2
  193. package/templates/external-system/external-datasource.yaml.hbs +217 -0
  194. package/templates/external-system/external-system.json.hbs +1 -18
  195. package/templates/infra/compose.yaml.hbs +6 -0
  196. package/templates/python/docker-compose.hbs +49 -23
  197. package/templates/typescript/docker-compose.hbs +48 -22
  198. package/integration/hubspot/application.yaml +0 -37
@@ -97,6 +97,39 @@ function displaySuccessMessage(currentVersion, newVersion) {
97
97
  console.log('Run "aifabrix --version" to verify.');
98
98
  }
99
99
 
100
+ /**
101
+ * Run pnpm link --global and npm link from project root (handles pnpm global bin not set).
102
+ * @param {string} projectRoot - Path to project root
103
+ * @returns {void}
104
+ * @throws {Error} If linking fails when pnpm global bin is not configured
105
+ */
106
+ function runPnpmLink(projectRoot) {
107
+ let pnpmLinked = false;
108
+ try {
109
+ execSync('pnpm link --global', { stdio: 'inherit', cwd: projectRoot });
110
+ pnpmLinked = true;
111
+ } catch (pnpmErr) {
112
+ const msg = (pnpmErr.message || String(pnpmErr));
113
+ if (msg.includes('global bin directory') || msg.includes('ERR_PNPM_NO_GLOBAL_BIN_DIR')) {
114
+ console.log(
115
+ '⚠️ pnpm global bin is not set up. Run "pnpm setup" and add PNPM_HOME to PATH, or we will use npm link.\n'
116
+ );
117
+ } else {
118
+ throw pnpmErr;
119
+ }
120
+ }
121
+ try {
122
+ execSync('npm link', { stdio: 'inherit', cwd: projectRoot });
123
+ } catch {
124
+ if (!pnpmLinked) {
125
+ console.error(
126
+ '\n💡 To fix: run "pnpm setup" and add the suggested line to your shell config, then run install:local again.'
127
+ );
128
+ throw new Error('Linking failed. pnpm global bin not configured and npm link failed.');
129
+ }
130
+ }
131
+ }
132
+
100
133
  /**
101
134
  * Install local package globally
102
135
  * @returns {void}
@@ -107,31 +140,17 @@ function installLocal() {
107
140
  const currentVersion = getCurrentVersion();
108
141
 
109
142
  console.log(`Detected package manager: ${pm}\n`);
110
-
111
- // Show version comparison
112
143
  displayVersionInfo(currentVersion, packageVersion);
113
-
114
144
  console.log('Linking @aifabrix/builder globally...\n');
115
145
 
116
146
  try {
117
147
  const projectRoot = path.join(__dirname, '..');
118
148
  if (pm === 'pnpm') {
119
- // Update pnpm global.
120
- execSync('pnpm link --global', { stdio: 'inherit', cwd: projectRoot });
121
- // Also run npm link so npm's global bin points here; often PATH has
122
- // npm's global bin before pnpm's, so "aifabrix" would otherwise stay old.
123
- try {
124
- execSync('npm link', { stdio: 'inherit', cwd: projectRoot });
125
- } catch {
126
- // npm may not be available or may fail; pnpm link already ran
127
- }
149
+ runPnpmLink(projectRoot);
128
150
  } else {
129
151
  execSync('npm link', { stdio: 'inherit', cwd: projectRoot });
130
152
  }
131
-
132
- // Get new version after linking
133
153
  const newVersion = getCurrentVersion();
134
-
135
154
  displaySuccessMessage(currentVersion, newVersion);
136
155
  } catch (error) {
137
156
  console.error('\n❌ Failed to link package:', error.message);
@@ -70,7 +70,6 @@ Extra workflow steps are located in `templates/github/steps/`. When you use `--g
70
70
  - `{{databases}}` - Array of database configurations
71
71
 
72
72
  ### Build Configuration
73
- - `{{build.localPort}}` - Local development port (different from Docker port)
74
73
  - `{{mountVolume}}` - Volume mount path for local development
75
74
 
76
75
  ## Usage
@@ -38,7 +38,7 @@ aifabrix resolve {{appName}}
38
38
  aifabrix run {{appName}}
39
39
  ```
40
40
 
41
- **Access your app:** http://localhost:{{localPort}}
41
+ **Access your app:** http://localhost:{{port}}
42
42
 
43
43
  **View logs:**
44
44
  ```bash
@@ -118,7 +118,7 @@ aifabrix build {{appName}} --language typescript # Override language detection
118
118
  ### Run Options
119
119
 
120
120
  ```bash
121
- aifabrix run {{appName}} --port {{localPort}} # Override local port
121
+ aifabrix run {{appName}} --port {{port}} # Override port
122
122
  aifabrix run {{appName}} --debug # Debug output
123
123
  ```
124
124
 
@@ -166,7 +166,7 @@ Controller URL and environment (for `deploy`, `app register`, etc.) are set via
166
166
 
167
167
  - **"Docker not running"** → Start Docker Desktop
168
168
  - **"Not logged in"** → Run `aifabrix login` first
169
- - **"Port already in use"** → Use `aifabrix run {{appName}} --port <port>` or set `build.localPort` in `application.yaml` (default: {{localPort}})
169
+ - **"Port already in use"** → Use `aifabrix run {{appName}} --port <port>` or set `port` in `application.yaml` (default: {{port}})
170
170
  - **"Authentication failed"** → Run `aifabrix login` again
171
171
  - **"Build fails"** → Check Docker is running and `aifabrix-secrets` in `config.yaml` is configured correctly
172
172
  - **"Can't connect"** → Verify infrastructure is running{{#if hasDatabase}} and PostgreSQL is accessible{{/if}}
@@ -203,4 +203,4 @@ aifabrix json {{appName}}
203
203
 
204
204
  ---
205
205
 
206
- **Application**: {{appName}} | **Port**: {{localPort}} | **Registry**: {{registry}} | **Image**: {{imageName}}:latest
206
+ **Application**: {{appName}} | **Port**: {{port}} | **Registry**: {{registry}} | **Image**: {{imageName}}:latest
@@ -5,7 +5,7 @@ app:
5
5
  description: "AI Fabrix Dataplane is a secure, in-tenant integration and automation layer that supplies governed, normalized, and explainable enterprise data to AI agents. Using CIP as a declarative standard, it enforces RBAC and ABAC, executes integrations, and exposes trusted data via MCP and OpenAPI."
6
6
  type: webapp
7
7
  language: python # Explicitly specify Python language
8
- version: 1.7.0
8
+ version: 1.8.0
9
9
 
10
10
  # Image Configuration
11
11
  # Set tag to match your build (e.g. aifabrix build dataplane -t v1.0.0 then tag: v1.0.0)
@@ -48,11 +48,12 @@ authentication:
48
48
  # Build Configuration
49
49
  # Dataplane builds from published image; context is project root (like miso-controller)
50
50
  build:
51
- context: ../.. # Docker build context (relative to builder/dataplane/)
51
+ context: ../.. # Docker build context (relative to builder/dataplane/)
52
52
  dockerfile: builder/dataplane/Dockerfile # Dockerfile path (relative to project root)
53
- envOutputPath: ../../.env # Copy to repo root for local dev
54
- localPort: 3011 # Port for local development (different from Docker port)
55
- language: python # Runtime language for template selection (typescript or python)
53
+ envOutputPath: ../../.env # Copy to repo root for local dev
54
+ localPort: 3011 # Port for local development (different from Docker port)
55
+ language: python # Runtime language for template selection (typescript or python)
56
+ reloadStart: uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-3001} --reload # PORT set from port above at run time; default 3001 must match port
56
57
 
57
58
  # =============================================================================
58
59
  # Portal Input Configuration (Deployment Wizard)
@@ -1,5 +1,5 @@
1
1
  # Environment Variables Template
2
- # Use kv:// references for secrets (resolved from .aifabrix/secrets.yaml)
2
+ # Use key-value refs (format: kv://secret-key) for secrets (resolved from .aifabrix/secrets.yaml)
3
3
  # Use ${VAR} for environment-specific values
4
4
 
5
5
  # =============================================================================
@@ -7,9 +7,9 @@
7
7
  # =============================================================================
8
8
 
9
9
  # HTTP port for the app
10
- PORT=3001
11
- # development | staging | production
12
- ENVIRONMENT=development
10
+ PORT=${PORT}
11
+ # dev | tst | pro
12
+ ENVIRONMENT=dev
13
13
  # Enable debug mode
14
14
  DEBUG=false
15
15
  # Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL
@@ -28,10 +28,10 @@ API_KEY=kv://miso-controller-api-key-secretKeyVault
28
28
 
29
29
  # API Configuration
30
30
  API_V1_STR=/api/v1
31
- VERSION=1.7.0
31
+ VERSION=1.8.0
32
32
  # Base URL for the dataplane web server (used for default OAuth2 callback URL when redirectUri is omitted)
33
- DATAPLANE_WEB_SERVER_URL=kv://dataplane-web-server-urlKeyVault
34
- DATAPLANE_INTERNAL_URL=kv://dataplane-internal-server-urlKeyVault
33
+ DATAPLANE_WEB_SERVER_URL=kv://dataplane-web-server-url
34
+ DATAPLANE_INTERNAL_URL=kv://dataplane-internal-server-url
35
35
 
36
36
  # CORS Configuration
37
37
  ALLOWED_ORIGINS=http://localhost:*
@@ -43,6 +43,11 @@ ENCRYPTION_KEY=kv://secrets-encryptionKeyVault
43
43
  # =============================================================================
44
44
  # DATABASE CONFIGURATION
45
45
  # =============================================================================
46
+ # Multiple-database layout: set all four URL env vars for four separate databases
47
+ # (dataplane, dataplane-vector, dataplane-logs, dataplane-records). If any
48
+ # dedicated URL is unset, that database's tables use DATABASE_URL (main).
49
+ # See docs/DATABASE_TABLES_LOCATION.md for table-to-database mapping.
50
+ # =============================================================================
46
51
 
47
52
  # Primary app database URL
48
53
  DATABASE_URL=kv://databases-dataplane-0-urlKeyVault
@@ -89,16 +94,16 @@ MISO_CLIENTSECRET=kv://dataplane-client-secretKeyVault
89
94
 
90
95
  # Keycloak Configuration (for OAuth2 endpoints)
91
96
  # Public: used by OpenAPI OAuth2 / browser (authorizationUrl, tokenUrl).
92
- KEYCLOAK_SERVER_URL=kv://keycloak-server-urlKeyVault
97
+ KEYCLOAK_SERVER_URL=kv://keycloak-server-url
93
98
  # Internal (same role as MISO_CONTROLLER_URL): future server-side Keycloak (e.g. JWKS). Not used by dataplane today.
94
- KEYCLOAK_INTERNAL_SERVER_URL=kv://keycloak-internal-server-urlKeyVault
99
+ KEYCLOAK_INTERNAL_SERVER_URL=kv://keycloak-internal-server-url
95
100
  KEYCLOAK_REALM=aifabrix
96
101
 
97
102
  # =============================================================================
98
103
  # MISO CONTROLLER CONFIGURATION
99
104
  # =============================================================================
100
105
  # Public: browser redirects and CORS for client_token; set when controller is behind a different public URL.
101
- MISO_WEB_SERVER_URL=kv://miso-controller-web-server-urlKeyVault
106
+ MISO_WEB_SERVER_URL=kv://miso-controller-web-server-url
102
107
  # Internal: server-to-controller API calls (auth, pipeline, status, RBAC).
103
108
  MISO_CONTROLLER_URL=http://${MISO_HOST}:${MISO_PORT}
104
109
 
@@ -38,8 +38,8 @@ roles:
38
38
  permissions:
39
39
  # Credential management
40
40
  - name: "credential:create"
41
- roles: ["aifabrix-platform-admin"]
42
- description: "Create credentials"
41
+ roles: ["aifabrix-platform-admin", "aifabrix-deployment-admin", "aifabrix-developer"]
42
+ description: "Create credentials (and store kv:// secrets for upload/publish)"
43
43
 
44
44
  - name: "credential:read"
45
45
  roles: ["aifabrix-platform-admin", "aifabrix-security-admin", "aifabrix-compliance-admin", "aifabrix-observer"]
@@ -39,6 +39,8 @@ KC_HEALTH_ENABLED=true
39
39
  # Expose health endpoints on main HTTP port (like Keycloak 24.0)
40
40
  # Set to false to expose on main port instead of management port (9000)
41
41
  KC_HTTP_MANAGEMENT_HEALTH_ENABLED=false
42
+ # Single-instance: use local cache so /health/ready passes (avoids Infinispan cluster check)
43
+ KC_CACHE=local
42
44
 
43
45
  # =============================================================================
44
46
  # DATABASE CONFIGURATION
@@ -47,6 +47,7 @@ build:
47
47
  envOutputPath: ../../packages/miso-controller/.env # Copy .env to repo root for local dev (relative to builder/) (if null, no .env file is copied) (if empty, .env file is copied to repo root)
48
48
  localPort: 3010 # Port for local development (different from Docker port)
49
49
  language: typescript # Runtime language for template selection (typescript or python)
50
+ reloadStart: pnpm run start:reload # When running with --reload
50
51
 
51
52
  # =============================================================================
52
53
  # Portal Input Configuration (Deployment Wizard)
@@ -49,8 +49,8 @@ ONBOARDING_CREATE_DEV_ENV=true
49
49
 
50
50
  # NODE_ENV: production for Docker (serves pre-built static files), development for local dev
51
51
  # In Docker, this should be production to prevent Vite dev server initialization
52
- NODE_ENV=${NODE_ENV}
53
- PORT=${MISO_PORT}
52
+ NODE_ENV=dev
53
+ PORT=${PORT}
54
54
  AUTO_CREATE_TABLES=true
55
55
  FAST_STARTUP=false
56
56
  ALLOWED_ORIGINS=http://localhost:*
@@ -59,7 +59,7 @@ ENABLE_API_DOCS=true
59
59
  # Rate Limiting Configuration (for local development)
60
60
  # Set DISABLE_RATE_LIMIT=true to disable rate limiting entirely (local development only)
61
61
  DISABLE_RATE_LIMIT=true
62
- # RATE_LIMIT_WINDOW_MS=900000 # 15 minutes in milliseconds (default: 900000)
62
+ # RATE_LIMIT_WINDOW_MS=600000 # 10 minutes in milliseconds (default: 600000)
63
63
  # RATE_LIMIT_MAX=100 # Max requests per window (default: 100)
64
64
 
65
65
  # Package Version (auto-set by npm/pnpm, optional override)
@@ -105,13 +105,12 @@ REDIS_PERMISSIONS_TTL=900
105
105
  # (KeycloakConfiguration + Application url/internalUrl). Sync env->DB at startup via
106
106
  # sync-application-urls-from-env.service.
107
107
  #
108
- # Azure Entra SSO during onboarding: true = skip (default), false = onboard Azure Entra SSO client in Keycloak
109
- # (onboarding Azure SSO requires Entra admin consent and Azure app credentials).
110
- KEYCLOAK_SKIP_AZURE_ENTRA_SSO=false
108
+ # NOTE: Do NOT onboard Azure Entra SSO in Keycloak during onboarding (skipAzureEntraSso=true).
109
+ # KEYCLOAK_SKIP_AZURE_ENTRA_SSO=false
111
110
 
112
111
  KEYCLOAK_REALM=aifabrix
113
- KEYCLOAK_SERVER_URL=kv://keycloak-server-urlKeyVault
114
- KEYCLOAK_INTERNAL_SERVER_URL=kv://keycloak-internal-server-urlKeyVault
112
+ KEYCLOAK_SERVER_URL=kv://keycloak-server-url
113
+ KEYCLOAK_INTERNAL_SERVER_URL=kv://keycloak-internal-server-url
115
114
  KEYCLOAK_CLIENT_ID=miso-controller
116
115
  KEYCLOAK_CLIENT_SECRET=kv://keycloak-client-secretKeyVault
117
116
  KEYCLOAK_ADMIN_USERNAME=admin
@@ -279,6 +278,9 @@ JWT_SECRET=kv://miso-controller-jwt-secretKeyVault
279
278
  # When API_KEY is set, a matching Bearer token bypasses OAuth2 validation
280
279
  API_KEY=kv://miso-controller-api-key-secretKeyVault
281
280
 
281
+ # NPM token for private package (npmjs.org)
282
+ NPM_TOKEN=kv://npm-token-secretKeyVault
283
+
282
284
  # =============================================================================
283
285
  # MISO CONTROLLER CONFIGURATION
284
286
  # =============================================================================
@@ -287,8 +289,8 @@ API_KEY=kv://miso-controller-api-key-secretKeyVault
287
289
  # Used to generate correct server URLs in OpenAPI spec and Keycloak callback URLs
288
290
  # For Docker: use localhost with mapped port (e.g., localhost:3100)
289
291
  # For production: use public domain (e.g., https://miso.example.com)
290
- MISO_WEB_SERVER_URL=kv://miso-controller-web-server-urlKeyVault
291
- MISO_CONTROLLER_URL=kv://miso-controller-internal-server-urlKeyVault
292
+ MISO_WEB_SERVER_URL=kv://miso-controller-web-server-url
293
+ MISO_CONTROLLER_URL=kv://miso-controller-internal-server-url
292
294
 
293
295
  # MISO Environment Configuration (miso, dev, tst, pro)
294
296
  MISO_ENVIRONMENT=miso
@@ -10,25 +10,29 @@
10
10
 
11
11
  ## Files
12
12
 
13
- - `application.yaml` – Application configuration with `app` and `externalIntegration` blocks
14
- - `{{systemKey}}-system.yaml` – External system definition (authentication, OpenAPI/MCP, RBAC)
13
+ - `application{{fileExt}}` – Application configuration with `app` and `externalIntegration` blocks
14
+ - `{{systemKey}}-system{{fileExt}}` – External system definition (authentication, OpenAPI/MCP, RBAC)
15
15
  {{#each datasources}}
16
16
  - `{{fileName}}` – Datasource: {{displayName}}
17
17
  {{/each}}
18
18
  - `env.template` – Environment variables template (secrets, API keys)
19
- - `{{systemKey}}-deploy.json` – Deployment manifest (generated by `aifabrix json`)
19
+ - `{{systemKey}}-deploy.json` – Deployment manifest (generated by `aifabrix json {{appName}}`)
20
+ - `deploy.js` – Deploy script for the integration
21
+ - `wizard.yaml` – Wizard configuration (if created via wizard)
20
22
 
21
23
  Optional: `rbac.yaml` – Roles and permissions merged into the system when present.
22
24
 
23
25
  ## Quick Start
24
26
 
25
- ### 1. Create External System
26
-
27
+ Login to your controller
27
28
  ```bash
28
- aifabrix create {{appName}} --type external
29
+ aifabrix auth config --set-controller <url> --set-environment dev
30
+ aifabrix login
29
31
  ```
30
32
 
31
- Or use the interactive wizard:
33
+ ### 1. Extend External System
34
+
35
+ Use the interactive wizard to extend your existing system:
32
36
 
33
37
  ```bash
34
38
  aifabrix wizard --app {{appName}}
@@ -38,36 +42,35 @@ aifabrix wizard --app {{appName}}
38
42
 
39
43
  Edit files in `integration/{{appName}}/`:
40
44
 
41
- - **Authentication**: `{{systemKey}}-system.yaml` (auth type, credentials placeholders)
42
- - **Field mappings**: `{{systemKey}}-datasource-*.yaml` (dimensions, attributes, operations)
45
+ - **Authentication**: `{{systemKey}}-system{{fileExt}}` (auth type, credentials placeholders)
46
+ - **Field mappings**: `{{systemKey}}-datasource-*-datasource{{fileExt}}` (dimensions, attributes, operations)
47
+ - **Credential and configuration**: `env.template` (security settings and configuration variables)
43
48
 
44
49
  ### 3. Validate Configuration
45
50
 
46
51
  ```bash
47
- aifabrix validate {{appName}} --type external
48
- ```
49
-
50
- ### 4. Generate Deployment Manifest
51
-
52
- ```bash
53
- aifabrix json {{appName}} --type external
52
+ aifabrix validate {{appName}}
54
53
  ```
55
54
 
56
- This creates `{{systemKey}}-deploy.json` in `integration/{{appName}}/`.
57
-
58
- ### 5. Deploy
55
+ ### 4. Repair Deployment Manifest
59
56
 
60
- Controller URL and environment are read from config. Configure and log in first:
57
+ **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.
61
58
 
62
59
  ```bash
63
- aifabrix auth config --set-controller <url> --set-environment dev
64
- aifabrix login
60
+ aifabrix repair {{appName}}
65
61
  ```
66
62
 
67
- Then deploy:
63
+ Options:
64
+ --dry-run Report changes only; do not write
65
+ --rbac Ensure RBAC permissions per datasource and add default Admin/Reader roles if none exist
66
+ --expose Set exposed.attributes on each datasource to all fieldMappings.attributes keys
67
+ --sync Add default sync section to datasources that lack it
68
+ --test Generate testPayload.payloadTemplate and testPayload.expectedResult from attributes
69
+
70
+ ### 5. Upload to dataplane
68
71
 
69
72
  ```bash
70
- aifabrix deploy {{appName}}
73
+ aifabrix upload {{appName}}
71
74
  ```
72
75
 
73
76
  ## Testing
@@ -84,6 +87,43 @@ aifabrix test {{appName}}
84
87
  aifabrix test-integration {{appName}}
85
88
  ```
86
89
 
90
+ ### End-to-end Tests (Via Dataplane)
91
+
92
+ ```bash
93
+ aifabrix test-e2e {{appName}}
94
+ ```
95
+
96
+ Options:
97
+ -e, --env <env> Environment: dev, tst, or pro (builder: dev/tst for container)
98
+ -v, --verbose Show detailed step output and poll progress
99
+ --debug Include debug output and write log to integration/{{appName}}/logs/
100
+ --no-async Use sync mode (no polling); single POST per datasource
101
+
102
+ ### E2E tests per datasource
103
+
104
+ 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:
105
+
106
+ {{#if hasDatasources}}
107
+ ```bash
108
+ {{#each datasources}}
109
+ # {{displayName}}
110
+ aifabrix datasource test-e2e {{datasourceKey}} --app {{../appName}}
111
+
112
+ {{/each}}
113
+ ```
114
+ {{/if}}
115
+
116
+ Options:
117
+ -a, --app {{appName}} App key (default: resolve from cwd if inside integration/{{appName}}/)
118
+ -e, --env <env> Environment: dev, tst, or pro
119
+ -v, --verbose Show detailed step output and poll progress
120
+ --debug Include debug output and write log to integration/{{appName}}/logs/
121
+ --test-crud Enable CRUD lifecycle test (body testCrud: true)
122
+ --record-id <id> Record ID for test (body recordId)
123
+ --no-cleanup Disable cleanup after test (body cleanup: false)
124
+ --primary-key-value <value|@path> Primary key value or path to JSON file (e.g. @pk.json) for body primaryKeyValue
125
+ --no-async Use sync mode (no polling); single POST, no asyncRun
126
+
87
127
  ## Deployment
88
128
 
89
129
  Deploy via miso-controller pipeline (same as regular apps). Auth and controller come from `aifabrix login` and `aifabrix auth config`:
@@ -94,6 +134,6 @@ aifabrix deploy {{appName}}
94
134
 
95
135
  ## Troubleshooting
96
136
 
97
- - **Validation errors**: Run `aifabrix validate {{appName}} --type external` to see schema and manifest errors.
137
+ - **Validation errors**: Run `aifabrix validate {{appName}}` to see schema and manifest errors.
98
138
  - **Deployment / auth**: Run `aifabrix auth config --set-controller <url> --set-environment <env>` and `aifabrix login` before `aifabrix deploy`.
99
139
  - **File not found**: Run commands from the project root (where `package.json` and `integration/` live).
@@ -10,6 +10,8 @@ const { execSync } = require('child_process');
10
10
  const path = require('path');
11
11
 
12
12
  const scriptDir = __dirname;
13
+ // Project root (repo containing integration/ and builder/) so deploy/test-integration resolve app paths correctly
14
+ const projectRoot = path.join(scriptDir, '..', '..');
13
15
  const appKey = '{{systemKey}}';
14
16
  const env = process.env.ENVIRONMENT || 'dev';
15
17
  // Controller URL: from config (aifabrix auth config) or set CONTROLLER env before running
@@ -57,12 +59,12 @@ run('aifabrix validate "' + path.join(scriptDir, '{{this}}') + '"');
57
59
  console.log('✅ Validation passed');
58
60
 
59
61
  console.log('🚀 Deploying ' + appKey + '...');
60
- run('aifabrix deploy ' + appKey);
62
+ run('aifabrix deploy ' + appKey, { cwd: projectRoot });
61
63
  console.log('✅ Deployment complete');
62
64
 
63
65
  if (process.env.RUN_TESTS !== 'false') {
64
66
  console.log('🧪 Running integration tests...');
65
- run('aifabrix test-integration ' + appKey);
67
+ run('aifabrix test-integration ' + appKey, { cwd: projectRoot });
66
68
  console.log('✅ Tests passed');
67
69
  }
68
70