mulesoft-anypoint-cli-agent-fabric-plugin 1.0.11 → 1.1.1-beta
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/LICENSE.txt +89 -0
- package/README.md +51 -27
- package/dist/commands/agent-network/project/build.d.ts +1 -1
- package/dist/commands/agent-network/project/build.js +21 -14
- package/dist/commands/agent-network/project/build.js.map +1 -1
- package/dist/commands/agent-network/project/create.d.ts +4 -1
- package/dist/commands/agent-network/project/create.js +67 -39
- package/dist/commands/agent-network/project/create.js.map +1 -1
- package/dist/commands/agent-network/project/deploy.d.ts +8 -4
- package/dist/commands/agent-network/project/deploy.js +195 -78
- package/dist/commands/agent-network/project/deploy.js.map +1 -1
- package/dist/commands/agent-network/project/mcp/introspect.d.ts +226 -0
- package/dist/commands/agent-network/project/mcp/introspect.js +910 -0
- package/dist/commands/agent-network/project/mcp/introspect.js.map +1 -0
- package/dist/commands/agent-network/project/publish.d.ts +2 -4
- package/dist/commands/agent-network/project/publish.js +44 -50
- package/dist/commands/agent-network/project/publish.js.map +1 -1
- package/dist/commands/agent-network/project/undeploy.d.ts +29 -0
- package/dist/commands/agent-network/project/undeploy.js +142 -0
- package/dist/commands/agent-network/project/undeploy.js.map +1 -0
- package/dist/commands/agent-network/project/unpublish.d.ts +28 -0
- package/dist/commands/agent-network/project/unpublish.js +143 -0
- package/dist/commands/agent-network/project/unpublish.js.map +1 -0
- package/dist/commands/agent-network/setup/dependencies.js +11 -8
- package/dist/commands/agent-network/setup/dependencies.js.map +1 -1
- package/dist/commands/agent-network/setup/gateways.d.ts +10 -4
- package/dist/commands/agent-network/setup/gateways.js +160 -97
- package/dist/commands/agent-network/setup/gateways.js.map +1 -1
- package/dist/errors/base-error.js +5 -0
- package/dist/errors/base-error.js.map +1 -1
- package/dist/errors/error-factory.d.ts +80 -16
- package/dist/errors/error-factory.js +348 -69
- package/dist/errors/error-factory.js.map +1 -1
- package/dist/helpers/connection-id.js +6 -2
- package/dist/helpers/connection-id.js.map +1 -1
- package/dist/helpers/connection.d.ts +20 -0
- package/dist/helpers/connection.js +93 -0
- package/dist/helpers/connection.js.map +1 -0
- package/dist/helpers/dependency-manager.d.ts +2 -2
- package/dist/helpers/dependency-manager.js +18 -12
- package/dist/helpers/dependency-manager.js.map +1 -1
- package/dist/helpers/entitlement-utils.js +8 -3
- package/dist/helpers/entitlement-utils.js.map +1 -1
- package/dist/helpers/policy-helper.d.ts +27 -29
- package/dist/helpers/policy-helper.js +125 -55
- package/dist/helpers/policy-helper.js.map +1 -1
- package/dist/helpers/project/api-project-dependency-fetcher.js +18 -14
- package/dist/helpers/project/api-project-dependency-fetcher.js.map +1 -1
- package/dist/helpers/project/constants.d.ts +4 -4
- package/dist/helpers/project/constants.js +10 -3
- package/dist/helpers/project/constants.js.map +1 -1
- package/dist/helpers/project/debug-messages.js +5 -0
- package/dist/helpers/project/debug-messages.js.map +1 -1
- package/dist/helpers/project/templates.js +6 -1
- package/dist/helpers/project/templates.js.map +1 -1
- package/dist/helpers/project/uris.js +5 -0
- package/dist/helpers/project/uris.js.map +1 -1
- package/dist/helpers/project/validation-commons.d.ts +4 -0
- package/dist/helpers/project/validation-commons.js +33 -5
- package/dist/helpers/project/validation-commons.js.map +1 -1
- package/dist/helpers/request-logging.d.ts +36 -0
- package/dist/helpers/request-logging.js +185 -0
- package/dist/helpers/request-logging.js.map +1 -0
- package/dist/helpers/request-utils.d.ts +1 -1
- package/dist/helpers/request-utils.js +6 -1
- package/dist/helpers/request-utils.js.map +1 -1
- package/dist/helpers/types.js +5 -0
- package/dist/helpers/types.js.map +1 -1
- package/dist/helpers/utils.d.ts +23 -15
- package/dist/helpers/utils.js +206 -104
- package/dist/helpers/utils.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/resources/mcp-server-schema.json +574 -0
- package/dist/types/agent-network-v2.d.ts +379 -0
- package/dist/types/agent-network-v2.js +28 -0
- package/dist/types/agent-network-v2.js.map +1 -0
- package/dist/types/agent-network.d.ts +226 -219
- package/dist/types/agent-network.js +16 -14
- package/dist/types/agent-network.js.map +1 -1
- package/dist/types/types.d.ts +57 -17
- package/dist/types/types.js +5 -0
- package/dist/types/types.js.map +1 -1
- package/dist/utils/access-management.js +7 -1
- package/dist/utils/access-management.js.map +1 -1
- package/dist/utils/builders/builder.d.ts +12 -0
- package/dist/utils/builders/builder.js +215 -11
- package/dist/utils/builders/builder.js.map +1 -1
- package/dist/utils/builders/common/agent-metadata.d.ts +21 -0
- package/dist/utils/builders/common/agent-metadata.js +73 -0
- package/dist/utils/builders/common/agent-metadata.js.map +1 -0
- package/dist/utils/builders/common/asset-file-resolver.d.ts +3 -0
- package/dist/utils/builders/common/asset-file-resolver.js +33 -0
- package/dist/utils/builders/common/asset-file-resolver.js.map +1 -0
- package/dist/utils/builders/common/connection-facet-helpers.d.ts +26 -0
- package/dist/utils/builders/common/connection-facet-helpers.js +47 -0
- package/dist/utils/builders/common/connection-facet-helpers.js.map +1 -0
- package/dist/utils/builders/common/connection-metadata.d.ts +5 -0
- package/dist/utils/builders/common/connection-metadata.js +25 -0
- package/dist/utils/builders/common/connection-metadata.js.map +1 -0
- package/dist/utils/builders/common/network-builder-helpers.d.ts +7 -0
- package/dist/utils/builders/common/network-builder-helpers.js +25 -0
- package/dist/utils/builders/common/network-builder-helpers.js.map +1 -0
- package/dist/utils/builders/common/network-metadata.d.ts +5 -0
- package/dist/utils/builders/common/network-metadata.js +26 -0
- package/dist/utils/builders/common/network-metadata.js.map +1 -0
- package/dist/utils/builders/common/registry-entry.d.ts +2 -0
- package/dist/utils/builders/common/registry-entry.js +21 -0
- package/dist/utils/builders/common/registry-entry.js.map +1 -0
- package/dist/utils/builders/common/types.d.ts +38 -0
- package/dist/utils/builders/common/types.js +8 -0
- package/dist/utils/builders/common/types.js.map +1 -0
- package/dist/utils/builders/network-lock.d.ts +38 -0
- package/dist/utils/builders/network-lock.js +108 -0
- package/dist/utils/builders/network-lock.js.map +1 -0
- package/dist/utils/builders/policies-factory.d.ts +8 -1
- package/dist/utils/builders/policies-factory.js +43 -10
- package/dist/utils/builders/policies-factory.js.map +1 -1
- package/dist/utils/builders/project-builder-impl.d.ts +70 -17
- package/dist/utils/builders/project-builder-impl.js +189 -28
- package/dist/utils/builders/project-builder-impl.js.map +1 -1
- package/dist/utils/builders/project-builder.d.ts +75 -11
- package/dist/utils/builders/project-builder.js +18 -3
- package/dist/utils/builders/project-builder.js.map +1 -1
- package/dist/utils/builders/remote-space-resolver.d.ts +21 -0
- package/dist/utils/builders/remote-space-resolver.js +232 -0
- package/dist/utils/builders/remote-space-resolver.js.map +1 -0
- package/dist/utils/builders/space-serializer.d.ts +16 -2
- package/dist/utils/builders/space-serializer.js +136 -29
- package/dist/utils/builders/space-serializer.js.map +1 -1
- package/dist/utils/builders/tooling-metadata.d.ts +8 -0
- package/dist/utils/builders/tooling-metadata.js +69 -0
- package/dist/utils/builders/tooling-metadata.js.map +1 -0
- package/dist/utils/builders/v1/agent-builder.d.ts +15 -0
- package/dist/utils/builders/v1/agent-builder.js +78 -0
- package/dist/utils/builders/v1/agent-builder.js.map +1 -0
- package/dist/utils/builders/{broker-builder.d.ts → v1/broker-builder.d.ts} +8 -1
- package/dist/utils/builders/v1/broker-builder.js +259 -0
- package/dist/utils/builders/v1/broker-builder.js.map +1 -0
- package/dist/utils/builders/{connections-builder.d.ts → v1/connections-builder.d.ts} +4 -3
- package/dist/utils/builders/v1/connections-builder.js +189 -0
- package/dist/utils/builders/v1/connections-builder.js.map +1 -0
- package/dist/utils/builders/{llm-builder.d.ts → v1/llm-builder.d.ts} +5 -2
- package/dist/utils/builders/v1/llm-builder.js +76 -0
- package/dist/utils/builders/v1/llm-builder.js.map +1 -0
- package/dist/utils/builders/{mcp-builder.d.ts → v1/mcp-builder.d.ts} +5 -2
- package/dist/utils/builders/v1/mcp-builder.js +64 -0
- package/dist/utils/builders/v1/mcp-builder.js.map +1 -0
- package/dist/utils/builders/{network-builder.d.ts → v1/network-builder.d.ts} +2 -1
- package/dist/utils/builders/v1/network-builder.js +79 -0
- package/dist/utils/builders/v1/network-builder.js.map +1 -0
- package/dist/utils/builders/{path.d.ts → v1/path.d.ts} +1 -1
- package/dist/utils/builders/{path.js → v1/path.js} +6 -1
- package/dist/utils/builders/v1/path.js.map +1 -0
- package/dist/utils/builders/v2/agent-builder.d.ts +17 -0
- package/dist/utils/builders/v2/agent-builder.js +142 -0
- package/dist/utils/builders/v2/agent-builder.js.map +1 -0
- package/dist/utils/builders/v2/broker-builder.d.ts +21 -0
- package/dist/utils/builders/v2/broker-builder.js +168 -0
- package/dist/utils/builders/v2/broker-builder.js.map +1 -0
- package/dist/utils/builders/v2/connections-builder.d.ts +18 -0
- package/dist/utils/builders/v2/connections-builder.js +196 -0
- package/dist/utils/builders/v2/connections-builder.js.map +1 -0
- package/dist/utils/builders/v2/llm-builder.d.ts +11 -0
- package/dist/utils/builders/v2/llm-builder.js +68 -0
- package/dist/utils/builders/v2/llm-builder.js.map +1 -0
- package/dist/utils/builders/v2/mcp-builder.d.ts +10 -0
- package/dist/utils/builders/v2/mcp-builder.js +66 -0
- package/dist/utils/builders/v2/mcp-builder.js.map +1 -0
- package/dist/utils/builders/v2/network-builder.d.ts +14 -0
- package/dist/utils/builders/v2/network-builder.js +123 -0
- package/dist/utils/builders/v2/network-builder.js.map +1 -0
- package/dist/utils/builders/v2/path.d.ts +12 -0
- package/dist/utils/builders/v2/path.js +46 -0
- package/dist/utils/builders/v2/path.js.map +1 -0
- package/dist/utils/constants.d.ts +42 -2
- package/dist/utils/constants.js +61 -5
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/exchange.d.ts +5 -6
- package/dist/utils/exchange.js +83 -73
- package/dist/utils/exchange.js.map +1 -1
- package/dist/utils/facets/abstract-facet.d.ts +4 -28
- package/dist/utils/facets/abstract-facet.js +10 -29
- package/dist/utils/facets/abstract-facet.js.map +1 -1
- package/dist/utils/facets/agent-graph-facet.d.ts +17 -0
- package/dist/utils/facets/agent-graph-facet.js +276 -0
- package/dist/utils/facets/agent-graph-facet.js.map +1 -0
- package/dist/utils/facets/api-instance-facet.d.ts +4 -2
- package/dist/utils/facets/api-instance-facet.js +54 -32
- package/dist/utils/facets/api-instance-facet.js.map +1 -1
- package/dist/utils/facets/apim-policy-helpers.d.ts +24 -0
- package/dist/utils/facets/apim-policy-helpers.js +43 -0
- package/dist/utils/facets/apim-policy-helpers.js.map +1 -0
- package/dist/utils/facets/asset-facet.d.ts +7 -3
- package/dist/utils/facets/asset-facet.js +158 -82
- package/dist/utils/facets/asset-facet.js.map +1 -1
- package/dist/utils/facets/connection-facet.d.ts +4 -2
- package/dist/utils/facets/connection-facet.js +54 -32
- package/dist/utils/facets/connection-facet.js.map +1 -1
- package/dist/utils/facets/deployment-helpers.d.ts +28 -1
- package/dist/utils/facets/deployment-helpers.js +87 -4
- package/dist/utils/facets/deployment-helpers.js.map +1 -1
- package/dist/utils/facets/deployment-runner.d.ts +12 -0
- package/dist/utils/facets/deployment-runner.js +62 -0
- package/dist/utils/facets/deployment-runner.js.map +1 -0
- package/dist/utils/facets/facets.d.ts +4 -0
- package/dist/utils/facets/facets.js +98 -7
- package/dist/utils/facets/facets.js.map +1 -1
- package/dist/utils/facets/mule-application-facet.d.ts +3 -7
- package/dist/utils/facets/mule-application-facet.js +54 -85
- package/dist/utils/facets/mule-application-facet.js.map +1 -1
- package/dist/utils/facets/publication-metadata-patcher.d.ts +2 -0
- package/dist/utils/facets/publication-metadata-patcher.js +68 -0
- package/dist/utils/facets/publication-metadata-patcher.js.map +1 -0
- package/dist/utils/facets/publication-rank.d.ts +4 -0
- package/dist/utils/facets/publication-rank.js +33 -0
- package/dist/utils/facets/publication-rank.js.map +1 -0
- package/dist/utils/facets/undeploy-helpers.d.ts +6 -0
- package/dist/utils/facets/undeploy-helpers.js +73 -0
- package/dist/utils/facets/undeploy-helpers.js.map +1 -0
- package/dist/utils/facets/unpublish-preflight.d.ts +2 -0
- package/dist/utils/facets/unpublish-preflight.js +59 -0
- package/dist/utils/facets/unpublish-preflight.js.map +1 -0
- package/dist/utils/files.d.ts +0 -1
- package/dist/utils/files.js +15 -2
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/gateway-mode.d.ts +22 -0
- package/dist/utils/gateway-mode.js +43 -0
- package/dist/utils/gateway-mode.js.map +1 -0
- package/dist/utils/gateway.d.ts +24 -6
- package/dist/utils/gateway.js +115 -35
- package/dist/utils/gateway.js.map +1 -1
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.js +25 -14
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/mcp/mcp-metadata-mapper.d.ts +26 -0
- package/dist/utils/mcp/mcp-metadata-mapper.js +58 -0
- package/dist/utils/mcp/mcp-metadata-mapper.js.map +1 -0
- package/dist/utils/mcp/project-registrar.d.ts +21 -0
- package/dist/utils/mcp/project-registrar.js +96 -0
- package/dist/utils/mcp/project-registrar.js.map +1 -0
- package/dist/utils/mcp/registry-key.d.ts +7 -0
- package/dist/utils/mcp/registry-key.js +72 -0
- package/dist/utils/mcp/registry-key.js.map +1 -0
- package/dist/utils/naming.js +7 -3
- package/dist/utils/naming.js.map +1 -1
- package/dist/utils/promise/promiseCreator.js +5 -0
- package/dist/utils/promise/promiseCreator.js.map +1 -1
- package/dist/utils/report/junit-report.js +5 -0
- package/dist/utils/report/junit-report.js.map +1 -1
- package/dist/utils/report/validation-report.js +5 -0
- package/dist/utils/report/validation-report.js.map +1 -1
- package/dist/utils/request-executor.d.ts +17 -0
- package/dist/utils/request-executor.js +121 -0
- package/dist/utils/request-executor.js.map +1 -0
- package/dist/utils/uris.d.ts +4 -4
- package/dist/utils/uris.js +19 -6
- package/dist/utils/uris.js.map +1 -1
- package/dist/utils/variables.d.ts +3 -4
- package/dist/utils/variables.js +25 -9
- package/dist/utils/variables.js.map +1 -1
- package/dist/utils/zip-utils.d.ts +8 -0
- package/dist/utils/zip-utils.js +24 -0
- package/dist/utils/zip-utils.js.map +1 -0
- package/package.json +22 -11
- package/scripts/resolve-version.sh +89 -0
- package/scripts/resolve-version.test.sh +81 -0
- package/scripts/test-publish-npm.sh +130 -0
- package/templates/{agent-network.yaml.template → agent-network/agent-network.yaml.template} +1 -1
- package/templates/{exchange.json.template → agent-network/exchange.json.template} +1 -0
- package/templates/agentic-network/agent-network.yaml.template +93 -0
- package/templates/agentic-network/brokers/broker1.agent.template +102 -0
- package/templates/agentic-network/exchange.json.template +37 -0
- package/dist/utils/builders/agent-builder.d.ts +0 -11
- package/dist/utils/builders/agent-builder.js +0 -79
- package/dist/utils/builders/agent-builder.js.map +0 -1
- package/dist/utils/builders/broker-builder.js +0 -292
- package/dist/utils/builders/broker-builder.js.map +0 -1
- package/dist/utils/builders/connections-builder.js +0 -233
- package/dist/utils/builders/connections-builder.js.map +0 -1
- package/dist/utils/builders/llm-builder.js +0 -64
- package/dist/utils/builders/llm-builder.js.map +0 -1
- package/dist/utils/builders/mcp-builder.js +0 -48
- package/dist/utils/builders/mcp-builder.js.map +0 -1
- package/dist/utils/builders/network-builder.js +0 -77
- package/dist/utils/builders/network-builder.js.map +0 -1
- package/dist/utils/builders/path.js.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { APIInstance, APIInstanceBuilder, Asset, AssetBuilder, Client, ClientBuilder, Component, ComponentBuilder, Connection, ConnectionBuilder, Gateways, MuleApplication, MuleDeploymentBuilder, PolicyBinding, Space, SpaceBuilder, StageContext, StageContextBuilder, StageResult, StageResultRegistry, SpaceVariable, VariableBuilder } from './project-builder';
|
|
1
|
+
import { APIInstance, APIInstanceBuilder, Asset, AssetBuilder, AssetIdentity, Client, ClientBuilder, Component, ComponentBuilder, Connection, ConnectionBuilder, Gateways, MuleApplication, MuleDeploymentBuilder, PolicyBinding, Space, SpaceBuilder, StageContext, StageContextBuilder, StageResult, StageResultRegistry, SpaceVariable, VariableBuilder, AgentGraphDeploymentBuilder, AgentGraph } from './project-builder';
|
|
2
2
|
import { GAV, RuntimeTargetSpace, Variables } from '../../types/types';
|
|
3
|
-
import { Session } from 'anypoint-cli-command';
|
|
3
|
+
import { Session } from 'anypoint-cli-command-lib';
|
|
4
4
|
import { AxiosInstance } from 'axios';
|
|
5
|
-
import {
|
|
5
|
+
import { AgentNetwork } from '../../types/agent-network';
|
|
6
|
+
import Properties = AgentNetwork.Properties;
|
|
6
7
|
/**
|
|
7
8
|
* Default implementation of VariableBuilder
|
|
8
9
|
*/
|
|
@@ -66,8 +67,7 @@ export declare class DefaultAssetBuilder implements AssetBuilder {
|
|
|
66
67
|
export declare class DefaultAPIInstanceBuilder implements APIInstanceBuilder {
|
|
67
68
|
private readonly id;
|
|
68
69
|
private typ?;
|
|
69
|
-
private
|
|
70
|
-
private readonly assetId?;
|
|
70
|
+
private assetIdentity;
|
|
71
71
|
private lbl?;
|
|
72
72
|
private desc?;
|
|
73
73
|
private tagList?;
|
|
@@ -76,9 +76,10 @@ export declare class DefaultAPIInstanceBuilder implements APIInstanceBuilder {
|
|
|
76
76
|
private metadataVal?;
|
|
77
77
|
private _inboundPolicies;
|
|
78
78
|
private _outboundPolicies;
|
|
79
|
-
|
|
79
|
+
private environmentInstanceIdVal?;
|
|
80
|
+
private readonly dependencies;
|
|
81
|
+
constructor(id: string, assetIdentity: AssetIdentity, dependencies?: GAV[]);
|
|
80
82
|
type(type: string): APIInstanceBuilder;
|
|
81
|
-
asset(assetGav: GAV): APIInstanceBuilder;
|
|
82
83
|
label(label: string): APIInstanceBuilder;
|
|
83
84
|
description(description: string): APIInstanceBuilder;
|
|
84
85
|
tags(tags: string[]): APIInstanceBuilder;
|
|
@@ -90,6 +91,7 @@ export declare class DefaultAPIInstanceBuilder implements APIInstanceBuilder {
|
|
|
90
91
|
}): APIInstanceBuilder;
|
|
91
92
|
inboundPolicies(policyBindings: PolicyBinding[]): APIInstanceBuilder;
|
|
92
93
|
outboundPolicies(policyBindings: PolicyBinding[]): APIInstanceBuilder;
|
|
94
|
+
environmentInstanceId(id: string): APIInstanceBuilder;
|
|
93
95
|
build(): APIInstance;
|
|
94
96
|
}
|
|
95
97
|
/**
|
|
@@ -97,7 +99,8 @@ export declare class DefaultAPIInstanceBuilder implements APIInstanceBuilder {
|
|
|
97
99
|
*/
|
|
98
100
|
export declare class DefaultMuleApplicationBuilder implements MuleDeploymentBuilder {
|
|
99
101
|
private readonly id;
|
|
100
|
-
private
|
|
102
|
+
private nameVal?;
|
|
103
|
+
private assetIdentity?;
|
|
101
104
|
private propertiesMap?;
|
|
102
105
|
private securedPropertiesMap?;
|
|
103
106
|
private _variables?;
|
|
@@ -106,8 +109,10 @@ export declare class DefaultMuleApplicationBuilder implements MuleDeploymentBuil
|
|
|
106
109
|
private readonly connectionReferences;
|
|
107
110
|
private readonly credentialList;
|
|
108
111
|
private readonly requiredVariables;
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
private readonly dependencies;
|
|
113
|
+
constructor(id: string, dependencies?: GAV[]);
|
|
114
|
+
asset(identity: AssetIdentity): MuleDeploymentBuilder;
|
|
115
|
+
name(name: string): MuleDeploymentBuilder;
|
|
111
116
|
properties(properties: Record<string, string>): MuleDeploymentBuilder;
|
|
112
117
|
securedProperties(securedProperties: Record<string, string>): MuleDeploymentBuilder;
|
|
113
118
|
variables(variables: Variables): MuleDeploymentBuilder;
|
|
@@ -118,13 +123,42 @@ export declare class DefaultMuleApplicationBuilder implements MuleDeploymentBuil
|
|
|
118
123
|
requiresVariable(variableName: string): MuleDeploymentBuilder;
|
|
119
124
|
build(): MuleApplication;
|
|
120
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Default implementation of DefaultAgentGraphBuilder
|
|
128
|
+
*/
|
|
129
|
+
export declare class DefaultAgentGraphBuilder implements AgentGraphDeploymentBuilder {
|
|
130
|
+
private readonly id;
|
|
131
|
+
private nameVal?;
|
|
132
|
+
private assetIdentity?;
|
|
133
|
+
private propertiesMap?;
|
|
134
|
+
private securedPropertiesMap?;
|
|
135
|
+
private _variables?;
|
|
136
|
+
private runtimeVer?;
|
|
137
|
+
private tracingVal;
|
|
138
|
+
private readonly connectionReferences;
|
|
139
|
+
private readonly credentialList;
|
|
140
|
+
private readonly requiredVariables;
|
|
141
|
+
private readonly dependencies;
|
|
142
|
+
constructor(id: string, dependencies?: GAV[]);
|
|
143
|
+
asset(identity: AssetIdentity): AgentGraphDeploymentBuilder;
|
|
144
|
+
name(name: string): AgentGraphDeploymentBuilder;
|
|
145
|
+
properties(properties: Record<string, string>): AgentGraphDeploymentBuilder;
|
|
146
|
+
securedProperties(securedProperties: Record<string, string>): AgentGraphDeploymentBuilder;
|
|
147
|
+
variables(variables: Variables): AgentGraphDeploymentBuilder;
|
|
148
|
+
runtimeVersion(version: string): AgentGraphDeploymentBuilder;
|
|
149
|
+
tracing(enabled: boolean): AgentGraphDeploymentBuilder;
|
|
150
|
+
requiresConnection(asset: GAV, type: string, connectionId: string): AgentGraphDeploymentBuilder;
|
|
151
|
+
requiresCredentials(credentialId: string): AgentGraphDeploymentBuilder;
|
|
152
|
+
requiresVariable(variableName: string): AgentGraphDeploymentBuilder;
|
|
153
|
+
build(): AgentGraph;
|
|
154
|
+
}
|
|
121
155
|
/**
|
|
122
156
|
* Default implementation of ConnectionBuilder
|
|
123
157
|
*/
|
|
124
158
|
export declare class DefaultConnectionBuilder implements ConnectionBuilder {
|
|
125
159
|
private readonly id;
|
|
126
160
|
private typ?;
|
|
127
|
-
private
|
|
161
|
+
private assetIdentity?;
|
|
128
162
|
private lbl?;
|
|
129
163
|
private desc?;
|
|
130
164
|
private tagList?;
|
|
@@ -134,11 +168,13 @@ export declare class DefaultConnectionBuilder implements ConnectionBuilder {
|
|
|
134
168
|
private _inboundPolicies;
|
|
135
169
|
private _outboundPolicies;
|
|
136
170
|
private readonly variableList;
|
|
137
|
-
|
|
171
|
+
private environmentInstanceIdVal?;
|
|
172
|
+
private readonly dependencies;
|
|
173
|
+
constructor(id: string, dependencies?: GAV[]);
|
|
138
174
|
inboundPolicies(policyBindings: PolicyBinding[]): ConnectionBuilder;
|
|
139
175
|
outboundPolicies(policyBindings: PolicyBinding[]): ConnectionBuilder;
|
|
140
176
|
type(type: string): ConnectionBuilder;
|
|
141
|
-
asset(
|
|
177
|
+
asset(identity: AssetIdentity): ConnectionBuilder;
|
|
142
178
|
label(label: string): ConnectionBuilder;
|
|
143
179
|
description(description: string): ConnectionBuilder;
|
|
144
180
|
tags(tags: string[]): ConnectionBuilder;
|
|
@@ -149,6 +185,7 @@ export declare class DefaultConnectionBuilder implements ConnectionBuilder {
|
|
|
149
185
|
source: string;
|
|
150
186
|
}): ConnectionBuilder;
|
|
151
187
|
requiresVariable(variableName: string): ConnectionBuilder;
|
|
188
|
+
environmentInstanceId(id: string): ConnectionBuilder;
|
|
152
189
|
build(): Connection;
|
|
153
190
|
}
|
|
154
191
|
/**
|
|
@@ -159,19 +196,22 @@ export declare class DefaultComponentBuilder implements ComponentBuilder {
|
|
|
159
196
|
private readonly assetMap;
|
|
160
197
|
private readonly apiInstanceMap;
|
|
161
198
|
private readonly muleAppMap;
|
|
199
|
+
private readonly agentGraphMap;
|
|
162
200
|
private readonly connectionMap;
|
|
163
201
|
private readonly clientMap;
|
|
164
202
|
private readonly components;
|
|
165
203
|
private _version;
|
|
166
|
-
|
|
204
|
+
private readonly dependencies;
|
|
205
|
+
constructor(id: string, dependencies?: GAV[]);
|
|
167
206
|
addComponentDependency(componentID: string): ComponentBuilder;
|
|
168
207
|
getAsset(id: string): AssetBuilder | undefined;
|
|
169
208
|
version(version: string): ComponentBuilder;
|
|
170
209
|
addAsset(id: string): AssetBuilder;
|
|
171
|
-
addAPIInstance(id: string,
|
|
210
|
+
addAPIInstance(id: string, assetIdentity: AssetIdentity): APIInstanceBuilder;
|
|
172
211
|
getAPIInstance(id: string): APIInstanceBuilder | undefined;
|
|
173
212
|
addMuleDeployment(id: string): MuleDeploymentBuilder;
|
|
174
|
-
|
|
213
|
+
addAgentGraphDeployment(id: string): AgentGraphDeploymentBuilder;
|
|
214
|
+
addConnection(id: string, assetIdentity: AssetIdentity): ConnectionBuilder;
|
|
175
215
|
addClient(id: string): ClientBuilder;
|
|
176
216
|
build(): Component;
|
|
177
217
|
}
|
|
@@ -182,7 +222,9 @@ export declare class DefaultSpaceBuilder implements SpaceBuilder {
|
|
|
182
222
|
private readonly componentMap;
|
|
183
223
|
private readonly variableMap;
|
|
184
224
|
private readonly _gav;
|
|
185
|
-
|
|
225
|
+
private readonly _apiVersion;
|
|
226
|
+
private readonly _dependencies?;
|
|
227
|
+
constructor(gav: GAV, apiVersion: string, dependencies?: GAV[]);
|
|
186
228
|
searchAsset(assetId: string): AssetBuilder | undefined;
|
|
187
229
|
addComponent(id: string): ComponentBuilder;
|
|
188
230
|
getComponent(id: string): ComponentBuilder | undefined;
|
|
@@ -209,6 +251,8 @@ export declare class DefaultStageContextBuilder implements StageContextBuilder {
|
|
|
209
251
|
private gateways?;
|
|
210
252
|
private runtimeTarget?;
|
|
211
253
|
private updateAPISource;
|
|
254
|
+
private hardDelete;
|
|
255
|
+
private targetDir;
|
|
212
256
|
constructor(req: AxiosInstance);
|
|
213
257
|
withTracingDisabled(disableTracing: boolean): StageContextBuilder;
|
|
214
258
|
withDontWait(dontWait: boolean): StageContextBuilder;
|
|
@@ -219,8 +263,17 @@ export declare class DefaultStageContextBuilder implements StageContextBuilder {
|
|
|
219
263
|
withGateways(gateways: Gateways): StageContextBuilder;
|
|
220
264
|
withRuntimeTarget(runtimeTarget: RuntimeTargetSpace): StageContextBuilder;
|
|
221
265
|
withSession(session: Session): StageContextBuilder;
|
|
266
|
+
withTargetDir(targetDir: string): StageContextBuilder;
|
|
222
267
|
build(): StageContext;
|
|
223
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* Workspace builder for file-based operations (for compatibility with existing tests)
|
|
271
|
+
*/
|
|
272
|
+
export declare class DefaultWorkspaceBuilder {
|
|
273
|
+
private readonly components;
|
|
274
|
+
addComponent(id: string): DefaultWorkspaceBuilder;
|
|
275
|
+
dump(target: any): void;
|
|
276
|
+
}
|
|
224
277
|
export declare class DefaultStageResultRegistry implements StageResultRegistry {
|
|
225
278
|
private results;
|
|
226
279
|
private variables;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2026, Salesforce, Inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* For full license text, see the LICENSE.txt file
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultStageResultRegistry = exports.DefaultStageContextBuilder = exports.DefaultSpaceBuilder = exports.DefaultComponentBuilder = exports.DefaultConnectionBuilder = exports.DefaultMuleApplicationBuilder = exports.DefaultAPIInstanceBuilder = exports.DefaultAssetBuilder = exports.DefaultClientBuilder = exports.DefaultVariableBuilder = void 0;
|
|
8
|
+
exports.DefaultStageResultRegistry = exports.DefaultWorkspaceBuilder = exports.DefaultStageContextBuilder = exports.DefaultSpaceBuilder = exports.DefaultComponentBuilder = exports.DefaultConnectionBuilder = exports.DefaultAgentGraphBuilder = exports.DefaultMuleApplicationBuilder = exports.DefaultAPIInstanceBuilder = exports.DefaultAssetBuilder = exports.DefaultClientBuilder = exports.DefaultVariableBuilder = void 0;
|
|
4
9
|
const project_builder_1 = require("./project-builder");
|
|
10
|
+
const publication_rank_1 = require("../facets/publication-rank");
|
|
11
|
+
const constants_1 = require("../constants");
|
|
12
|
+
const network_lock_1 = require("./network-lock");
|
|
5
13
|
const uris_1 = require("../uris");
|
|
6
14
|
const promiseCreator_1 = require("../promise/promiseCreator");
|
|
7
15
|
const utils_1 = require("../../helpers/utils");
|
|
16
|
+
// Drop a trailing lone high surrogate to keep the sliced output valid UTF-16.
|
|
17
|
+
function capDescription(desc) {
|
|
18
|
+
if (desc.length <= constants_1.EXCHANGE_DESCRIPTION_MAX_LENGTH)
|
|
19
|
+
return desc;
|
|
20
|
+
const end = constants_1.EXCHANGE_DESCRIPTION_MAX_LENGTH;
|
|
21
|
+
// eslint-disable-next-line unicorn/prefer-code-point
|
|
22
|
+
const last = desc.charCodeAt(end - 1);
|
|
23
|
+
return desc.slice(0, last >= 55296 && last <= 56319 ? end - 1 : end);
|
|
24
|
+
}
|
|
8
25
|
/**
|
|
9
26
|
* Default implementation of VariableBuilder
|
|
10
27
|
*/
|
|
@@ -100,7 +117,7 @@ class DefaultAssetBuilder {
|
|
|
100
117
|
return this;
|
|
101
118
|
}
|
|
102
119
|
description(description) {
|
|
103
|
-
this.desc = description;
|
|
120
|
+
this.desc = capDescription(description);
|
|
104
121
|
return this;
|
|
105
122
|
}
|
|
106
123
|
assetId(assetId) {
|
|
@@ -143,20 +160,17 @@ exports.DefaultAssetBuilder = DefaultAssetBuilder;
|
|
|
143
160
|
* Default implementation of APIInstanceBuilder
|
|
144
161
|
*/
|
|
145
162
|
class DefaultAPIInstanceBuilder {
|
|
146
|
-
constructor(id,
|
|
163
|
+
constructor(id, assetIdentity, dependencies = []) {
|
|
147
164
|
this._inboundPolicies = [];
|
|
148
165
|
this._outboundPolicies = [];
|
|
149
166
|
this.id = id;
|
|
150
|
-
this.
|
|
167
|
+
this.assetIdentity = assetIdentity;
|
|
168
|
+
this.dependencies = dependencies;
|
|
151
169
|
}
|
|
152
170
|
type(type) {
|
|
153
171
|
this.typ = type;
|
|
154
172
|
return this;
|
|
155
173
|
}
|
|
156
|
-
asset(assetGav) {
|
|
157
|
-
this.assetGav = assetGav;
|
|
158
|
-
return this;
|
|
159
|
-
}
|
|
160
174
|
label(label) {
|
|
161
175
|
this.lbl = label;
|
|
162
176
|
return this;
|
|
@@ -189,11 +203,19 @@ class DefaultAPIInstanceBuilder {
|
|
|
189
203
|
this._outboundPolicies = [...this._outboundPolicies, ...policyBindings];
|
|
190
204
|
return this;
|
|
191
205
|
}
|
|
206
|
+
environmentInstanceId(id) {
|
|
207
|
+
this.environmentInstanceIdVal = id;
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
192
210
|
build() {
|
|
193
211
|
return {
|
|
194
212
|
id: this.id,
|
|
195
213
|
type: this.typ || 'api',
|
|
196
|
-
asset:
|
|
214
|
+
asset: {
|
|
215
|
+
groupId: this.assetIdentity.groupId,
|
|
216
|
+
assetId: this.assetIdentity.assetId,
|
|
217
|
+
version: (0, network_lock_1.resolveVersionSlot)(this.assetIdentity, this.dependencies),
|
|
218
|
+
},
|
|
197
219
|
label: this.lbl || this.id,
|
|
198
220
|
description: this.desc,
|
|
199
221
|
tags: this.tagList,
|
|
@@ -202,6 +224,7 @@ class DefaultAPIInstanceBuilder {
|
|
|
202
224
|
path: this.pathVal || '/',
|
|
203
225
|
upstreamUrl: this.upstreamUrlVal,
|
|
204
226
|
metadata: this.metadataVal,
|
|
227
|
+
environmentInstanceId: this.environmentInstanceIdVal,
|
|
205
228
|
};
|
|
206
229
|
}
|
|
207
230
|
}
|
|
@@ -210,15 +233,20 @@ exports.DefaultAPIInstanceBuilder = DefaultAPIInstanceBuilder;
|
|
|
210
233
|
* Default implementation of MuleApplicationBuilder
|
|
211
234
|
*/
|
|
212
235
|
class DefaultMuleApplicationBuilder {
|
|
213
|
-
constructor(id) {
|
|
236
|
+
constructor(id, dependencies = []) {
|
|
214
237
|
this.tracingVal = false;
|
|
215
238
|
this.connectionReferences = [];
|
|
216
239
|
this.credentialList = [];
|
|
217
240
|
this.requiredVariables = [];
|
|
218
241
|
this.id = id;
|
|
242
|
+
this.dependencies = dependencies;
|
|
219
243
|
}
|
|
220
|
-
asset(
|
|
221
|
-
this.
|
|
244
|
+
asset(identity) {
|
|
245
|
+
this.assetIdentity = identity;
|
|
246
|
+
return this;
|
|
247
|
+
}
|
|
248
|
+
name(name) {
|
|
249
|
+
this.nameVal = name;
|
|
222
250
|
return this;
|
|
223
251
|
}
|
|
224
252
|
properties(properties) {
|
|
@@ -256,7 +284,12 @@ class DefaultMuleApplicationBuilder {
|
|
|
256
284
|
build() {
|
|
257
285
|
return {
|
|
258
286
|
id: this.id,
|
|
259
|
-
|
|
287
|
+
name: this.nameVal,
|
|
288
|
+
asset: this.assetIdentity ? {
|
|
289
|
+
groupId: this.assetIdentity.groupId,
|
|
290
|
+
assetId: this.assetIdentity.assetId,
|
|
291
|
+
version: (0, network_lock_1.resolveVersionSlot)(this.assetIdentity, this.dependencies),
|
|
292
|
+
} : { groupId: '', assetId: '', version: '' },
|
|
260
293
|
properties: this.propertiesMap,
|
|
261
294
|
securedProperties: this.securedPropertiesMap,
|
|
262
295
|
variables: this._variables,
|
|
@@ -267,17 +300,89 @@ class DefaultMuleApplicationBuilder {
|
|
|
267
300
|
}
|
|
268
301
|
}
|
|
269
302
|
exports.DefaultMuleApplicationBuilder = DefaultMuleApplicationBuilder;
|
|
303
|
+
/**
|
|
304
|
+
* Default implementation of DefaultAgentGraphBuilder
|
|
305
|
+
*/
|
|
306
|
+
class DefaultAgentGraphBuilder {
|
|
307
|
+
constructor(id, dependencies = []) {
|
|
308
|
+
this.tracingVal = false;
|
|
309
|
+
this.connectionReferences = [];
|
|
310
|
+
this.credentialList = [];
|
|
311
|
+
this.requiredVariables = [];
|
|
312
|
+
this.id = id;
|
|
313
|
+
this.dependencies = dependencies;
|
|
314
|
+
}
|
|
315
|
+
asset(identity) {
|
|
316
|
+
this.assetIdentity = identity;
|
|
317
|
+
return this;
|
|
318
|
+
}
|
|
319
|
+
name(name) {
|
|
320
|
+
this.nameVal = name;
|
|
321
|
+
return this;
|
|
322
|
+
}
|
|
323
|
+
properties(properties) {
|
|
324
|
+
this.propertiesMap = properties;
|
|
325
|
+
return this;
|
|
326
|
+
}
|
|
327
|
+
securedProperties(securedProperties) {
|
|
328
|
+
this.securedPropertiesMap = securedProperties;
|
|
329
|
+
return this;
|
|
330
|
+
}
|
|
331
|
+
variables(variables) {
|
|
332
|
+
this._variables = variables;
|
|
333
|
+
return this;
|
|
334
|
+
}
|
|
335
|
+
runtimeVersion(version) {
|
|
336
|
+
this.runtimeVer = version;
|
|
337
|
+
return this;
|
|
338
|
+
}
|
|
339
|
+
tracing(enabled) {
|
|
340
|
+
this.tracingVal = enabled;
|
|
341
|
+
return this;
|
|
342
|
+
}
|
|
343
|
+
requiresConnection(asset, type, connectionId) {
|
|
344
|
+
this.connectionReferences.push({ asset, type, connectionId });
|
|
345
|
+
return this;
|
|
346
|
+
}
|
|
347
|
+
requiresCredentials(credentialId) {
|
|
348
|
+
this.credentialList.push(credentialId);
|
|
349
|
+
return this;
|
|
350
|
+
}
|
|
351
|
+
requiresVariable(variableName) {
|
|
352
|
+
this.requiredVariables.push(variableName);
|
|
353
|
+
return this;
|
|
354
|
+
}
|
|
355
|
+
build() {
|
|
356
|
+
return {
|
|
357
|
+
id: this.id,
|
|
358
|
+
name: this.nameVal,
|
|
359
|
+
asset: this.assetIdentity ? {
|
|
360
|
+
groupId: this.assetIdentity.groupId,
|
|
361
|
+
assetId: this.assetIdentity.assetId,
|
|
362
|
+
version: (0, network_lock_1.resolveVersionSlot)(this.assetIdentity, this.dependencies),
|
|
363
|
+
} : { groupId: '', assetId: '', version: '' },
|
|
364
|
+
properties: this.propertiesMap,
|
|
365
|
+
securedProperties: this.securedPropertiesMap,
|
|
366
|
+
variables: this._variables,
|
|
367
|
+
runtimeVer: this.runtimeVer,
|
|
368
|
+
connections: this.connectionReferences,
|
|
369
|
+
tracingEnabled: this.tracingVal,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
exports.DefaultAgentGraphBuilder = DefaultAgentGraphBuilder;
|
|
270
374
|
/**
|
|
271
375
|
* Default implementation of ConnectionBuilder
|
|
272
376
|
*/
|
|
273
377
|
class DefaultConnectionBuilder {
|
|
274
|
-
constructor(id) {
|
|
378
|
+
constructor(id, dependencies = []) {
|
|
275
379
|
this.upstreamUrlVal = '';
|
|
276
380
|
this.endpointPathVal = '';
|
|
277
381
|
this._inboundPolicies = [];
|
|
278
382
|
this._outboundPolicies = [];
|
|
279
383
|
this.variableList = [];
|
|
280
384
|
this.id = id;
|
|
385
|
+
this.dependencies = dependencies;
|
|
281
386
|
}
|
|
282
387
|
inboundPolicies(policyBindings) {
|
|
283
388
|
this._inboundPolicies = [...this._inboundPolicies, ...policyBindings];
|
|
@@ -291,8 +396,8 @@ class DefaultConnectionBuilder {
|
|
|
291
396
|
this.typ = type;
|
|
292
397
|
return this;
|
|
293
398
|
}
|
|
294
|
-
asset(
|
|
295
|
-
this.
|
|
399
|
+
asset(identity) {
|
|
400
|
+
this.assetIdentity = identity;
|
|
296
401
|
return this;
|
|
297
402
|
}
|
|
298
403
|
label(label) {
|
|
@@ -323,11 +428,19 @@ class DefaultConnectionBuilder {
|
|
|
323
428
|
this.variableList.push(variableName);
|
|
324
429
|
return this;
|
|
325
430
|
}
|
|
431
|
+
environmentInstanceId(id) {
|
|
432
|
+
this.environmentInstanceIdVal = id;
|
|
433
|
+
return this;
|
|
434
|
+
}
|
|
326
435
|
build() {
|
|
327
436
|
return {
|
|
328
437
|
id: this.id,
|
|
329
438
|
type: this.typ || 'connection',
|
|
330
|
-
asset: this.
|
|
439
|
+
asset: this.assetIdentity ? {
|
|
440
|
+
groupId: this.assetIdentity.groupId,
|
|
441
|
+
assetId: this.assetIdentity.assetId,
|
|
442
|
+
version: (0, network_lock_1.resolveVersionSlot)(this.assetIdentity, this.dependencies),
|
|
443
|
+
} : { groupId: '', assetId: '', version: '' },
|
|
331
444
|
label: this.lbl || this.id,
|
|
332
445
|
description: this.desc,
|
|
333
446
|
tags: this.tagList,
|
|
@@ -336,6 +449,7 @@ class DefaultConnectionBuilder {
|
|
|
336
449
|
metadata: this.metadataVal,
|
|
337
450
|
inboundPolicies: this._inboundPolicies,
|
|
338
451
|
outboundPolicies: this._outboundPolicies,
|
|
452
|
+
environmentInstanceId: this.environmentInstanceIdVal,
|
|
339
453
|
};
|
|
340
454
|
}
|
|
341
455
|
}
|
|
@@ -344,15 +458,17 @@ exports.DefaultConnectionBuilder = DefaultConnectionBuilder;
|
|
|
344
458
|
* Default implementation of ComponentBuilder
|
|
345
459
|
*/
|
|
346
460
|
class DefaultComponentBuilder {
|
|
347
|
-
constructor(id) {
|
|
461
|
+
constructor(id, dependencies = []) {
|
|
348
462
|
this.assetMap = new Map();
|
|
349
463
|
this.apiInstanceMap = new Map();
|
|
350
464
|
this.muleAppMap = new Map();
|
|
465
|
+
this.agentGraphMap = new Map();
|
|
351
466
|
this.connectionMap = new Map();
|
|
352
467
|
this.clientMap = new Map();
|
|
353
468
|
this.components = [];
|
|
354
|
-
this._version = '
|
|
469
|
+
this._version = '0.0.0';
|
|
355
470
|
this.id = id;
|
|
471
|
+
this.dependencies = dependencies;
|
|
356
472
|
}
|
|
357
473
|
addComponentDependency(componentID) {
|
|
358
474
|
this.components.push(componentID);
|
|
@@ -370,8 +486,8 @@ class DefaultComponentBuilder {
|
|
|
370
486
|
this.assetMap.set(id, builder);
|
|
371
487
|
return builder;
|
|
372
488
|
}
|
|
373
|
-
addAPIInstance(id,
|
|
374
|
-
const instance = new DefaultAPIInstanceBuilder(id,
|
|
489
|
+
addAPIInstance(id, assetIdentity) {
|
|
490
|
+
const instance = new DefaultAPIInstanceBuilder(id, assetIdentity, this.dependencies);
|
|
375
491
|
this.apiInstanceMap.set(id, instance);
|
|
376
492
|
return instance;
|
|
377
493
|
}
|
|
@@ -379,12 +495,17 @@ class DefaultComponentBuilder {
|
|
|
379
495
|
return this.apiInstanceMap.get(id);
|
|
380
496
|
}
|
|
381
497
|
addMuleDeployment(id) {
|
|
382
|
-
const muleDeployment = new DefaultMuleApplicationBuilder(id);
|
|
498
|
+
const muleDeployment = new DefaultMuleApplicationBuilder(id, this.dependencies);
|
|
383
499
|
this.muleAppMap.set(id, muleDeployment);
|
|
384
500
|
return muleDeployment;
|
|
385
501
|
}
|
|
386
|
-
|
|
387
|
-
const
|
|
502
|
+
addAgentGraphDeployment(id) {
|
|
503
|
+
const agentGraphDeployment = new DefaultAgentGraphBuilder(id, this.dependencies);
|
|
504
|
+
this.agentGraphMap.set(id, agentGraphDeployment);
|
|
505
|
+
return agentGraphDeployment;
|
|
506
|
+
}
|
|
507
|
+
addConnection(id, assetIdentity) {
|
|
508
|
+
const connection = new DefaultConnectionBuilder(id, this.dependencies).asset(assetIdentity);
|
|
388
509
|
this.connectionMap.set(id, connection);
|
|
389
510
|
return connection;
|
|
390
511
|
}
|
|
@@ -399,10 +520,13 @@ class DefaultComponentBuilder {
|
|
|
399
520
|
assets: Object.fromEntries([...this.assetMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
400
521
|
apiInstances: Object.fromEntries([...this.apiInstanceMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
401
522
|
muleApplications: Object.fromEntries([...this.muleAppMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
523
|
+
agentGraphs: Object.fromEntries([...this.agentGraphMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
402
524
|
connections: Object.fromEntries([...this.connectionMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
403
525
|
clients: Object.fromEntries([...this.clientMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
404
526
|
dependencies: this.components,
|
|
405
527
|
version: this._version,
|
|
528
|
+
// Only serialized via emit() (which computes the real rank); never consumed for ordering.
|
|
529
|
+
rank: publication_rank_1.NETWORK_RANK,
|
|
406
530
|
};
|
|
407
531
|
}
|
|
408
532
|
}
|
|
@@ -411,10 +535,12 @@ exports.DefaultComponentBuilder = DefaultComponentBuilder;
|
|
|
411
535
|
* Default implementation of SpaceBuilder
|
|
412
536
|
*/
|
|
413
537
|
class DefaultSpaceBuilder {
|
|
414
|
-
constructor(gav) {
|
|
538
|
+
constructor(gav, apiVersion, dependencies) {
|
|
415
539
|
this.componentMap = new Map();
|
|
416
540
|
this.variableMap = new Map();
|
|
417
541
|
this._gav = gav;
|
|
542
|
+
this._apiVersion = apiVersion;
|
|
543
|
+
this._dependencies = dependencies;
|
|
418
544
|
}
|
|
419
545
|
searchAsset(assetId) {
|
|
420
546
|
// search in componentMap inside each component an asset with this type
|
|
@@ -427,12 +553,16 @@ class DefaultSpaceBuilder {
|
|
|
427
553
|
return undefined;
|
|
428
554
|
}
|
|
429
555
|
addComponent(id) {
|
|
430
|
-
const builder = new DefaultComponentBuilder(id);
|
|
556
|
+
const builder = new DefaultComponentBuilder(id, this._dependencies || []);
|
|
431
557
|
this.componentMap.set(id, builder);
|
|
432
558
|
return builder;
|
|
433
559
|
}
|
|
434
560
|
getComponent(id) {
|
|
435
|
-
|
|
561
|
+
const component = this.componentMap.get(id);
|
|
562
|
+
if (!component) {
|
|
563
|
+
return undefined;
|
|
564
|
+
}
|
|
565
|
+
return component;
|
|
436
566
|
}
|
|
437
567
|
addVariable(id) {
|
|
438
568
|
const variableBuilder = new DefaultVariableBuilder(id);
|
|
@@ -444,6 +574,8 @@ class DefaultSpaceBuilder {
|
|
|
444
574
|
components: Object.fromEntries([...this.componentMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
445
575
|
variables: Object.fromEntries([...this.variableMap.entries()].map(([id, builder]) => [id, builder.build()])),
|
|
446
576
|
gav: this._gav,
|
|
577
|
+
apiVersion: this._apiVersion,
|
|
578
|
+
dependencies: this._dependencies,
|
|
447
579
|
};
|
|
448
580
|
}
|
|
449
581
|
}
|
|
@@ -466,6 +598,8 @@ class DefaultStageContextBuilder {
|
|
|
466
598
|
this.organizationId = '';
|
|
467
599
|
this.mulesoftOrg = '';
|
|
468
600
|
this.updateAPISource = false;
|
|
601
|
+
this.hardDelete = false;
|
|
602
|
+
this.targetDir = '';
|
|
469
603
|
this.req = req;
|
|
470
604
|
}
|
|
471
605
|
withTracingDisabled(disableTracing) {
|
|
@@ -495,6 +629,7 @@ class DefaultStageContextBuilder {
|
|
|
495
629
|
this.mulesoftOrg = (0, utils_1.getMulesoftOrg)(this.host);
|
|
496
630
|
this.json = Boolean(flags.json);
|
|
497
631
|
this.updateAPISource = Boolean(flags['force-ownership']);
|
|
632
|
+
this.hardDelete = Boolean(flags['hard-delete']);
|
|
498
633
|
return this;
|
|
499
634
|
}
|
|
500
635
|
withGateways(gateways) {
|
|
@@ -511,11 +646,37 @@ class DefaultStageContextBuilder {
|
|
|
511
646
|
this.organizationId = session.selectedOrganization.id;
|
|
512
647
|
return this;
|
|
513
648
|
}
|
|
649
|
+
withTargetDir(targetDir) {
|
|
650
|
+
this.targetDir = targetDir;
|
|
651
|
+
return this;
|
|
652
|
+
}
|
|
514
653
|
build() {
|
|
515
|
-
return new project_builder_1.StageContext(this.req, this.gateways, this.runtimeTarget, this.properties, this.anypointLowerEnv, this.debugMode, this.disableTracing, this.dontWait, this.json, this.maxRetries, this.requestTimeout, this.host, this.environmentId, this.organizationId, this.mulesoftOrg, this.updateAPISource);
|
|
654
|
+
return new project_builder_1.StageContext(this.req, this.gateways, this.runtimeTarget, this.properties, this.anypointLowerEnv, this.debugMode, this.disableTracing, this.dontWait, this.json, this.maxRetries, this.requestTimeout, this.host, this.environmentId, this.organizationId, this.mulesoftOrg, this.updateAPISource, this.hardDelete, this.targetDir);
|
|
516
655
|
}
|
|
517
656
|
}
|
|
518
657
|
exports.DefaultStageContextBuilder = DefaultStageContextBuilder;
|
|
658
|
+
/**
|
|
659
|
+
* Workspace builder for file-based operations (for compatibility with existing tests)
|
|
660
|
+
*/
|
|
661
|
+
class DefaultWorkspaceBuilder {
|
|
662
|
+
constructor() {
|
|
663
|
+
this.components = [];
|
|
664
|
+
}
|
|
665
|
+
addComponent(id) {
|
|
666
|
+
this.components.push(id);
|
|
667
|
+
return this;
|
|
668
|
+
}
|
|
669
|
+
dump(target) {
|
|
670
|
+
const path = require('path');
|
|
671
|
+
const fs = require('fs');
|
|
672
|
+
const tmpPath = path.join('/tmp', target.name);
|
|
673
|
+
const content = JSON.stringify({
|
|
674
|
+
projects: this.components,
|
|
675
|
+
}, null, 2);
|
|
676
|
+
fs.writeFileSync(tmpPath, content);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
exports.DefaultWorkspaceBuilder = DefaultWorkspaceBuilder;
|
|
519
680
|
class DefaultStageResultRegistry {
|
|
520
681
|
constructor() {
|
|
521
682
|
this.results = {};
|