@aifabrix/builder 2.42.1 → 2.43.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 (117) hide show
  1. package/README.md +1 -1
  2. package/bin/aifabrix.js +1 -1
  3. package/integration/hubspot-test/README.md +126 -0
  4. package/integration/{hubspot → hubspot-test}/application.json +6 -6
  5. package/integration/{hubspot → hubspot-test}/create-hubspot.js +5 -5
  6. package/integration/hubspot-test/env.template +4 -0
  7. package/integration/{hubspot/hubspot-datasource-company.json → hubspot-test/hubspot-test-datasource-company.json} +3 -2
  8. package/integration/{hubspot/hubspot-datasource-contact.json → hubspot-test/hubspot-test-datasource-contact.json} +3 -2
  9. package/integration/{hubspot/hubspot-datasource-deal.json → hubspot-test/hubspot-test-datasource-deal.json} +3 -2
  10. package/integration/{hubspot/hubspot-datasource-users.json → hubspot-test/hubspot-test-datasource-users.json} +3 -2
  11. package/integration/{hubspot/hubspot-deploy.json → hubspot-test/hubspot-test-deploy.json} +198 -21
  12. package/integration/{hubspot/hubspot-system.json → hubspot-test/hubspot-test-system.json} +8 -7
  13. package/integration/hubspot-test/rbac.json +166 -0
  14. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-hubspot-credential-real.yaml +3 -3
  15. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-hubspot-env-vars.yaml +2 -2
  16. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-add-datasource.yaml +1 -1
  17. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-credential-create.yaml +1 -1
  18. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-credential-select.yaml +1 -1
  19. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-known-platform.yaml +1 -1
  20. package/integration/hubspot-test/test-artifacts/wizard-invalid-missing-source.yaml +2 -0
  21. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-mode.yaml +1 -1
  22. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-openapi-file.yaml +1 -1
  23. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-openapi-url.yaml +1 -1
  24. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-source.yaml +1 -1
  25. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-valid-for-dimension-array-test.yaml +1 -1
  26. package/integration/hubspot-test/test-artifacts/wizard-valid-for-dimension-key-test.yaml +5 -0
  27. package/integration/hubspot-test/test-artifacts/wizard-valid-for-dimension-path-test.yaml +5 -0
  28. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-valid-for-dimension-test.yaml +1 -1
  29. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-valid-for-rbac-test.yaml +1 -1
  30. package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-valid-for-rbac-yaml-test.yaml +1 -1
  31. package/integration/{hubspot → hubspot-test}/test.js +102 -59
  32. package/integration/{hubspot → hubspot-test}/wizard-hubspot-e2e.yaml +2 -2
  33. package/integration/{hubspot → hubspot-test}/wizard-hubspot-platform.yaml +1 -1
  34. package/lib/api/external-test.api.js +1 -1
  35. package/lib/api/service-users.api.js +111 -2
  36. package/lib/api/types/service-users.types.js +41 -0
  37. package/lib/app/register.js +3 -1
  38. package/lib/app/rotate-secret.js +3 -0
  39. package/lib/cli/setup-app.js +2 -2
  40. package/lib/cli/setup-auth.js +19 -11
  41. package/lib/cli/setup-dev.js +62 -32
  42. package/lib/cli/setup-environment.js +6 -21
  43. package/lib/cli/setup-infra.js +13 -0
  44. package/lib/cli/setup-secrets.js +45 -6
  45. package/lib/cli/setup-service-user.js +146 -20
  46. package/lib/cli/setup-utility.js +12 -0
  47. package/lib/commands/auth-config.js +4 -8
  48. package/lib/commands/datasource.js +46 -1
  49. package/lib/commands/dev-init.js +1 -1
  50. package/lib/commands/repair-env-template.js +14 -8
  51. package/lib/commands/repair-rbac.js +25 -19
  52. package/lib/commands/repair.js +96 -30
  53. package/lib/commands/secrets-remove.js +1 -1
  54. package/lib/commands/secrets-validate.js +17 -4
  55. package/lib/commands/service-user.js +231 -2
  56. package/lib/commands/up-common.js +25 -0
  57. package/lib/commands/up-dataplane.js +2 -2
  58. package/lib/core/admin-secrets.js +2 -0
  59. package/lib/core/config.js +7 -5
  60. package/lib/core/ensure-encryption-key.js +1 -3
  61. package/lib/core/secrets.js +32 -9
  62. package/lib/core/templates.js +1 -1
  63. package/lib/datasource/abac-validator.js +157 -0
  64. package/lib/datasource/field-reference-validator.js +74 -36
  65. package/lib/datasource/log-viewer.js +221 -0
  66. package/lib/datasource/resolve-app.js +109 -0
  67. package/lib/datasource/test-e2e.js +11 -20
  68. package/lib/datasource/test-integration.js +42 -22
  69. package/lib/datasource/validate.js +5 -2
  70. package/lib/external-system/generator.js +12 -8
  71. package/lib/external-system/test-system-level.js +1 -1
  72. package/lib/generator/external-controller-manifest.js +3 -3
  73. package/lib/generator/external.js +7 -7
  74. package/lib/generator/helpers.js +13 -9
  75. package/lib/generator/index.js +4 -4
  76. package/lib/generator/split.js +45 -10
  77. package/lib/generator/wizard.js +9 -6
  78. package/lib/infrastructure/helpers.js +50 -35
  79. package/lib/infrastructure/index.js +39 -23
  80. package/lib/schema/env-config.yaml +19 -2
  81. package/lib/schema/external-datasource.schema.json +11 -1
  82. package/lib/utils/app-config-resolver.js +23 -1
  83. package/lib/utils/config-paths.js +48 -4
  84. package/lib/utils/credential-secrets-env.js +16 -1
  85. package/lib/utils/env-map.js +7 -3
  86. package/lib/utils/error-formatter.js +37 -0
  87. package/lib/utils/external-env-template.js +180 -0
  88. package/lib/utils/external-system-display.js +43 -0
  89. package/lib/utils/external-system-validators.js +2 -2
  90. package/lib/utils/help-builder.js +3 -5
  91. package/lib/utils/local-secrets.js +26 -3
  92. package/lib/utils/paths.js +2 -1
  93. package/lib/utils/secrets-generator.js +2 -2
  94. package/lib/utils/secrets-utils.js +4 -0
  95. package/lib/utils/secure-file-permissions.js +91 -0
  96. package/lib/utils/token-manager.js +36 -3
  97. package/lib/utils/yaml-preserve.js +59 -1
  98. package/lib/validation/env-template-auth.js +50 -2
  99. package/lib/validation/external-manifest-validator.js +8 -0
  100. package/lib/validation/validate.js +8 -0
  101. package/lib/validation/validator.js +10 -13
  102. package/package.json +5 -1
  103. package/templates/applications/dataplane/env.template +5 -1
  104. package/templates/applications/miso-controller/application.yaml +1 -1
  105. package/templates/applications/miso-controller/env.template +13 -2
  106. package/templates/external-system/env.template.hbs +22 -0
  107. package/integration/hubspot/README.md +0 -102
  108. package/integration/hubspot/env.template +0 -4
  109. package/integration/hubspot/test-artifacts/wizard-invalid-missing-source.yaml +0 -2
  110. package/integration/hubspot/test-artifacts/wizard-valid-for-dimension-key-test.yaml +0 -5
  111. package/integration/hubspot/test-artifacts/wizard-valid-for-dimension-path-test.yaml +0 -5
  112. /package/integration/{hubspot → hubspot-test}/companies.json +0 -0
  113. /package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-app-name.yaml +0 -0
  114. /package/integration/{hubspot → hubspot-test}/test-artifacts/wizard-invalid-missing-app.yaml +0 -0
  115. /package/integration/{hubspot → hubspot-test}/test-dataplane-down-helpers.js +0 -0
  116. /package/integration/{hubspot → hubspot-test}/test-dataplane-down-tests.js +0 -0
  117. /package/integration/{hubspot → hubspot-test}/test-dataplane-down.js +0 -0
