@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
@@ -128,7 +128,10 @@
128
128
  }
129
129
  }
130
130
  },
131
- "required": ["id", "properties"]
131
+ "required": [
132
+ "id",
133
+ "properties"
134
+ ]
132
135
  },
133
136
  "fieldMappings": {
134
137
  "dimensions": {
@@ -208,10 +211,345 @@
208
211
  "description": "Last modification timestamp",
209
212
  "indexed": false
210
213
  }
214
+ },
215
+ "compiledAttributes": {
216
+ "id": {
217
+ "raw_path": [
218
+ "id"
219
+ ],
220
+ "functions": [],
221
+ "type": "string",
222
+ "required": false,
223
+ "description": "Unique deal identifier",
224
+ "indexed": true
225
+ },
226
+ "dealName": {
227
+ "raw_path": [
228
+ "properties",
229
+ "dealname",
230
+ "value"
231
+ ],
232
+ "functions": [
233
+ {
234
+ "name": "trim",
235
+ "args": []
236
+ }
237
+ ],
238
+ "type": "string",
239
+ "required": false,
240
+ "description": "Deal name",
241
+ "indexed": false
242
+ },
243
+ "amount": {
244
+ "raw_path": [
245
+ "properties",
246
+ "amount",
247
+ "value"
248
+ ],
249
+ "functions": [],
250
+ "type": "string",
251
+ "required": false,
252
+ "description": "Deal amount",
253
+ "indexed": false
254
+ },
255
+ "currency": {
256
+ "raw_path": [
257
+ "properties",
258
+ "deal_currency_code",
259
+ "value"
260
+ ],
261
+ "functions": [
262
+ {
263
+ "name": "toUpper",
264
+ "args": []
265
+ },
266
+ {
267
+ "name": "trim",
268
+ "args": []
269
+ }
270
+ ],
271
+ "type": "string",
272
+ "required": false,
273
+ "description": "Currency code",
274
+ "indexed": false
275
+ },
276
+ "stage": {
277
+ "raw_path": [
278
+ "properties",
279
+ "dealstage",
280
+ "value"
281
+ ],
282
+ "functions": [
283
+ {
284
+ "name": "trim",
285
+ "args": []
286
+ }
287
+ ],
288
+ "type": "string",
289
+ "required": false,
290
+ "description": "Deal stage for ABAC filtering",
291
+ "indexed": false
292
+ },
293
+ "pipeline": {
294
+ "raw_path": [
295
+ "properties",
296
+ "pipeline",
297
+ "value"
298
+ ],
299
+ "functions": [
300
+ {
301
+ "name": "trim",
302
+ "args": []
303
+ }
304
+ ],
305
+ "type": "string",
306
+ "required": false,
307
+ "description": "Pipeline name for ABAC filtering",
308
+ "indexed": false
309
+ },
310
+ "closeDate": {
311
+ "raw_path": [
312
+ "properties",
313
+ "closedate",
314
+ "value"
315
+ ],
316
+ "functions": [],
317
+ "type": "string",
318
+ "required": false,
319
+ "description": "Expected close date",
320
+ "indexed": false
321
+ },
322
+ "dealType": {
323
+ "raw_path": [
324
+ "properties",
325
+ "dealtype",
326
+ "value"
327
+ ],
328
+ "functions": [
329
+ {
330
+ "name": "trim",
331
+ "args": []
332
+ }
333
+ ],
334
+ "type": "string",
335
+ "required": false,
336
+ "description": "Deal type",
337
+ "indexed": false
338
+ },
339
+ "associatedContacts": {
340
+ "raw_path": [
341
+ "associations",
342
+ "contacts",
343
+ "results"
344
+ ],
345
+ "functions": [],
346
+ "type": "array",
347
+ "required": false,
348
+ "description": "Array of associated contact IDs",
349
+ "indexed": false
350
+ },
351
+ "createdAt": {
352
+ "raw_path": [
353
+ "properties",
354
+ "createdate",
355
+ "value"
356
+ ],
357
+ "functions": [],
358
+ "type": "string",
359
+ "required": false,
360
+ "description": "Creation timestamp",
361
+ "indexed": false
362
+ },
363
+ "updatedAt": {
364
+ "raw_path": [
365
+ "properties",
366
+ "hs_lastmodifieddate",
367
+ "value"
368
+ ],
369
+ "functions": [],
370
+ "type": "string",
371
+ "required": false,
372
+ "description": "Last modification timestamp",
373
+ "indexed": false
374
+ }
375
+ },
376
+ "compiledFields": {
377
+ "id": {
378
+ "raw_path": [
379
+ "id"
380
+ ],
381
+ "functions": [],
382
+ "type": "string",
383
+ "required": false,
384
+ "description": "Unique deal identifier",
385
+ "indexed": true
386
+ },
387
+ "dealName": {
388
+ "raw_path": [
389
+ "properties",
390
+ "dealname",
391
+ "value"
392
+ ],
393
+ "functions": [
394
+ {
395
+ "name": "trim",
396
+ "args": []
397
+ }
398
+ ],
399
+ "type": "string",
400
+ "required": false,
401
+ "description": "Deal name",
402
+ "indexed": false
403
+ },
404
+ "amount": {
405
+ "raw_path": [
406
+ "properties",
407
+ "amount",
408
+ "value"
409
+ ],
410
+ "functions": [],
411
+ "type": "string",
412
+ "required": false,
413
+ "description": "Deal amount",
414
+ "indexed": false
415
+ },
416
+ "currency": {
417
+ "raw_path": [
418
+ "properties",
419
+ "deal_currency_code",
420
+ "value"
421
+ ],
422
+ "functions": [
423
+ {
424
+ "name": "toUpper",
425
+ "args": []
426
+ },
427
+ {
428
+ "name": "trim",
429
+ "args": []
430
+ }
431
+ ],
432
+ "type": "string",
433
+ "required": false,
434
+ "description": "Currency code",
435
+ "indexed": false
436
+ },
437
+ "stage": {
438
+ "raw_path": [
439
+ "properties",
440
+ "dealstage",
441
+ "value"
442
+ ],
443
+ "functions": [
444
+ {
445
+ "name": "trim",
446
+ "args": []
447
+ }
448
+ ],
449
+ "type": "string",
450
+ "required": false,
451
+ "description": "Deal stage for ABAC filtering",
452
+ "indexed": false
453
+ },
454
+ "pipeline": {
455
+ "raw_path": [
456
+ "properties",
457
+ "pipeline",
458
+ "value"
459
+ ],
460
+ "functions": [
461
+ {
462
+ "name": "trim",
463
+ "args": []
464
+ }
465
+ ],
466
+ "type": "string",
467
+ "required": false,
468
+ "description": "Pipeline name for ABAC filtering",
469
+ "indexed": false
470
+ },
471
+ "closeDate": {
472
+ "raw_path": [
473
+ "properties",
474
+ "closedate",
475
+ "value"
476
+ ],
477
+ "functions": [],
478
+ "type": "string",
479
+ "required": false,
480
+ "description": "Expected close date",
481
+ "indexed": false
482
+ },
483
+ "dealType": {
484
+ "raw_path": [
485
+ "properties",
486
+ "dealtype",
487
+ "value"
488
+ ],
489
+ "functions": [
490
+ {
491
+ "name": "trim",
492
+ "args": []
493
+ }
494
+ ],
495
+ "type": "string",
496
+ "required": false,
497
+ "description": "Deal type",
498
+ "indexed": false
499
+ },
500
+ "associatedContacts": {
501
+ "raw_path": [
502
+ "associations",
503
+ "contacts",
504
+ "results"
505
+ ],
506
+ "functions": [],
507
+ "type": "array",
508
+ "required": false,
509
+ "description": "Array of associated contact IDs",
510
+ "indexed": false
511
+ },
512
+ "createdAt": {
513
+ "raw_path": [
514
+ "properties",
515
+ "createdate",
516
+ "value"
517
+ ],
518
+ "functions": [],
519
+ "type": "string",
520
+ "required": false,
521
+ "description": "Creation timestamp",
522
+ "indexed": false
523
+ },
524
+ "updatedAt": {
525
+ "raw_path": [
526
+ "properties",
527
+ "hs_lastmodifieddate",
528
+ "value"
529
+ ],
530
+ "functions": [],
531
+ "type": "string",
532
+ "required": false,
533
+ "description": "Last modification timestamp",
534
+ "indexed": false
535
+ }
211
536
  }
