@aifabrix/builder 2.31.1 → 2.32.1

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 (118) hide show
  1. package/README.md +9 -9
  2. package/integration/hubspot/README.md +2 -2
  3. package/integration/hubspot/hubspot-deploy-company.json +17 -14
  4. package/integration/hubspot/hubspot-deploy-contact.json +19 -16
  5. package/integration/hubspot/hubspot-deploy-deal.json +21 -18
  6. package/lib/api/types/datasources.types.js +31 -5
  7. package/lib/api/types/wizard.types.js +142 -0
  8. package/lib/api/wizard.api.js +177 -0
  9. package/lib/{app-config.js → app/config.js} +4 -4
  10. package/lib/{app-deploy.js → app/deploy.js} +8 -8
  11. package/lib/app/display.js +90 -0
  12. package/lib/{app-dockerfile.js → app/dockerfile.js} +4 -4
  13. package/lib/{app-down.js → app/down.js} +4 -4
  14. package/lib/app/helpers.js +218 -0
  15. package/lib/app/index.js +298 -0
  16. package/lib/{app-list.js → app/list.js} +6 -6
  17. package/lib/{app-push.js → app/push.js} +4 -4
  18. package/lib/{app-readme.js → app/readme.js} +34 -13
  19. package/lib/{app-register.js → app/register.js} +9 -9
  20. package/lib/{app-rotate-secret.js → app/rotate-secret.js} +10 -10
  21. package/lib/{app-run-helpers.js → app/run-helpers.js} +10 -10
  22. package/lib/{app-run.js → app/run.js} +6 -6
  23. package/lib/{build.js → build/index.js} +59 -32
  24. package/lib/build/package.json +7 -0
  25. package/lib/cli.js +245 -179
  26. package/lib/commands/app.js +3 -3
  27. package/lib/commands/datasource.js +4 -4
  28. package/lib/commands/login-credentials.js +209 -0
  29. package/lib/commands/login-device.js +254 -0
  30. package/lib/commands/login.js +67 -378
  31. package/lib/commands/logout.js +1 -1
  32. package/lib/commands/secrets-set.js +1 -1
  33. package/lib/commands/secure.js +2 -2
  34. package/lib/commands/wizard.js +498 -0
  35. package/lib/{audit-logger.js → core/audit-logger.js} +1 -1
  36. package/lib/{config.js → core/config.js} +28 -26
  37. package/lib/{diff.js → core/diff.js} +157 -72
  38. package/lib/{secrets.js → core/secrets.js} +86 -49
  39. package/lib/{templates.js → core/templates-env.js} +14 -222
  40. package/lib/core/templates.js +279 -0
  41. package/lib/{datasource-deploy.js → datasource/deploy.js} +6 -6
  42. package/lib/{datasource-diff.js → datasource/diff.js} +2 -2
  43. package/lib/datasource/list.js +223 -0
  44. package/lib/{datasource-validate.js → datasource/validate.js} +2 -2
  45. package/lib/{deployer.js → deployment/deployer.js} +48 -18
  46. package/lib/{environment-deploy.js → deployment/environment.js} +163 -84
  47. package/lib/{push.js → deployment/push.js} +1 -1
  48. package/lib/external-system/deploy-helpers.js +145 -0
  49. package/lib/{external-system-deploy.js → external-system/deploy.js} +156 -111
  50. package/lib/external-system/download-helpers.js +114 -0
  51. package/lib/{external-system-download.js → external-system/download.js} +92 -135
  52. package/lib/{external-system-generator.js → external-system/generator.js} +15 -11
  53. package/lib/external-system/test-auth.js +40 -0
  54. package/lib/external-system/test-execution.js +84 -0
  55. package/lib/external-system/test-helpers.js +109 -0
  56. package/lib/{external-system-test.js → external-system/test.js} +174 -192
  57. package/lib/{generator-builders.js → generator/builders.js} +87 -10
  58. package/lib/{generator-external.js → generator/external.js} +115 -52
  59. package/lib/{github-generator.js → generator/github.js} +116 -15
  60. package/lib/{generator-helpers.js → generator/helpers.js} +92 -42
  61. package/lib/{generator.js → generator/index.js} +49 -22
  62. package/lib/{generator-split.js → generator/split.js} +108 -55
  63. package/lib/generator/wizard-prompts.js +357 -0
  64. package/lib/generator/wizard.js +490 -0
  65. package/lib/{infra.js → infrastructure/index.js} +49 -22
  66. package/lib/schema/external-datasource.schema.json +145 -133
  67. package/lib/schema/external-system.schema.json +42 -0
  68. package/lib/utils/api.js +9 -5
  69. package/lib/utils/app-register-api.js +60 -32
  70. package/lib/utils/app-register-auth.js +172 -47
  71. package/lib/utils/app-register-config.js +130 -59
  72. package/lib/utils/app-run-containers.js +29 -8
  73. package/lib/utils/build-helpers.js +1 -1
  74. package/lib/utils/cli-utils.js +78 -30
  75. package/lib/utils/compose-generator.js +145 -65
  76. package/lib/utils/config-paths.js +2 -0
  77. package/lib/utils/deployment-errors.js +1 -1
  78. package/lib/utils/device-code.js +99 -41
  79. package/lib/utils/env-config-loader.js +1 -1
  80. package/lib/utils/env-copy.js +21 -18
  81. package/lib/utils/env-endpoints.js +115 -67
  82. package/lib/utils/env-map.js +13 -14
  83. package/lib/utils/env-ports.js +45 -25
  84. package/lib/utils/env-template.js +84 -42
  85. package/lib/utils/error-formatter.js +26 -9
  86. package/lib/utils/error-formatters/error-parser.js +90 -4
  87. package/lib/utils/error-formatters/http-status-errors.js +54 -17
  88. package/lib/utils/error-formatters/network-errors.js +103 -26
  89. package/lib/utils/external-system-display.js +184 -90
  90. package/lib/utils/external-system-validators.js +164 -42
  91. package/lib/utils/file-upload.js +109 -0
  92. package/lib/utils/health-check.js +199 -83
  93. package/lib/utils/infra-containers.js +1 -1
  94. package/lib/utils/infra-status.js +66 -15
  95. package/lib/utils/local-secrets.js +45 -25
  96. package/lib/utils/paths.js +45 -33
  97. package/lib/utils/schema-loader.js +42 -25
  98. package/lib/utils/schema-resolver.js +123 -74
  99. package/lib/utils/secrets-encryption.js +62 -25
  100. package/lib/utils/secrets-helpers.js +126 -63
  101. package/lib/utils/secrets-path.js +1 -1
  102. package/lib/utils/secrets-url.js +1 -1
  103. package/lib/utils/token-manager-refresh.js +181 -0
  104. package/lib/utils/token-manager.js +76 -123
  105. package/lib/utils/variable-transformer.js +154 -77
  106. package/lib/utils/yaml-preserve.js +41 -47
  107. package/lib/{template-validator.js → validation/template.js} +54 -23
  108. package/lib/{validate.js → validation/validate.js} +205 -125
  109. package/lib/{validator.js → validation/validator.js} +58 -39
  110. package/package.json +31 -2
  111. package/templates/external-system/deploy.ps1.hbs +34 -0
  112. package/templates/external-system/deploy.sh.hbs +34 -0
  113. package/templates/external-system/external-datasource.json.hbs +31 -12
  114. package/lib/app.js +0 -467
  115. package/lib/datasource-list.js +0 -141
  116. /package/lib/{app-prompts.js → app/prompts.js} +0 -0
  117. /package/lib/{env-reader.js → core/env-reader.js} +0 -0
  118. /package/lib/{key-generator.js → core/key-generator.js} +0 -0