@@ -1,102 +0,0 @@
1
- # HubSpot CRM
2
-
3
- HubSpot CRM integration with OpenAPI support for companies, contacts, and deals
4
-
5
- ## System Information
6
-
7
- - **System Key**: `hubspot`
8
- - **System Type**: `openapi`
9
- - **Datasources**: 4
10
-
11
- ## Files
12
-
13
- - `application.yaml` – Application configuration with `app` and `externalIntegration` blocks
14
- - `hubspot-system.yaml` – External system definition (authentication, OpenAPI/MCP, RBAC)
15
- - `hubspot-datasource-deal.yaml` – Datasource: HubSpot Deal
16
- - `hubspot-datasource-contact.yaml` – Datasource: HubSpot Contact
17
- - `hubspot-datasource-users-datasource.yaml` – Datasource: HubSpot Users
18
- - `hubspot-datasource-company.yaml` – Datasource: HubSpot Company
19
- - `env.template` – Environment variables template (secrets, API keys)
20
- - `hubspot-deploy.json` – Deployment manifest (generated by `aifabrix json`)
21
-
22
- Optional: `rbac.yaml` – Roles and permissions merged into the system when present.
23
-
24
- ## Quick Start
25
-
26
- ### 1. Create External System
27
-
28
- ```bash
29
- aifabrix create hubspot
30
- ```
31
-
32
- (External is the default type. Use `aifabrix create <name> --type webapp` for a builder app.)
33
-
34
- Or use the interactive wizard:
35
-
36
- ```bash
37
- aifabrix wizard --app hubspot
38
- ```
39
-
40
- ### 2. Configure Authentication and Datasources
41
-
42
- Edit files in `integration/hubspot/`:
43
-
44
- - **Authentication**: `hubspot-system.yaml` (auth type, credentials placeholders)
45
- - **Field mappings**: `hubspot-datasource-*.yaml` (dimensions, attributes, operations)
46
-
47
- ### 3. Validate Configuration
48
-
49
- ```bash
50
- aifabrix validate hubspot --type external
51
- ```
52
-
53
- ### 4. Generate Deployment Manifest
54
-
55
- ```bash
56
- aifabrix json hubspot --type external
57
- ```
58
-
59
- This creates `hubspot-deploy.json` in `integration/hubspot/`.
60
-
61
- ### 5. Deploy
62
-
63
- Controller URL and environment are read from config. Configure and log in first:
64
-
65
- ```bash
66
- aifabrix auth config --set-controller <url> --set-environment dev
67
- aifabrix login
68
- ```
69
-
70
- Then deploy:
71
-
72
- ```bash
73
- aifabrix deploy hubspot
74
- ```
75
-
76
- ## Testing
77
-
78
- ### Unit Tests (Local Validation, No API)
79
-
80
- ```bash
81
- aifabrix test hubspot
82
- ```
83
-
84
- ### Integration Tests (Via Dataplane)
85
-
86
- ```bash
87
- aifabrix test-integration hubspot
88
- ```
89
-
90
- ## Deployment
91
-
92
- Deploy via miso-controller pipeline (same as regular apps). Auth and controller come from `aifabrix login` and `aifabrix auth config`:
93
-
94
- ```bash
95
- aifabrix deploy hubspot
96
- ```
97
-
98
- ## Troubleshooting
99
-
100
- - **Validation errors**: Run `aifabrix validate hubspot --type external` to see schema and manifest errors.
101
- - **Deployment / auth**: Run `aifabrix auth config --set-controller <url> --set-environment <env>` and `aifabrix login` before `aifabrix deploy`.
102
- - **File not found**: Run commands from the project root (where `package.json` and `integration/` live).
@@ -1,4 +0,0 @@
1
- HUBSPOT_API_VERSION=v3
2
- MAX_PAGE_SIZE=100
3
- KV_HUBSPOT_CLIENTID=kv://hubspot/clientid
4
- KV_HUBSPOT_CLIENTSECRET=kv://hubspot/clientsecret
@@ -1,2 +0,0 @@
1
- appName: hubspot-test-negative-missing-source
2
- mode: create-system
@@ -1,5 +0,0 @@
1
- appName: hubspot-test-negative-dimension-invalid-key
2
- mode: create-system
3
- source:
4
- type: known-platform
5
- platform: hubspot
@@ -1,5 +0,0 @@
1
- appName: hubspot-test-negative-dimension-invalid-path
2
- mode: create-system
3
- source:
4
- type: known-platform
5
- platform: hubspot