@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
@@ -1,430 +1,528 @@
1
1
  {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://raw.githubusercontent.com/esystemsdev/aifabrix-builder/refs/heads/main/lib/schema/external-system.schema.json",
4
- "title": "AI Fabrix External System Configuration Schema",
5
- "description": "Schema for configuring an external system connected to the AI Fabrix Dataplane. This defines authentication, OpenAPI/MCP bindings, field mappings defaults, metadata handling and portal inputs.",
6
- "metadata": {
7
- "key": "external-system-schema",
8
- "name": "External System Configuration Schema",
9
- "description": "JSON schema for validating ExternalSystem configuration files",
10
- "version": "1.2.0",
11
- "type": "schema",
12
- "category": "integration",
13
- "author": "AI Fabrix Team",
14
- "createdAt": "2024-01-01T00:00:00Z",
15
- "updatedAt": "2025-12-01T00:00:00Z",
16
- "compatibility": {
17
- "minVersion": "1.0.0",
18
- "maxVersion": "2.0.0",
19
- "deprecated": false
20
- },
21
- "tags": [
22
- "schema",
23
- "external-system",
24
- "dataplane",
25
- "integration",
26
- "validation"
27
- ],
28
- "dependencies": [],
29
- "changelog": [
30
- {
31
- "version": "1.2.0",
32
- "date": "2025-02-01T00:00:00Z",
33
- "changes": [
34
- "Added generateMcpContract (boolean, default true): config-only control for MCP contract generation on publish",
35
- "Added generateOpenApiContract (boolean, default true): reserved for future use"
36
- ],
37
- "breaking": false
38
- },
39
- {
40
- "version": "1.1.0",
41
- "date": "2025-12-01T00:00:00Z",
42
- "changes": [
43
- "Added RBAC roles and permissions support",
44
- "RBAC roles/permissions are registered with miso-controller during deployment",
45
- "Roles support Azure AD group mapping via Groups property",
46
- "Permissions reference roles and are used for access control"
47
- ],
48
- "breaking": false
49
- },
50
- {
51
- "version": "1.0.0",
52
- "date": "2024-01-01T00:00:00Z",
53
- "changes": [
54
- "Initial schema for External Systems",
55
- "Added OpenAPI and MCP contract configuration",
56
- "Added authentication and environment variables",
57
- "Added portalInput for UI-driven onboarding",
58
- "Compatible with field-mappings.schema and security-model.schema"
59
- ],
60
- "breaking": false
61
- }
62
- ]
2
+ "$schema":"http://json-schema.org/draft-07/schema#",
3
+ "$id":"https://raw.githubusercontent.com/esystemsdev/aifabrix-builder/refs/heads/main/lib/schema/external-system.schema.json",
4
+ "title":"AI Fabrix External System Configuration Schema",
5
+ "description":"Schema for configuring an external system connected to the AI Fabrix Dataplane. This defines authentication, OpenAPI/MCP bindings, field mappings defaults, metadata handling and portal inputs.",
6
+ "metadata":{
7
+ "key":"external-system-schema",
8
+ "name":"External System Configuration Schema",
9
+ "description":"JSON schema for validating ExternalSystem configuration files",
10
+ "version":"1.5.0",
11
+ "type":"schema",
12
+ "category":"integration",
13
+ "author":"AI Fabrix Team",
14
+ "createdAt":"2024-01-01T00:00:00Z",
15
+ "updatedAt":"2026-03-07T00:00:00Z",
16
+ "compatibility":{
17
+ "minVersion":"1.4.0",
18
+ "maxVersion":"2.0.0",
19
+ "deprecated":false
20
+ },
21
+ "tags":[
22
+ "schema",
23
+ "external-system",
24
+ "dataplane",
25
+ "integration",
26
+ "validation"
27
+ ],
28
+ "dependencies":[
29
+
30
+ ],
31
+ "changelog":[
32
+ {
33
+ "version":"1.5.0",
34
+ "date":"2026-03-07T00:00:00Z",
35
+ "changes":[
36
+ "Optional rateLimit: outbound per-system rate limit (requestsPerWindow/windowSeconds or requestsPerSecond/burstSize); dataplane enforces and handles 429"
37
+ ]
38
+ },
39
+ {
40
+ "version":"1.4.0",
41
+ "date":"2026-03-07T00:00:00Z",
42
+ "changes":[
43
+ "Optional testEndpoint in authentication.variables for apikey: full URL or path (path resolved against baseUrl); credential test URL for E2E/credential step"
44
+ ]
45
+ },
46
+ {
47
+ "version":"1.3.0",
48
+ "date":"2026-02-18T00:00:00Z",
49
+ "changes":[
50
+ "Template-based authentication: method, variables (baseUrl when method not none), security (kv:// only), credentialKey, writeOnce",
51
+ "Credential created on deploy as authentication.credentialKey or <external-system.key>-cred"
52
+ ]
53
+ },
54
+ {
55
+ "version":"1.2.0",
56
+ "date":"2025-02-01T00:00:00Z",
57
+ "changes":[
58
+ "Added generateMcpContract (boolean, default true): config-only control for MCP contract generation on publish",
59
+ "Added generateOpenApiContract (boolean, default true): reserved for future use"
60
+ ],
61
+ "breaking":false
62
+ },
63
+ {
64
+ "version":"1.1.0",
65
+ "date":"2025-12-01T00:00:00Z",
66
+ "changes":[
67
+ "Added RBAC roles and permissions support",
68
+ "RBAC roles/permissions are registered with miso-controller during deployment",
69
+ "Roles support Azure AD group mapping via Groups property",
70
+ "Permissions reference roles and are used for access control"
71
+ ],
72
+ "breaking":false
73
+ },
74
+ {
75
+ "version":"1.0.0",
76
+ "date":"2024-01-01T00:00:00Z",
77
+ "changes":[
78
+ "Initial schema for External Systems",
79
+ "Added OpenAPI and MCP contract configuration",
80
+ "Added authentication and environment variables",
81
+ "Added portalInput for UI-driven onboarding",
82
+ "Compatible with field-mappings.schema and security-model.schema"
83
+ ],
84
+ "breaking":false
85
+ }
86
+ ]
63
87
  },
64
- "type": "object",
65
- "required": [
66
- "key",
67
- "displayName",
68
- "description",
69
- "type",
70
- "authentication"
88
+ "$defs":{
89
+ "authenticationVariablesByMethod":{
90
+ "oauth2":{"variables":[{"key":"baseUrl","required":true,"description":"API base URL"},{"key":"tokenUrl","required":true,"description":"OAuth token endpoint. Full URL (https://...) or path (e.g. /oauth/v2/token); path is resolved against baseUrl."},{"key":"authorizationUrl","required":false,"description":"OAuth authorization endpoint. Full URL or path; path is resolved against baseUrl. Required when grantType is authorization_code or omitted."},{"key":"grantType","required":false,"description":"OAuth 2.0 grant type. One of: client_credentials, authorization_code. Default: authorization_code."},{"key":"scope","required":false},{"key":"tenantId","required":false},{"key":"testEndpoint","required":false,"description":"Optional URL used when testing the credential (GET). Full URL or path (path resolved against baseUrl). If omitted, baseUrl + /health is used."}],"security":[{"key":"clientId","required":true},{"key":"clientSecret","required":true}]},
91
+ "aad":{"variables":[{"key":"baseUrl","required":true},{"key":"tokenUrl","required":true,"description":"Token endpoint. Full URL or path (path resolved against baseUrl)."},{"key":"authorizationUrl","required":false,"description":"Authorization endpoint. Full URL or path (path resolved against baseUrl). Required when grantType is authorization_code or omitted."},{"key":"grantType","required":false,"description":"OAuth 2.0 grant type. One of: client_credentials, authorization_code. Default: authorization_code."},{"key":"tenantId","required":false},{"key":"testEndpoint","required":false,"description":"Optional URL used when testing the credential (GET). Full URL or path (path resolved against baseUrl). If omitted, baseUrl + /health is used."}],"security":[{"key":"clientId","required":true},{"key":"clientSecret","required":true}]},
92
+ "apikey":{"variables":[{"key":"baseUrl","required":true},{"key":"headerName","required":false},{"key":"prefix","required":false},{"key":"testEndpoint","required":false,"description":"Optional URL used when testing the credential (GET). Full URL (https://...) or path (e.g. /crm/v3/objects/contacts?limit=1); path is resolved against baseUrl. If omitted, baseUrl + /health is used."}],"security":[{"key":"apiKey","required":true}]},
93
+ "basic":{"variables":[{"key":"baseUrl","required":true},{"key":"testEndpoint","required":false,"description":"Optional URL used when testing the credential (GET). Full URL or path (path resolved against baseUrl). If omitted, baseUrl + /health is used."}],"security":[{"key":"username","required":true},{"key":"password","required":true}]},
94
+ "queryParam":{"variables":[{"key":"baseUrl","required":true},{"key":"paramName","required":true},{"key":"testEndpoint","required":false,"description":"Optional URL used when testing the credential (GET). Full URL or path (path resolved against baseUrl). If omitted, baseUrl + /health is used."}],"security":[{"key":"paramValue","required":true}]},
95
+ "oidc":{"variables":[{"key":"openIdConfigUrl","required":true},{"key":"clientId","required":true},{"key":"expectedIssuer","required":false},{"key":"algorithms","required":false},{"key":"validateSignature","required":false},{"key":"clockSkewSeconds","required":false},{"key":"testEndpoint","required":false,"description":"Optional URL used when testing the credential (GET). Full URL or path. For OIDC, discovery URL is typically used if testEndpoint omitted."}],"security":[]},
96
+ "hmac":{"variables":[{"key":"baseUrl","required":false},{"key":"algorithm","required":false},{"key":"signatureHeader","required":false},{"key":"timestampHeader","required":false},{"key":"signaturePrefix","required":false},{"key":"testEndpoint","required":false,"description":"Optional URL used when testing the credential (GET). Full URL or path (path resolved against baseUrl when baseUrl present)."}],"security":[{"key":"signingSecret","required":true}]},
97
+ "none":{"variables":[],"security":[]}
98
+ }
99
+ },
100
+ "type":"object",
101
+ "required":[
102
+ "key",
103
+ "displayName",
104
+ "description",
105
+ "type",
106
+ "authentication"
71
107
  ],
72
- "properties": {
73
- "key": {
74
- "type": "string",
75
- "description": "Unique external system identifier (cannot be changed after creation). Example: 'hubspot', 'salesforce', 'teams'.",
76
- "pattern": "^[a-z0-9-]+$",
77
- "minLength": 3,
78
- "maxLength": 40
79
- },
80
- "displayName": {
81
- "type": "string",
82
- "description": "Human-readable name for the external system",
83
- "minLength": 1,
84
- "maxLength": 100
85
- },
86
- "description": {
87
- "type": "string",
88
- "description": "Description of this external system integration",
89
- "minLength": 1,
90
- "maxLength": 500
91
- },
92
- "type": {
93
- "type": "string",
94
- "enum": [
95
- "openapi",
96
- "mcp",
97
- "custom"
98
- ],
99
- "description": "Integration type: OpenAPI-driven, MCP-driven, or custom Python connector."
100
- },
101
- "enabled": {
102
- "type": "boolean",
103
- "default": true
104
- },
105
- "internal": {
106
- "type": "boolean",
107
- "description": "When true, this integration is deployed on dataplane startup (internal integration). When false or absent, deployed via pipeline only.",
108
- "default": false
109
- },
110
- "authentication": {
111
- "type": "object",
112
- "description": "Authentication configuration for external system",
113
- "required": [
114
- "type"
115
- ],
116
- "properties": {
117
- "type": {
118
- "type": "string",
119
- "enum": [
120
- "oauth2",
121
- "apikey",
122
- "basic",
123
- "aad",
124
- "none"
125
- ],
126
- "description": "Authentication type"
108
+ "properties":{
109
+ "key":{
110
+ "type":"string",
111
+ "description":"Unique external system identifier (cannot be changed after creation). Example: 'hubspot', 'salesforce', 'teams'.",
112
+ "pattern":"^[a-z0-9-]+$",
113
+ "minLength":3,
114
+ "maxLength":40
115
+ },
116
+ "displayName":{
117
+ "type":"string",
118
+ "description":"Human-readable name for the external system",
119
+ "minLength":1,
120
+ "maxLength":100
121
+ },
122
+ "description":{
123
+ "type":"string",
124
+ "description":"Description of this external system integration",
125
+ "minLength":1,
126
+ "maxLength":500
127
+ },
128
+ "type":{
129
+ "type":"string",
130
+ "enum":[
131
+ "openapi",
132
+ "mcp",
133
+ "custom"
134
+ ],
135
+ "description":"Integration type: OpenAPI-driven, MCP-driven, or custom Python connector."
136
+ },
137
+ "enabled":{
138
+ "type":"boolean",
139
+ "default":true
140
+ },
141
+ "credentialIdOrKey":{
142
+ "type":"string",
143
+ "description":"Credential identifier (ID or key) to attach to this system. Used by dataplane when creating/updating system from deploy config."
144
+ },
145
+ "internal":{
146
+ "type":"boolean",
147
+ "description":"When true, this integration is deployed on dataplane startup (internal integration). When false or absent, deployed via pipeline only.",
148
+ "default":false
149
+ },
150
+ "authentication":{
151
+ "type":"object",
152
+ "description":"Template-based authentication. Required: method, variables. When method is not 'none', variables must include baseUrl and security must contain only kv:// references. On deploy, a credential is created with key authentication.credentialKey or <external-system.key>-cred. Template is write-once.",
153
+ "required":[
154
+ "method",
155
+ "variables"
156
+ ],
157
+ "properties":{
158
+ "credentialKey":{
159
+ "type":"string",
160
+ "description":"Stable reference key for the active credential. Default: <external-system.key>-cred."
161
+ },
162
+ "displayName":{
163
+ "type":"string",
164
+ "description":"Display name for the credential created from this template."
165
+ },
166
+ "method":{
167
+ "type":"string",
168
+ "enum":[
169
+ "oauth2",
170
+ "apikey",
171
+ "basic",
172
+ "aad",
173
+ "none",
174
+ "queryParam",
175
+ "oidc",
176
+ "hmac"
177
+ ],
178
+ "description":"Authentication method."
179
+ },
180
+ "variables":{
181
+ "type":"object",
182
+ "description":"Non-secret config. See $defs.authenticationVariablesByMethod for per-method keys. oauth2/aad: baseUrl, tokenUrl, authorizationUrl (optional; required when grantType is authorization_code or omitted), grantType (optional, default authorization_code); apikey: baseUrl, headerName (optional), prefix (optional), testEndpoint (optional); basic: baseUrl; queryParam: baseUrl, paramName; oidc: openIdConfigUrl, clientId; hmac: optional; none: empty. URL-valued variables (tokenUrl, authorizationUrl, testEndpoint) accept full URL or path; paths are resolved against baseUrl by the backend.",
183
+ "additionalProperties":{
184
+ "type":"string"
185
+ }
186
+ },
187
+ "security":{
188
+ "type":"object",
189
+ "description":"Secret-bearing keys only. Values must be kv:// references. See $defs.authenticationVariablesByMethod. oauth2/aad: clientId, clientSecret; apikey: apiKey; basic: username, password; queryParam: paramValue; oidc: none; hmac: signingSecret.",
190
+ "additionalProperties":{
191
+ "type":"string",
192
+ "pattern":"^kv://.+$"
193
+ }
194
+ },
195
+ "writeOnce":{
196
+ "type":"boolean",
197
+ "description":"Template is immutable after first deploy; dataplane does not update the credential from this template again.",
198
+ "default":true
199
+ }
127
200
  },
128
- "oauth2": {
129
- "type": "object",
130
- "description": "OAuth2 authentication configuration",
131
- "additionalProperties": true
201
+ "examples":[
202
+ {"method":"oauth2","variables":{"baseUrl":"https://api.example.com","tokenUrl":"https://api.example.com/oauth/token","authorizationUrl":"https://api.example.com/oauth/authorize"},"security":{"clientId":"kv://example/clientId","clientSecret":"kv://example/clientSecret"}},
203
+ {"method":"oauth2","variables":{"baseUrl":"https://api.example.com","tokenUrl":"https://api.example.com/oauth/token","grantType":"client_credentials"},"security":{"clientId":"kv://example/clientId","clientSecret":"kv://example/clientSecret"}},
204
+ {"method":"apikey","variables":{"baseUrl":"https://api.example.com","headerName":"X-API-Key","testEndpoint":"https://api.example.com/health"},"security":{"apiKey":"kv://example/apiKey"}},
205
+ {"method":"apikey","variables":{"baseUrl":"https://api.example.com","headerName":"Authorization","prefix":"Bearer","testEndpoint":"/crm/v3/objects/contacts?limit=1"},"security":{"apiKey":"kv://example/apiKey"}},
206
+ {"method":"basic","variables":{"baseUrl":"https://api.example.com"},"security":{"username":"kv://example/username","password":"kv://example/password"}},
207
+ {"method":"queryParam","variables":{"baseUrl":"https://api.example.com","paramName":"api_key"},"security":{"paramValue":"kv://example/apiKey"}},
208
+ {"method":"oidc","variables":{"openIdConfigUrl":"https://example.com/.well-known/openid-configuration","clientId":"app-id"}},
209
+ {"method":"hmac","variables":{"signatureHeader":"X-Signature"},"security":{"signingSecret":"kv://example/signingSecret"}},
210
+ {"method":"none","variables":{}}
211
+ ],
212
+ "additionalProperties":false
213
+ },
214
+ "openapi":{
215
+ "type":"object",
216
+ "description":"OpenAPI integration configuration",
217
+ "properties":{
218
+ "documentKey":{
219
+ "type":"string",
220
+ "description":"Key of the OpenAPI document in the registry"
221
+ },
222
+ "specUrl":{
223
+ "type":"string",
224
+ "description":"URL to the OpenAPI specification",
225
+ "pattern":"^(http|https)://.*$"
226
+ }
132
227
  },
133
- "apikey": {
134
- "type": "object",
135
- "description": "API key authentication configuration",
136
- "additionalProperties": true
228
+ "additionalProperties":true
229
+ },
230
+ "mcp":{
231
+ "type":"object",
232
+ "description":"Model Context Protocol integration configuration",
233
+ "properties":{
234
+ "serverUrl":{
235
+ "type":"string",
236
+ "description":"MCP server URL",
237
+ "pattern":"^(http|https)://.*$"
238
+ },
239
+ "toolPrefix":{
240
+ "type":"string",
241
+ "description":"Prefix for MCP tool names",
242
+ "pattern":"^[a-zA-Z0-9_-]+$"
243
+ }
137
244
  },
138
- "basic": {
139
- "type": "object",
140
- "description": "Basic authentication configuration",
141
- "additionalProperties": true
245
+ "additionalProperties":true
246
+ },
247
+ "dataSources":{
248
+ "type":"array",
249
+ "description":"List of data source keys belonging to this external system. Each must match external-datasource.schema.json.",
250
+ "items":{
251
+ "type":"string",
252
+ "pattern":"^[a-z0-9-]+$"
142
253
  },
143
- "aad": {
144
- "type": "object",
145
- "description": "Azure AD authentication configuration",
146
- "additionalProperties": true
254
+ "uniqueItems":true
255
+ },
256
+ "configuration":{
257
+ "type":"array",
258
+ "description":"External system configuration variables (same pattern as application-schema).",
259
+ "items":{
260
+ "type":"object",
261
+ "required":[
262
+ "name",
263
+ "value",
264
+ "location",
265
+ "required"
266
+ ],
267
+ "properties":{
268
+ "name":{
269
+ "type":"string",
270
+ "pattern":"^[A-Z_][A-Z0-9_]*$"
271
+ },
272
+ "value":{
273
+ "type":"string",
274
+ "description":"Literal value or parameter reference ({{parameter}})"
275
+ },
276
+ "location":{
277
+ "type":"string",
278
+ "enum":[
279
+ "variable",
280
+ "keyvault"
281
+ ]
282
+ },
283
+ "required":{
284
+ "type":"boolean"
285
+ },
286
+ "portalInput":{
287
+ "type":"object",
288
+ "required":[
289
+ "field",
290
+ "label"
291
+ ],
292
+ "properties":{
293
+ "field":{
294
+ "type":"string",
295
+ "enum":[
296
+ "password",
297
+ "text",
298
+ "textarea",
299
+ "select",
300
+ "json"
301
+ ]
302
+ },
303
+ "label":{
304
+ "type":"string"
305
+ },
306
+ "placeholder":{
307
+ "type":"string"
308
+ },
309
+ "options":{
310
+ "type":"array",
311
+ "items":{
312
+ "type":"string"
313
+ }
314
+ },
315
+ "masked":{
316
+ "type":"boolean"
317
+ },
318
+ "validation":{
319
+ "type":"object",
320
+ "properties":{
321
+ "minLength":{
322
+ "type":"integer"
323
+ },
324
+ "maxLength":{
325
+ "type":"integer"
326
+ },
327
+ "pattern":{
328
+ "type":"string"
329
+ },
330
+ "required":{
331
+ "type":"boolean"
332
+ }
333
+ },
334
+ "additionalProperties":false
335
+ }
336
+ },
337
+ "additionalProperties":false
338
+ }
339
+ },
340
+ "additionalProperties":false
147
341
  }
148
- },
149
- "additionalProperties": true
150
- },
151
- "openapi": {
152
- "type": "object",
153
- "description": "OpenAPI integration configuration",
154
- "properties": {
155
- "documentKey": {
156
- "type": "string",
157
- "description": "Key of the OpenAPI document in the registry"
158
- },
159
- "specUrl": {
160
- "type": "string",
161
- "description": "URL to the OpenAPI specification",
162
- "pattern": "^(http|https)://.*$"
342
+ },
343
+ "tags":{
344
+ "type":"array",
345
+ "description":"Optional tags for search / filtering",
346
+ "items":{
347
+ "type":"string"
163
348
  }
164
- },
165
- "additionalProperties": true
166
- },
167
- "mcp": {
168
- "type": "object",
169
- "description": "Model Context Protocol integration configuration",
170
- "properties": {
171
- "serverUrl": {
172
- "type": "string",
173
- "description": "MCP server URL",
174
- "pattern": "^(http|https)://.*$"
175
- },
176
- "toolPrefix": {
177
- "type": "string",
178
- "description": "Prefix for MCP tool names",
179
- "pattern": "^[a-zA-Z0-9_-]+$"
349
+ },
350
+ "roles":{
351
+ "type":"array",
352
+ "description":"External system roles for Azure AD group mapping",
353
+ "items":{
354
+ "type":"object",
355
+ "required":[
356
+ "name",
357
+ "value",
358
+ "description"
359
+ ],
360
+ "properties":{
361
+ "name":{
362
+ "type":"string",
363
+ "description":"Human-readable role name",
364
+ "minLength":1,
365
+ "maxLength":100
366
+ },
367
+ "value":{
368
+ "type":"string",
369
+ "description":"Role identifier (used in JWT and ACL)",
370
+ "pattern":"^[a-z-]+$"
371
+ },
372
+ "description":{
373
+ "type":"string",
374
+ "description":"Role description",
375
+ "minLength":1,
376
+ "maxLength":500
377
+ },
378
+ "groups":{
379
+ "type":"array",
380
+ "description":"Azure AD groups mapped to this role",
381
+ "items":{
382
+ "type":"string",
383
+ "minLength":1,
384
+ "maxLength":100
385
+ }
386
+ }
387
+ },
388
+ "additionalProperties":false
180
389
  }
181
- },
182
- "additionalProperties": true
183
- },
184
- "dataSources": {
185
- "type": "array",
186
- "description": "List of data source keys belonging to this external system. Each must match external-datasource.schema.json.",
187
- "items": {
188
- "type": "string",
189
- "pattern": "^[a-z0-9-]+$"
190
- },
191
- "uniqueItems": true
192
- },
193
- "configuration": {
194
- "type": "array",
195
- "description": "External system configuration variables (same pattern as application-schema).",
196
- "items": {
197
- "type": "object",
198
- "required": [
199
- "name",
200
- "value",
201
- "location",
202
- "required"
203
- ],
204
- "properties": {
205
- "name": {
206
- "type": "string",
207
- "pattern": "^[A-Z_][A-Z0-9_]*$"
208
- },
209
- "value": {
210
- "type": "string",
211
- "description": "Literal value or parameter reference ({{parameter}})"
212
- },
213
- "location": {
214
- "type": "string",
215
- "enum": [
216
- "variable",
217
- "keyvault"
218
- ]
219
- },
220
- "required": {
221
- "type": "boolean"
222
- },
223
- "portalInput": {
224
- "type": "object",
225
- "required": [
226
- "field",
227
- "label"
228
- ],
229
- "properties": {
230
- "field": {
231
- "type": "string",
232
- "enum": [
233
- "password",
234
- "text",
235
- "textarea",
236
- "select",
237
- "json"
238
- ]
390
+ },
391
+ "permissions":{
392
+ "type":"array",
393
+ "description":"External system permissions with role mappings for access control",
394
+ "items":{
395
+ "type":"object",
396
+ "required":[
397
+ "name",
398
+ "roles",
399
+ "description"
400
+ ],
401
+ "properties":{
402
+ "name":{
403
+ "type":"string",
404
+ "description":"Permission identifier (e.g., 'documentstore:read', 'flowise:dev:access')",
405
+ "pattern":"^[a-z0-9-:]+$",
406
+ "minLength":1,
407
+ "maxLength":100
239
408
  },
240
- "label": {
241
- "type": "string"
409
+ "roles":{
410
+ "type":"array",
411
+ "description":"Roles that have this permission",
412
+ "items":{
413
+ "type":"string",
414
+ "pattern":"^[a-z-]+$",
415
+ "minLength":1,
416
+ "maxLength":50
417
+ },
418
+ "minItems":1
242
419
  },
243
- "placeholder": {
244
- "type": "string"
420
+ "description":{
421
+ "type":"string",
422
+ "description":"Permission description",
423
+ "minLength":1,
424
+ "maxLength":500
425
+ }
426
+ },
427
+ "additionalProperties":false
428
+ }
429
+ },
430
+ "endpoints":{
431
+ "type":"array",
432
+ "description":"API endpoint configurations for this external system. Used for dynamic endpoint registration at application startup.",
433
+ "items":{
434
+ "type":"object",
435
+ "required":[
436
+ "type",
437
+ "path"
438
+ ],
439
+ "properties":{
440
+ "type":{
441
+ "type":"string",
442
+ "description":"Endpoint type identifier (e.g., 'commands', 'events', 'notifications')",
443
+ "pattern":"^[a-z0-9-]+$"
444
+ },
445
+ "path":{
446
+ "type":"string",
447
+ "description":"URL path for this endpoint (e.g., '/commands', '/events')",
448
+ "pattern":"^/[a-z0-9/-]*$"
245
449
  },
246
- "options": {
247
- "type": "array",
248
- "items": {
249
- "type": "string"
250
- }
450
+ "description":{
451
+ "type":"string",
452
+ "description":"Human-readable description of the endpoint"
251
453
  },
252
- "masked": {
253
- "type": "boolean"
454
+ "active":{
455
+ "type":"boolean",
456
+ "description":"Whether this endpoint should be registered (defaults to true)",
457
+ "default":true
254
458
  },
255
- "validation": {
256
- "type": "object",
257
- "properties": {
258
- "minLength": {
259
- "type": "integer"
260
- },
261
- "maxLength": {
262
- "type": "integer"
263
- },
264
- "pattern": {
265
- "type": "string"
266
- },
267
- "required": {
268
- "type": "boolean"
269
- }
270
- },
271
- "additionalProperties": false
459
+ "router":{
460
+ "type":"string",
461
+ "description":"Custom router module path override (defaults to auto-discovery based on naming convention)"
272
462
  }
273
- },
274
- "additionalProperties": false
275
- }
276
- },
277
- "additionalProperties": false
278
- }
279
- },
280
- "tags": {
281
- "type": "array",
282
- "description": "Optional tags for search / filtering",
283
- "items": {
284
- "type": "string"
285
- }
286
- },
287
- "roles": {
288
- "type": "array",
289
- "description": "External system roles for Azure AD group mapping",
290
- "items": {
291
- "type": "object",
292
- "required": [
293
- "name",
294
- "value",
295
- "description"
296
- ],
297
- "properties": {
298
- "name": {
299
- "type": "string",
300
- "description": "Human-readable role name",
301
- "minLength": 1,
302
- "maxLength": 100
303
- },
304
- "value": {
305
- "type": "string",
306
- "description": "Role identifier (used in JWT and ACL)",
307
- "pattern": "^[a-z-]+$"
308
- },
309
- "description": {
310
- "type": "string",
311
- "description": "Role description",
312
- "minLength": 1,
313
- "maxLength": 500
314
- },
315
- "groups": {
316
- "type": "array",
317
- "description": "Azure AD groups mapped to this role",
318
- "items": {
319
- "type": "string",
320
- "minLength": 1,
321
- "maxLength": 100
322
- }
323
- }
324
- },
325
- "additionalProperties": false
326
- }
327
- },
328
- "permissions": {
329
- "type": "array",
330
- "description": "External system permissions with role mappings for access control",
331
- "items": {
332
- "type": "object",
333
- "required": [
334
- "name",
335
- "roles",
336
- "description"
337
- ],
338
- "properties": {
339
- "name": {
340
- "type": "string",
341
- "description": "Permission identifier (e.g., 'documentstore:read', 'flowise:dev:access')",
342
- "pattern": "^[a-z0-9-:]+$",
343
- "minLength": 1,
344
- "maxLength": 100
345
- },
346
- "roles": {
347
- "type": "array",
348
- "description": "Roles that have this permission",
349
- "items": {
350
- "type": "string",
351
- "pattern": "^[a-z-]+$",
352
- "minLength": 1,
353
- "maxLength": 50
354
- },
355
- "minItems": 1
356
- },
357
- "description": {
358
- "type": "string",
359
- "description": "Permission description",
360
- "minLength": 1,
361
- "maxLength": 500
362
- }
463
+ },
464
+ "additionalProperties":false
465
+ }
466
+ },
467
+ "endpointsActive":{
468
+ "type":"boolean",
469
+ "description":"Master switch for all endpoints in this system. If false, no endpoints are registered regardless of individual endpoint active flags.",
470
+ "default":true
471
+ },
472
+ "generateMcpContract":{
473
+ "type":"boolean",
474
+ "description":"Whether to generate MCP contract on publish. Config only (no query parameter); default true when absent.",
475
+ "default":true
476
+ },
477
+ "generateOpenApiContract":{
478
+ "type":"boolean",
479
+ "description":"Reserved: whether to generate or expose OpenAPI contract on publish. Not yet implemented.",
480
+ "default":true
481
+ },
482
+ "triggerPathsHash":{
483
+ "type":"string",
484
+ "description":"SHA256 hash of triggerPaths payload (64-char hex). Used to detect structural changes. Optional; Dataplane computes when absent.",
485
+ "pattern":"^[a-f0-9]{64}$"
486
+ },
487
+ "rateLimit":{
488
+ "type":"object",
489
+ "description":"Outbound rate limit for requests from the dataplane to this external system. When set, the dataplane enforces the limit per base URL and handles HTTP 429 (wait and retry). When absent, global env defaults apply (CIP_EXECUTION_RATE_LIMIT_REQUESTS_PER_SECOND, CIP_EXECUTION_RATE_LIMIT_BURST_SIZE). Supports window-based (e.g. HubSpot 100/10s) or token-bucket style (requestsPerSecond + burstSize).",
490
+ "properties":{
491
+ "requestsPerWindow":{
492
+ "type":"integer",
493
+ "minimum":1,
494
+ "description":"Maximum requests allowed in the time window (window-based limit). Example: 100 for HubSpot's 100 requests per 10 seconds."
495
+ },
496
+ "windowSeconds":{
497
+ "type":"integer",
498
+ "minimum":1,
499
+ "description":"Time window in seconds. Used with requestsPerWindow. Example: 10 for HubSpot (100 requests per 10 seconds)."
500
+ },
501
+ "requestsPerSecond":{
502
+ "type":"number",
503
+ "minimum":0.1,
504
+ "description":"Sustained request rate (token-bucket style). When used with burstSize, allows short bursts up to burstSize while refilling at this rate."
505
+ },
506
+ "burstSize":{
507
+ "type":"integer",
508
+ "minimum":1,
509
+ "description":"Maximum burst size in tokens (token-bucket style). Used with requestsPerSecond."
510
+ }
363
511
  },
364
- "additionalProperties": false
365
- }
366
- },
367
- "endpoints": {
368
- "type": "array",
369
- "description": "API endpoint configurations for this external system. Used for dynamic endpoint registration at application startup.",
370
- "items": {
371
- "type": "object",
372
- "required": [
373
- "type",
374
- "path"
512
+ "additionalProperties":false,
513
+ "oneOf":[
514
+ {
515
+ "required":["requestsPerWindow","windowSeconds"]
516
+ },
517
+ {
518
+ "required":["requestsPerSecond","burstSize"]
519
+ }
375
520
  ],
376
- "properties": {
377
- "type": {
378
- "type": "string",
379
- "description": "Endpoint type identifier (e.g., 'commands', 'events', 'notifications')",
380
- "pattern": "^[a-z0-9-]+$"
381
- },
382
- "path": {
383
- "type": "string",
384
- "description": "URL path for this endpoint (e.g., '/commands', '/events')",
385
- "pattern": "^/[a-z0-9/-]*$"
386
- },
387
- "description": {
388
- "type": "string",
389
- "description": "Human-readable description of the endpoint"
390
- },
391
- "active": {
392
- "type": "boolean",
393
- "description": "Whether this endpoint should be registered (defaults to true)",
394
- "default": true
395
- },
396
- "router": {
397
- "type": "string",
398
- "description": "Custom router module path override (defaults to auto-discovery based on naming convention)"
399
- }
400
- },
401
- "additionalProperties": false
402
- }
403
- },
404
- "endpointsActive": {
405
- "type": "boolean",
406
- "description": "Master switch for all endpoints in this system. If false, no endpoints are registered regardless of individual endpoint active flags.",
407
- "default": true
408
- },
409
- "credentialIdOrKey": {
410
- "type": "string",
411
- "description": "Credential identifier (ID or key) to use for authenticating with this external system."
412
- },
413
- "generateMcpContract": {
414
- "type": "boolean",
415
- "description": "Whether to generate MCP contract on publish. Config only (no query parameter); default true when absent.",
416
- "default": true
417
- },
418
- "generateOpenApiContract": {
419
- "type": "boolean",
420
- "description": "Reserved: whether to generate or expose OpenAPI contract on publish. Not yet implemented.",
421
- "default": true
422
- },
423
- "triggerPathsHash": {
424
- "type": "string",
425
- "description": "SHA256 hash of triggerPaths payload (64-char hex). Used to detect structural changes. Optional; Dataplane computes when absent.",
426
- "pattern": "^[a-f0-9]{64}$"
427
- }
521
+ "examples":[
522
+ {"requestsPerWindow":100,"windowSeconds":10},
523
+ {"requestsPerSecond":10,"burstSize":100}
524
+ ]
525
+ }
428
526
  },
429
- "additionalProperties": false
430
- }
527
+ "additionalProperties":false
528
+ }