package/README.md CHANGED
@@ -23,7 +23,7 @@ aifabrix down myapp
23
23
  # aifabrix down myapp --volumes
24
24
  ```
25
25
 
26
- → [Full Guide](docs/QUICK-START.md) | [CLI Commands](docs/CLI-REFERENCE.md)
26
+ → [Full Guide](docs/quick-start.md) | [CLI Commands](docs/cli-reference.md)
27
27
 
28
28
  ## What You Get
29
29
 
@@ -48,17 +48,17 @@ aifabrix build miso-controller
48
48
  aifabrix run miso-controller
49
49
  ```
50
50
 
51
- → [Infrastructure Guide](docs/INFRASTRUCTURE.md)
51
+ → [Infrastructure Guide](docs/infrastructure.md)
52
52
 
53
53
  ## Documentation
54
54
 
55
- - [Quick Start](docs/QUICK-START.md) - Get running in 5 minutes
56
- - [Infrastructure](docs/INFRASTRUCTURE.md) - What runs and why
57
- - [Configuration](docs/CONFIGURATION.md) - Config file reference
58
- - [Building](docs/BUILDING.md) - Build process explained
59
- - [Running](docs/RUNNING.md) - Run apps locally
60
- - [Deploying](docs/DEPLOYING.md) - Deploy to Azure
61
- - [CLI Reference](docs/CLI-REFERENCE.md) - All commands
55
+ - [Quick Start](docs/quick-start.md) - Get running in 5 minutes
56
+ - [Infrastructure](docs/infrastructure.md) - What runs and why
57
+ - [Configuration](docs/configuration.md) - Config file reference
58
+ - [Building](docs/building.md) - Build process explained
59
+ - [Running](docs/running.md) - Run apps locally
60
+ - [Deploying](docs/deploying.md) - Deploy to Azure
61
+ - [CLI Reference](docs/cli-reference.md) - All commands
62
62
 
