@aifabrix/builder 2.32.3 → 2.33.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.
- package/.cursor/rules/project-rules.mdc +8 -0
- package/README.md +36 -8
- package/bin/aifabrix.js +6 -8
- package/integration/hubspot/README.md +12 -11
- package/integration/hubspot/companies.json +2048 -0
- package/integration/hubspot/create-hubspot.js +665 -0
- package/integration/hubspot/{hubspot-deploy-company.json → hubspot-datasource-company.json} +1 -1
- package/integration/hubspot/{hubspot-deploy-contact.json → hubspot-datasource-contact.json} +1 -1
- package/integration/hubspot/{hubspot-deploy-deal.json → hubspot-datasource-deal.json} +1 -1
- package/integration/hubspot/hubspot-deploy.json +832 -81
- package/integration/hubspot/hubspot-system.json +99 -0
- package/integration/hubspot/test-artifacts/wizard-hubspot-credential-real.yaml +20 -0
- package/integration/hubspot/test-artifacts/wizard-hubspot-env-vars.yaml +9 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-add-datasource.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-app-name.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-credential-create.yaml +7 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-credential-select.yaml +7 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-known-platform.yaml +4 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-missing-app.yaml +4 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-missing-source.yaml +2 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-mode.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-openapi-file.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-openapi-url.yaml +4 -0
- package/integration/hubspot/test-artifacts/wizard-invalid-source.yaml +4 -0
- package/integration/hubspot/test-artifacts/wizard-valid-for-dimension-array-test.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-valid-for-dimension-key-test.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-valid-for-dimension-path-test.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-valid-for-dimension-test.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-valid-for-rbac-test.yaml +5 -0
- package/integration/hubspot/test-artifacts/wizard-valid-for-rbac-yaml-test.yaml +5 -0
- package/integration/hubspot/test-dataplane-down-helpers.js +246 -0
- package/integration/hubspot/test-dataplane-down-tests.js +419 -0
- package/integration/hubspot/test-dataplane-down.js +157 -0
- package/integration/hubspot/test.js +1517 -0
- package/integration/hubspot/variables.yaml +4 -4
- package/integration/hubspot/wizard-hubspot-e2e.yaml +16 -0
- package/integration/hubspot/wizard-hubspot-platform.yaml +8 -0
- package/lib/api/applications.api.js +1 -0
- package/lib/api/index.js +6 -2
- package/lib/api/types/wizard.types.js +176 -38
- package/lib/api/wizard.api.js +161 -23
- package/lib/app/deploy.js +116 -54
- package/lib/app/display.js +6 -5
- package/lib/app/dockerfile.js +2 -1
- package/lib/app/list.js +17 -10
- package/lib/app/readme.js +41 -112
- package/lib/app/register.js +44 -9
- package/lib/app/rotate-secret.js +48 -31
- package/lib/cli.js +219 -70
- package/lib/commands/app.js +4 -9
- package/lib/commands/auth-config.js +125 -0
- package/lib/commands/auth-status.js +7 -8
- package/lib/commands/datasource.js +3 -6
- package/lib/commands/login-credentials.js +4 -4
- package/lib/commands/login-device.js +26 -17
- package/lib/commands/login.js +12 -10
- package/lib/commands/wizard-config-normalizer.js +92 -0
- package/lib/commands/wizard-core.js +515 -0
- package/lib/commands/wizard-dataplane.js +122 -0
- package/lib/commands/wizard-headless.js +115 -0
- package/lib/commands/wizard.js +110 -332
- package/lib/core/config.js +46 -0
- package/lib/core/secrets.js +3 -22
- package/lib/core/templates-env.js +1 -1
- package/lib/datasource/deploy.js +59 -23
- package/lib/datasource/list.js +108 -19
- package/lib/deployment/deployer.js +25 -0
- package/lib/deployment/environment.js +10 -13
- package/lib/external-system/delete.js +151 -0
- package/lib/external-system/deploy.js +53 -378
- package/lib/external-system/download-helpers.js +45 -65
- package/lib/external-system/download.js +33 -13
- package/lib/external-system/generator.js +11 -7
- package/lib/external-system/test-auth.js +4 -3
- package/lib/generator/builders.js +3 -1
- package/lib/generator/external-controller-manifest.js +157 -0
- package/lib/generator/external-schema-utils.js +236 -0
- package/lib/generator/external.js +55 -3
- package/lib/generator/index.js +22 -10
- package/lib/generator/wizard-prompts.js +33 -10
- package/lib/generator/wizard.js +69 -86
- package/lib/infrastructure/compose.js +100 -0
- package/lib/infrastructure/helpers.js +139 -0
- package/lib/infrastructure/index.js +52 -311
- package/lib/infrastructure/services.js +168 -0
- package/lib/schema/application-schema.json +23 -4
- package/lib/schema/external-datasource.schema.json +2 -2
- package/lib/schema/wizard-config.schema.json +234 -0
- package/lib/utils/api.js +102 -52
- package/lib/utils/app-existence.js +42 -0
- package/lib/utils/app-register-config.js +7 -2
- package/lib/utils/auth-config-validator.js +92 -0
- package/lib/utils/command-header.js +43 -0
- package/lib/utils/compose-generator.js +113 -70
- package/lib/utils/controller-url.js +65 -17
- package/lib/utils/dataplane-health.js +115 -0
- package/lib/utils/dataplane-resolver.js +29 -0
- package/lib/utils/dev-config.js +6 -2
- package/lib/utils/env-copy.js +2 -1
- package/lib/utils/env-ports.js +2 -1
- package/lib/utils/env-template.js +1 -1
- package/lib/utils/error-formatter.js +49 -0
- package/lib/utils/error-formatters/network-errors.js +13 -3
- package/lib/utils/external-readme.js +125 -0
- package/lib/utils/help-builder.js +190 -0
- package/lib/utils/infra-status.js +13 -3
- package/lib/utils/paths.js +17 -2
- package/lib/utils/port-resolver.js +111 -0
- package/lib/utils/secrets-helpers.js +3 -15
- package/lib/utils/secrets-utils.js +2 -2
- package/lib/utils/token-manager.js +9 -4
- package/lib/utils/variable-transformer.js +7 -2
- package/lib/validation/external-manifest-validator.js +202 -0
- package/lib/validation/validate-display.js +406 -0
- package/lib/validation/validate.js +159 -123
- package/lib/validation/validator.js +36 -3
- package/lib/validation/wizard-config-validator.js +267 -0
- package/package.json +4 -2
- package/templates/applications/README.md.hbs +18 -16
- package/templates/applications/miso-controller/env.template +1 -1
- package/templates/applications/miso-controller/rbac.yaml +7 -7
- package/templates/external-system/README.md.hbs +99 -0
- package/templates/github/ci.yaml.hbs +44 -1
- package/templates/github/release.yaml.hbs +44 -0
- package/templates/infra/compose.yaml.hbs +35 -0
- package/templates/python/docker-compose.hbs +26 -0
- package/templates/typescript/docker-compose.hbs +26 -0
|
@@ -24,6 +24,8 @@ Technologies:
|
|
|
24
24
|
|
|
25
25
|
## Architecture Patterns
|
|
26
26
|
|
|
27
|
+
> **Visual Documentation**: When documenting architecture, workflows, or command flows, use the canonical Mermaid diagram templates from [flows-and-visuals.md](flows-and-visuals.md). These templates ensure consistent styling and accurate representation of Builder architecture.
|
|
28
|
+
|
|
27
29
|
### Module Structure
|
|
28
30
|
- All modules use CommonJS (`require`/`module.exports`)
|
|
29
31
|
- Main entry point: `bin/aifabrix.js`
|
|
@@ -506,6 +508,12 @@ function resolveSecret(key) {
|
|
|
506
508
|
- Document error conditions
|
|
507
509
|
- Add examples in comments for complex methods
|
|
508
510
|
- Document security considerations
|
|
511
|
+
- **Visual Documentation**: Use canonical Mermaid diagram templates from [flows-and-visuals.md](flows-and-visuals.md) for architecture diagrams and workflow visualizations
|
|
512
|
+
- Use Template 1 for overall Builder architecture
|
|
513
|
+
- Use Template 2 for application creation flows
|
|
514
|
+
- Use Template 3 for development lifecycle workflows
|
|
515
|
+
- Use Template 4 for wizard/external system flows
|
|
516
|
+
- Follow strict styling guidelines (colors, fonts, spacing) defined in flows-and-visuals.md
|
|
509
517
|
|
|
510
518
|
### Code Comments
|
|
511
519
|
- Use JSDoc format for function documentation
|
package/README.md
CHANGED
|
@@ -69,15 +69,43 @@ aifabrix run miso-controller
|
|
|
69
69
|
5. **Deploy** - Push to ACR and deploy via controller
|
|
70
70
|
|
|
71
71
|
```mermaid
|
|
72
|
+
%%{init: {
|
|
73
|
+
"theme": "base",
|
|
74
|
+
"themeVariables": {
|
|
75
|
+
"fontFamily": "Poppins, Arial Rounded MT Bold, Arial, sans-serif",
|
|
76
|
+
"fontSize": "16px",
|
|
77
|
+
"background": "#FFFFFF",
|
|
78
|
+
"primaryColor": "#F8FAFC",
|
|
79
|
+
"primaryTextColor": "#0B0E15",
|
|
80
|
+
"primaryBorderColor": "#E2E8F0",
|
|
81
|
+
"lineColor": "#E2E8F0",
|
|
82
|
+
"textColor": "#0B0E15",
|
|
83
|
+
"borderRadius": 16
|
|
84
|
+
},
|
|
85
|
+
"flowchart": {
|
|
86
|
+
"curve": "linear",
|
|
87
|
+
"nodeSpacing": 34,
|
|
88
|
+
"rankSpacing": 34,
|
|
89
|
+
"padding": 10
|
|
90
|
+
}
|
|
91
|
+
}}%%
|
|
92
|
+
|
|
72
93
|
flowchart TD
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
|
|
95
|
+
%% =======================
|
|
96
|
+
%% Styles
|
|
97
|
+
%% =======================
|
|
98
|
+
classDef base fill:#FFFFFF,color:#0B0E15,stroke:#E2E8F0,stroke-width:1.5px;
|
|
99
|
+
classDef primary fill:#0062FF,color:#ffffff,stroke-width:0px;
|
|
100
|
+
|
|
101
|
+
%% =======================
|
|
102
|
+
%% Flow
|
|
103
|
+
%% =======================
|
|
104
|
+
Install[Install CLI]:::primary --> Up[Start Infrastructure]:::base
|
|
105
|
+
Up --> Create[Create App]:::base
|
|
106
|
+
Create --> Build[Build Image]:::base
|
|
107
|
+
Build --> Run[Run Locally]:::base
|
|
108
|
+
Run --> Deploy[Deploy to Azure]:::primary
|
|
81
109
|
```
|
|
82
110
|
|
|
83
111
|
## Requirements
|
package/bin/aifabrix.js
CHANGED
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
const { Command } = require('commander');
|
|
17
17
|
const cli = require('../lib/cli');
|
|
18
|
-
const { setupAppCommands } = require('../lib/commands/app');
|
|
19
|
-
const { setupDatasourceCommands } = require('../lib/commands/datasource');
|
|
20
18
|
const logger = require('../lib/utils/logger');
|
|
19
|
+
const { buildCategorizedHelp } = require('../lib/utils/help-builder');
|
|
21
20
|
const packageJson = require('../package.json');
|
|
22
21
|
|
|
23
22
|
/**
|
|
@@ -31,14 +30,13 @@ function initializeCLI() {
|
|
|
31
30
|
.version(packageJson.version)
|
|
32
31
|
.description('AI Fabrix Local Fabric & Deployment SDK');
|
|
33
32
|
|
|
34
|
-
// Delegate command setup to lib/cli.js
|
|
33
|
+
// Delegate command setup to lib/cli.js (order matches help categories for consistency)
|
|
35
34
|
cli.setupCommands(program);
|
|
36
35
|
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
setupDatasourceCommands(program);
|
|
36
|
+
// Use categorized help for a more user-friendly command list
|
|
37
|
+
program.helpInformation = function() {
|
|
38
|
+
return buildCategorizedHelp(program);
|
|
39
|
+
};
|
|
42
40
|
|
|
43
41
|
// Parse command line arguments
|
|
44
42
|
program.parse();
|
|
@@ -9,10 +9,11 @@ This integration connects to HubSpot CRM API and exposes companies, contacts, an
|
|
|
9
9
|
## Files
|
|
10
10
|
|
|
11
11
|
- `variables.yaml` - Application configuration with externalIntegration block
|
|
12
|
-
- `hubspot-
|
|
13
|
-
- `hubspot-
|
|
14
|
-
- `hubspot-
|
|
15
|
-
- `hubspot-
|
|
12
|
+
- `hubspot-system.json` - External system definition with OAuth2 authentication
|
|
13
|
+
- `hubspot-datasource-company.json` - Companies datasource with field mappings
|
|
14
|
+
- `hubspot-datasource-contact.json` - Contacts datasource with field mappings
|
|
15
|
+
- `hubspot-datasource-deal.json` - Deals datasource with field mappings
|
|
16
|
+
- `hubspot-deploy.json` - Deployment manifest (generated)
|
|
16
17
|
- `env.template` - Environment variables template with kv:// references
|
|
17
18
|
|
|
18
19
|
## Setup
|
|
@@ -51,15 +52,15 @@ aifabrix validate hubspot
|
|
|
51
52
|
aifabrix login --controller http://localhost:3100 --method device --environment dev
|
|
52
53
|
|
|
53
54
|
# Register application
|
|
54
|
-
aifabrix app register hubspot
|
|
55
|
+
aifabrix app register hubspot
|
|
55
56
|
|
|
56
57
|
# Deploy entire system
|
|
57
|
-
aifabrix deploy hubspot
|
|
58
|
+
aifabrix deploy hubspot
|
|
58
59
|
|
|
59
60
|
# Or deploy individual datasources for testing
|
|
60
|
-
aifabrix datasource deploy hubspot-company --
|
|
61
|
-
aifabrix datasource deploy hubspot-contact --
|
|
62
|
-
aifabrix datasource deploy hubspot-deal --
|
|
61
|
+
aifabrix datasource deploy hubspot-company --file integration/hubspot/hubspot-datasource-company.json
|
|
62
|
+
aifabrix datasource deploy hubspot-contact --file integration/hubspot/hubspot-datasource-contact.json
|
|
63
|
+
aifabrix datasource deploy hubspot-deal --file integration/hubspot/hubspot-datasource-deal.json
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
## Field Mappings
|
|
@@ -121,10 +122,10 @@ RBAC permissions are auto-generated: `hubspot.company.list`, `hubspot.company.ge
|
|
|
121
122
|
|
|
122
123
|
```bash
|
|
123
124
|
# List datasources
|
|
124
|
-
aifabrix datasource list
|
|
125
|
+
aifabrix datasource list
|
|
125
126
|
|
|
126
127
|
# Validate specific datasource
|
|
127
|
-
aifabrix datasource validate hubspot-company
|
|
128
|
+
aifabrix datasource validate hubspot-company
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
## Documentation
|