212
537
  },
213
538
  "exposed": {
214
- "attributes": ["id", "dealName", "amount", "currency", "stage", "pipeline", "closeDate", "dealType", "associatedCompany", "associatedContacts", "createdAt", "updatedAt"],
539
+ "attributes": [
540
+ "id",
541
+ "dealName",
542
+ "amount",
543
+ "currency",
544
+ "stage",
545
+ "pipeline",
546
+ "closeDate",
547
+ "dealType",
548
+ "associatedCompany",
549
+ "associatedContacts",
550
+ "createdAt",
551
+ "updatedAt"
552
+ ],
215
553
  "description": "Exposed fields for HubSpot deals"
216
554
  },
217
555
  "openapi": {
@@ -247,5 +585,4 @@
247
585
  },
248
586
  "autoRbac": true
249
587
  }
250
- }
251
-
588
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "key": "hubspot-users-datasource",
3
+ "displayName": "HubSpot Users",
4
+ "resourceType": "person",
5
+ "systemKey": "hubspot",
6
+ "enabled": true,
7
+ "entityType": "recordStorage",
8
+ "description": "Comprehensive HubSpot users datasource with full CRUD operations, comprehensive metadata schema, ABAC dimensions, and OpenAPI support",
9
+ "metadataSchema": {
10
+ "type": "object",
11
+ "properties": {
12
+ "id": {
13
+ "type": "string",
14
+ "description": "HubSpot user ID"
15
+ },
16
+ "properties": {
17
+ "type": "object",
18
+ "description": "User properties object containing all CRM fields",
19
+ "additionalProperties": true,
20
+ "properties": {
21
+ "email": {
22
+ "type": "string",
23
+ "format": "email",
24
+ "description": "User email address"
25
+ },
26
+ "firstName": {
27
+ "type": "string",
28
+ "description": "User first name"
29
+ },
30
+ "lastName": {
31
+ "type": "string",
32
+ "description": "User last name"
33
+ },
34
+ "role": {
35
+ "type": "string",
36
+ "description": "User role"
37
+ },
38
+ "timezone": {
39
+ "type": "string",
40
+ "description": "User timezone"
41
+ }
42
+ }
43
+ },
44
+ "createdAt": {
45
+ "type": "string",
46
+ "format": "date-time",
47
+ "description": "User creation timestamp"
48
+ },
49
+ "updatedAt": {
50
+ "type": "string",
51
+ "format": "date-time",
52
+ "description": "User last update timestamp"
53
+ },
54
+ "archived": {
55
+ "type": "boolean",
56
+ "description": "Whether the user is archived"
57
+ },
58
+ "archivedAt": {
59
+ "type": "string",
60
+ "format": "date-time",
61
+ "description": "User archive timestamp"
62
+ },
63
+ "associations": {
64
+ "type": "object",
65
+ "description": "Associated records",
66
+ "additionalProperties": true
67
+ },
68
+ "url": {
69
+ "type": "string",
70
+ "format": "uri",
71
+ "description": "HubSpot object URL"
72
+ },
73
+ "objectWriteTraceId": {
74
+ "type": "string",
75
+ "description": "Trace ID for tracking writes"
76
+ },
77
+ "propertiesWithHistory": {
78
+ "type": "object",
79
+ "description": "Properties with change history",
80
+ "additionalProperties": true
81
+ }
82
+ },
83
+ "required": [
84
+ "id"
85
+ ]
86
+ },
87
+ "fieldMappings": {
88
+ "attributes": {
89
+ "id": {
90
+ "expression": "{{id}}",
91
+ "type": "string",
92
+ "indexed": true
93
+ },
94
+ "department": {
95
+ "expression": "{{id}}",
96
+ "type": "string",
97
+ "indexed": true,
98
+ "description": "Default dimension for catalog compatibility"
99
+ }
100
+ },
101
+ "dimensions": {
102
+ "department": "metadata.department"
103
+ }
104
+ },
105
+ "sync": {
106
+ "mode": "pull",
107
+ "schedule": "0 */6 * * *",
108
+ "batchSize": 100,
109
+ "maxParallelRequests": 5,
110
+ "pagination": {
111
+ "strategy": "cursor",
112
+ "cursorField": "$.paging.next.after",
113
+ "cursorParam": "after"
114
+ }
115
+ }
116
+ }