63
63
  ## How It Works
64
64
 
@@ -129,8 +129,8 @@ aifabrix datasource validate hubspot-company --environment dev
129
129
 
130
130
  ## Documentation
131
131
 
132
- - [External Systems Guide](../../docs/EXTERNAL-SYSTEMS.md) - Complete guide with examples
133
- - [CLI Reference](../../docs/CLI-REFERENCE.md) - All commands
132
+ - [External Systems Guide](../../docs/external-systems.md) - Complete guide with examples
133
+ - [CLI Reference](../../docs/cli-reference.md) - All commands
134
134
  - [Configuration Reference](../../docs/CONFIGURATION.md) - Config file details
135
135
 
136
136
 
@@ -3,7 +3,7 @@
3
3
  "displayName": "HubSpot Company",
4
4
  "description": "HubSpot companies datasource with field mappings for CRM company data",
5
5
  "systemKey": "hubspot",
6
- "entityKey": "company",
6
+ "entityType": "company",
7
7
  "resourceType": "customer",
8
8
  "enabled": true,
9
9
  "version": "1.0.0",
@@ -94,72 +94,75 @@
94
94
  "required": ["id", "properties"]
95
95
  },
96
96
  "fieldMappings": {
97
- "accessFields": ["country", "domain"],
98
- "fields": {
97
+ "dimensions": {
98
+ "country": "metadata.country",
99
+ "domain": "metadata.domain"
100
+ },
101
+ "attributes": {
99
102
  "id": {
100
103
  "expression": "{{id}}",
101
104
  "type": "string",
102
105
  "description": "Unique company identifier",
103
- "required": true
106
+ "indexed": true
104
107
  },
105
108
  "name": {
106
109
  "expression": "{{properties.name.value}} | trim",
107
110
  "type": "string",
108
111
  "description": "Company name",
109
- "required": false
112
+ "indexed": false
110
113
  },
111
114
  "domain": {
112
115
  "expression": "{{properties.domain.value}} | toLower | trim",
113
116
  "type": "string",
114
117
  "description": "Company domain for ABAC filtering",
115
- "required": false
118
+ "indexed": false
116
119
  },
117
120
  "country": {
118
121
  "expression": "{{properties.country.value}} | toUpper | trim",
119
122
  "type": "string",
120
123
  "description": "Country code for ABAC filtering",
121
- "required": false
124
+ "indexed": false
122
125
  },
123
126
  "city": {
124
127
  "expression": "{{properties.city.value}} | trim",
125
128
  "type": "string",
126
129
  "description": "City name",
127
- "required": false
130
+ "indexed": false
128
131
  },
129
132
  "industry": {
130
133
  "expression": "{{properties.industry.value}} | trim",
131
134
  "type": "string",
132
135
  "description": "Industry classification",
133
- "required": false
136
+ "indexed": false
134
137
  },
135
138
  "website": {
136
139
  "expression": "{{properties.website.value}} | trim",
137
140
  "type": "string",
138
141
  "description": "Company website URL",
139
- "required": false
142
+ "indexed": false
140
143
  },
141
144
  "phone": {
142
145
  "expression": "{{properties.phone.value}} | trim",
143
146
  "type": "string",
144
147
  "description": "Phone number",
145
- "required": false
148
+ "indexed": false
146
149
  },
147
150
  "createdAt": {
148
151
  "expression": "{{properties.createdate.value}}",
149
152
  "type": "string",
150
153
  "description": "Creation timestamp",
151
- "required": false
154
+ "indexed": false
152
155
  },
153
156
  "updatedAt": {
154
157
  "expression": "{{properties.hs_lastmodifieddate.value}}",
155
158
  "type": "string",
156
159
  "description": "Last modification timestamp",
157
- "required": false
160
+ "indexed": false
158
161
  }
159
162
  }
160
163
  },
161
164
  "exposed": {
162
- "fields": ["id", "name", "domain", "country", "city", "industry", "website", "phone", "createdAt", "updatedAt"],
165
+ "attributes": ["id", "name", "domain", "country", "city", "industry", "website", "phone", "createdAt", "updatedAt"],
163
166
  "description": "Exposed fields for HubSpot companies"
164
167
  },
165
168
  "openapi": {
@@ -3,7 +3,7 @@
3
3
  "displayName": "HubSpot Contact",
4
4
  "description": "HubSpot contacts datasource with field mappings for CRM contact data",
5
5
  "systemKey": "hubspot",
6
- "entityKey": "contact",
6
+ "entityType": "contact",
7
7
  "resourceType": "contact",
8
8
  "enabled": true,
9
9
  "version": "1.0.0",
@@ -110,84 +110,87 @@
110
110
  "required": ["id", "properties"]
111
111
  },
112
112
  "fieldMappings": {
113
- "accessFields": ["email", "country"],
114
- "fields": {
113
+ "dimensions": {
114
+ "email": "metadata.email",
115
+ "country": "metadata.country"
116
+ },
117
+ "attributes": {
115
118
  "id": {
116
119
  "expression": "{{id}}",
117
120
  "type": "string",
118
121
  "description": "Unique contact identifier",
119
- "required": true
122
+ "indexed": true
120
123
  },
121
124
  "firstName": {
122
125
  "expression": "{{properties.firstname.value}} | trim",
123
126
  "type": "string",
124
127
  "description": "First name",
125
- "required": false
128
+ "indexed": false
126
129
  },
127
130
  "lastName": {
128
131
  "expression": "{{properties.lastname.value}} | trim",
129
132
  "type": "string",
130
133
  "description": "Last name",
131
- "required": false
134
+ "indexed": false
132
135
  },
133
136
  "email": {
134
137
  "expression": "{{properties.email.value}} | toLower | trim",
135
138
  "type": "string",
136
139
  "description": "Email address for ABAC filtering",
137
- "required": false
140
+ "indexed": false
138
141
  },
139
142
  "phone": {
140
143
  "expression": "{{properties.phone.value}} | trim",
141
144
  "type": "string",
142
145
  "description": "Phone number",
143
- "required": false
146
+ "indexed": false
144
147
  },
145
148
  "company": {
146
149
  "expression": "{{properties.company.value}} | trim",
147
150
  "type": "string",
148
151
  "description": "Associated company name",
149
- "required": false
152
+ "indexed": false
150
153
  },
151
154
  "jobTitle": {
152
155
  "expression": "{{properties.jobtitle.value}} | trim",
153
156
  "type": "string",
154
157
  "description": "Job title",
155
- "required": false
158
+ "indexed": false
156
159
  },
157
160
  "address": {
158
161
  "expression": "{{properties.address.value}} | trim",
159
162
  "type": "string",
160
163
  "description": "Street address",
161
- "required": false
164
+ "indexed": false
162
165
  },
163
166
  "city": {
164
167
  "expression": "{{properties.city.value}} | trim",
165
168
  "type": "string",
166
169
  "description": "City name",
167
- "required": false
170
+ "indexed": false
168
171
  },
169
172
  "country": {
170
173
  "expression": "{{properties.country.value}} | toUpper | trim",
171
174
  "type": "string",
172
175
  "description": "Country code for ABAC filtering",
173
- "required": false
176
+ "indexed": false
174
177
  },
175
178
  "createdAt": {
176
179
  "expression": "{{properties.createdate.value}}",
177
180
  "type": "string",
178
181
  "description": "Creation timestamp",
179
- "required": false
182
+ "indexed": false
180
183
  },
181
184
  "updatedAt": {
182
185
  "expression": "{{properties.hs_lastmodifieddate.value}}",
183
186
  "type": "string",
184
187
  "description": "Last modification timestamp",
185
- "required": false
188
+ "indexed": false
186
189
  }
187
190
  }
188
191
  },
189
192
  "exposed": {
190
- "fields": ["id", "firstName", "lastName", "email", "phone", "company", "jobTitle", "address", "city", "country", "createdAt", "updatedAt"],
193
+ "attributes": ["id", "firstName", "lastName", "email", "phone", "company", "jobTitle", "address", "city", "country", "createdAt", "updatedAt"],
191
194
  "description": "Exposed fields for HubSpot contacts"
192
195
  },
193
196
  "openapi": {
@@ -3,7 +3,7 @@
3
3
  "displayName": "HubSpot Deal",
4
4
  "description": "HubSpot deals datasource with field mappings for CRM deal data",
5
5
  "systemKey": "hubspot",
6
- "entityKey": "deal",
6
+ "entityType": "deal",
7
7
  "resourceType": "deal",
8
8
  "enabled": true,
9
9
  "version": "1.0.0",
@@ -131,84 +131,87 @@
131
131
  "required": ["id", "properties"]
132
132
  },
133
133
  "fieldMappings": {
134
- "accessFields": ["stage", "pipeline"],
135
- "fields": {
134
+ "dimensions": {
135
+ "stage": "metadata.stage",
136
+ "pipeline": "metadata.pipeline"
137
+ },
138
+ "attributes": {
136
139
  "id": {
137
140
  "expression": "{{id}}",
138
141
  "type": "string",
139
142
  "description": "Unique deal identifier",
140
- "required": true
143
+ "indexed": true
141
144
  },
142
145
  "dealName": {
143
146
  "expression": "{{properties.dealname.value}} | trim",
144
147
  "type": "string",
145
148
  "description": "Deal name",
146
- "required": false
149
+ "indexed": false
147
150
  },
148
151
  "amount": {
149
152
  "expression": "{{properties.amount.value}}",
150
153
  "type": "string",
151
154
  "description": "Deal amount",
152
- "required": false
155
+ "indexed": false
153
156
  },
154
157
  "currency": {
155
158
  "expression": "{{properties.deal_currency_code.value}} | toUpper | trim",
156
159
  "type": "string",
157
160
  "description": "Currency code",
158
- "required": false
161
+ "indexed": false
159
162
  },
160
163
  "stage": {
161
164
  "expression": "{{properties.dealstage.value}} | trim",
162
165
  "type": "string",
163
166
  "description": "Deal stage for ABAC filtering",
164
- "required": false
167
+ "indexed": false
165
168
  },
166
169
  "pipeline": {
167
170
  "expression": "{{properties.pipeline.value}} | trim",
168
171
  "type": "string",
169
172
  "description": "Pipeline name for ABAC filtering",
170
- "required": false
173
+ "indexed": false
171
174
  },
172
175
  "closeDate": {
173
176
  "expression": "{{properties.closedate.value}}",
174
177
  "type": "string",
175
178
  "description": "Expected close date",
176
- "required": false
179
+ "indexed": false
177
180
  },
178
181
  "dealType": {
179
182
  "expression": "{{properties.dealtype.value}} | trim",
180
183
  "type": "string",
181
184
  "description": "Deal type",
182
- "required": false
185
+ "indexed": false
183
186
  },
184
187
  "associatedCompany": {
185
- "expression": "{{associations.companies.results[0].id}}",
188
+ "expression": "record_ref:customer",
186
189
  "type": "string",
187
- "description": "Associated company ID",
188
- "required": false
190
+ "description": "Associated company reference (record reference)",
191
+ "indexed": false
189
192
  },
190
193
  "associatedContacts": {
191
194
  "expression": "{{associations.contacts.results}}",
192
195
  "type": "array",
193
196
  "description": "Array of associated contact IDs",
194
- "required": false
197
+ "indexed": false
195
198
  },
196
199
  "createdAt": {
197
200
  "expression": "{{properties.createdate.value}}",
198
201
  "type": "string",
199
202
  "description": "Creation timestamp",
200
- "required": false
203
+ "indexed": false
201
204
  },
202
205
  "updatedAt": {
203
206
  "expression": "{{properties.hs_lastmodifieddate.value}}",
204
207
  "type": "string",
205
208
  "description": "Last modification timestamp",
206
- "required": false
209
+ "indexed": false
207
210
  }
208
211
  }
209
212
  },
210
213
  "exposed": {
211
- "fields": ["id", "dealName", "amount", "currency", "stage", "pipeline", "closeDate", "dealType", "associatedCompany", "associatedContacts", "createdAt", "updatedAt"],
214
+ "attributes": ["id", "dealName", "amount", "currency", "stage", "pipeline", "closeDate", "dealType", "associatedCompany", "associatedContacts", "createdAt", "updatedAt"],
212
215
  "description": "Exposed fields for HubSpot deals"
213
216
  },
214
217
  "openapi": {
@@ -14,8 +14,9 @@
14
14
  * @property {string} displayName - Display name
15
15
  * @property {string|null} description - Datasource description
16
16
  * @property {string} externalSystemId - External system ID
17
- * @property {string} resourceType - Resource type
18
- * @property {Object} fieldMappings - Field mappings configuration
17
+ * @property {string} resourceType - Resource type (pattern: ^[a-z0-9-]+$, e.g., "customer", "contact", "deal")
18
+ * @property {string} entityType - Entity type (pattern: ^[a-z0-9-]+$)
19
+ * @property {FieldMappings} fieldMappings - Field mappings configuration with dimensions and attributes
19
20
  * @property {string} status - Status ('draft' | 'published' | 'archived')
20
21
  * @property {boolean} isActive - Whether datasource is active
21
22
  * @property {string} createdAt - Creation timestamp (ISO 8601)
@@ -29,8 +30,9 @@
29
30
  * @property {string} displayName - Display name
30
31
  * @property {string} [description] - Description
31
32
  * @property {string} externalSystemId - External system ID
32
- * @property {string} resourceType - Resource type
33
- * @property {Object} [fieldMappings] - Field mappings
33
+ * @property {string} resourceType - Resource type (pattern: ^[a-z0-9-]+$)
34
+ * @property {string} entityType - Entity type (pattern: ^[a-z0-9-]+$)
35
+ * @property {FieldMappings} [fieldMappings] - Field mappings with dimensions and attributes
34
36
  * @property {Object} [configuration] - Configuration
35
37
  */
36
38
 
@@ -39,7 +41,7 @@
39
41
  * @typedef {Object} ExternalDataSourceUpdate
40
42
  * @property {string} [displayName] - Display name
41
43
  * @property {string} [description] - Description
42
- * @property {Object} [fieldMappings] - Field mappings
44
+ * @property {FieldMappings} [fieldMappings] - Field mappings with dimensions and attributes
43
45
  * @property {Object} [configuration] - Configuration
44
46
  * @property {boolean} [isActive] - Active status
45
47
  */
@@ -138,6 +140,30 @@
138
140
  /** @typedef {Object} ListExecutionLogsResponse @property {CIPExecutionLogResponse[]} items @property {Object} meta @property {Object} links */
139
141
  /** @typedef {Object} GetExecutionLogResponse @property {CIPExecutionLogResponse} data */
140
142
 
143
+ /**
144
+ * Field mappings with dimensions-first model
145
+ * @typedef {Object} FieldMappings
146
+ * @property {Object<string, string>} dimensions - Dimension keys mapped to attribute paths (e.g., {"country": "metadata.country", "department": "metadata.department"})
147
+ * @property {Object<string, AttributeDefinition>} attributes - Attribute definitions with transformation expressions
148
+ */
149
+
150
+ /**
151
+ * Attribute definition
152
+ * @typedef {Object} AttributeDefinition
153
+ * @property {string} expression - Transformation expression (e.g., "{{properties.id}}" or "record_ref:customer")
154
+ * @property {string} type - Data type (e.g., "string", "number", "boolean")
155
+ * @property {boolean} [indexed] - Whether to create database index (default: false)
156
+ * @property {string} [description] - Attribute description
157
+ * @property {boolean} [required] - Whether attribute is required
158
+ */
159
+
160
+ /**
161
+ * Record reference mapping (Plan 211)
162
+ * @typedef {Object} RecordReferenceMapping
163
+ * @property {string} expression - Expression with record_ref: prefix (e.g., "record_ref:customer")
164
+ * @property {string} type - Always "string" for record references
165
+ */
166
+
141
167
  /**
142
168
  * Bulk operation request
143
169
  * @typedef {Object} BulkOperationRequest
@@ -0,0 +1,142 @@
1
+ /**
2
+ * @fileoverview Wizard API type definitions
3
+ * @author AI Fabrix Team
4
+ * @version 2.0.0
5
+ */
6
+
7
+ /**
8
+ * Wizard mode selection request
9
+ * @typedef {Object} WizardModeSelectionRequest
10
+ * @property {string} mode - Wizard mode ('create-system' | 'add-datasource')
11
+ */
12
+
13
+ /**
14
+ * Wizard mode selection response
15
+ * @typedef {Object} WizardModeSelectionResponse
16
+ * @property {boolean} success - Request success flag
17
+ * @property {Object} data - Mode selection data
18
+ * @property {string} data.mode - Selected mode
19
+ * @property {string} timestamp - Response timestamp (ISO 8601)
20
+ */
21
+
22
+ /**
23
+ * Wizard source selection request
24
+ * @typedef {Object} WizardSourceSelectionRequest
25
+ * @property {string} sourceType - Source type ('openapi-file' | 'openapi-url' | 'mcp-server' | 'known-platform')
26
+ * @property {string} [sourceData] - Source data (file path, URL, etc.)
27
+ */
28
+
29
+ /**
30
+ * Wizard source selection response
31
+ * @typedef {Object} WizardSourceSelectionResponse
32
+ * @property {boolean} success - Request success flag
33
+ * @property {Object} data - Source selection data
34
+ * @property {string} data.sourceType - Selected source type
35
+ * @property {string} timestamp - Response timestamp (ISO 8601)
36
+ */
37
+
38
+ /**
39
+ * Wizard parse OpenAPI response
40
+ * @typedef {Object} WizardParseOpenApiResponse
41
+ * @property {boolean} success - Request success flag
42
+ * @property {Object} data - Parsed OpenAPI data
43
+ * @property {Object} data.spec - Parsed OpenAPI specification
44
+ * @property {string} data.version - OpenAPI version
45
+ * @property {string} timestamp - Response timestamp (ISO 8601)
46
+ */
47
+
48
+ /**
49
+ * Wizard detect type request
50
+ * @typedef {Object} WizardDetectTypeRequest
51
+ * @property {Object} openApiSpec - OpenAPI specification object
52
+ */
53
+
54
+ /**
55
+ * Wizard detect type response
56
+ * @typedef {Object} WizardDetectTypeResponse
57
+ * @property {boolean} success - Request success flag
58
+ * @property {Object} data - Type detection data
59
+ * @property {string} data.apiType - Detected API type (e.g., 'rest', 'graphql', 'rpc')
60
+ * @property {string} data.category - API category (e.g., 'crm', 'support', 'sales')
61
+ * @property {Object} data.confidence - Confidence scores for detection
62
+ * @property {string} timestamp - Response timestamp (ISO 8601)
63
+ */
64
+
65
+ /**
66
+ * Wizard generate config request
67
+ * @typedef {Object} WizardGenerateConfigRequest
68
+ * @property {string} mode - Wizard mode
69
+ * @property {string} sourceType - Source type
70
+ * @property {Object} [openApiSpec] - OpenAPI specification (if applicable)
71
+ * @property {string} [userIntent] - User intent (e.g., 'sales-focused', 'support-focused')
72
+ * @property {Object} [preferences] - User preferences
73
+ * @property {boolean} [preferences.mcp] - Enable MCP
74
+ * @property {boolean} [preferences.abac] - Enable ABAC
75
+ * @property {boolean} [preferences.rbac] - Enable RBAC
76
+ */
77
+
78
+ /**
79
+ * Wizard generate config response
80
+ * @typedef {Object} WizardGenerateConfigResponse
81
+ * @property {boolean} success - Request success flag
82
+ * @property {Object} data - Generated configuration data
83
+ * @property {Object} data.systemConfig - External system configuration
84
+ * @property {Object[]} data.datasourceConfigs - Array of datasource configurations
85
+ * @property {string} data.systemKey - Generated system key
86
+ * @property {string} timestamp - Response timestamp (ISO 8601)
87
+ */
88
+
89
+ /**
90
+ * Wizard validate request
91
+ * @typedef {Object} WizardValidateRequest
92
+ * @property {Object} systemConfig - System configuration to validate
93
+ * @property {Object[]} datasourceConfigs - Array of datasource configurations to validate
94
+ */
95
+
96
+ /**
97
+ * Wizard validate response
98
+ * @typedef {Object} WizardValidateResponse
99
+ * @property {boolean} success - Request success flag
100
+ * @property {Object} data - Validation data
101
+ * @property {boolean} data.valid - Whether configuration is valid
102
+ * @property {Object[]} [data.errors] - Array of validation errors (if invalid)
103
+ * @property {Object[]} [data.warnings] - Array of validation warnings
104
+ * @property {string} timestamp - Response timestamp (ISO 8601)
105
+ */
106
+
107
+ /**
108
+ * Wizard test MCP connection request
109
+ * @typedef {Object} WizardTestMcpConnectionRequest
110
+ * @property {string} serverUrl - MCP server URL
111
+ * @property {string} token - MCP server authentication token
112
+ */
113
+
114
+ /**
115
+ * Wizard test MCP connection response
116
+ * @typedef {Object} WizardTestMcpConnectionResponse
117
+ * @property {boolean} success - Request success flag
118
+ * @property {Object} data - Connection test data
119
+ * @property {boolean} data.connected - Whether connection was successful
120
+ * @property {string} [data.error] - Error message (if connection failed)
121
+ * @property {string} timestamp - Response timestamp (ISO 8601)
122
+ */
123
+
124
+ /**
125
+ * Deployment docs request
126
+ * @typedef {Object} DeploymentDocsRequest
127
+ * @property {string} systemKey - System key identifier
128
+ */
129
+
130
+ /**
131
+ * Deployment docs response
132
+ * @typedef {Object} DeploymentDocsResponse
133
+ * @property {boolean} success - Request success flag
134
+ * @property {Object} data - Deployment documentation data
135
+ * @property {string} data.systemKey - System key identifier
136
+ * @property {string} data.content - README.md content (markdown)
137
+ * @property {string} data.contentType - Content type (e.g., 'text/markdown')
138
+ * @property {string} timestamp - Response timestamp (ISO 8601)
139
+ */
140
+
141
+ module.exports = {};
142
+