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,4 +1,9 @@
|
|
|
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
8
|
exports.ErrorFactory = void 0;
|
|
4
9
|
const base_error_1 = require("./base-error");
|
|
@@ -42,7 +47,7 @@ exports.ErrorFactory = {
|
|
|
42
47
|
},
|
|
43
48
|
buildBrokersAppError(status) {
|
|
44
49
|
const code = 1008;
|
|
45
|
-
const message = `Error while building the Brokers App. Please check the logs for more details
|
|
50
|
+
const message = `Error while building the Brokers App. Please check the logs for more details. Exit code: '${status}'.`;
|
|
46
51
|
throw new base_error_1.BaseError(code, message);
|
|
47
52
|
},
|
|
48
53
|
variablesNotFound(variables) {
|
|
@@ -75,6 +80,74 @@ exports.ErrorFactory = {
|
|
|
75
80
|
const message = `Unsupported Agent Network schema version '${schemaVersion}'. Supported versions: ${supported}.`;
|
|
76
81
|
throw new base_error_1.BaseError(code, message);
|
|
77
82
|
},
|
|
83
|
+
validationConnectionsError(orphanConnections, invalidKindConnections) {
|
|
84
|
+
const code = 1014;
|
|
85
|
+
let message = '';
|
|
86
|
+
if (orphanConnections.length > 0) {
|
|
87
|
+
const noun = orphanConnections.length === 1 ? 'connection' : 'connections';
|
|
88
|
+
message = `The ${noun} ${orphanConnections.join(', ')} ${orphanConnections.length === 1 ? 'is' : 'are'} not defined in the Agent Network.`;
|
|
89
|
+
}
|
|
90
|
+
if (invalidKindConnections.length > 0) {
|
|
91
|
+
const noun = invalidKindConnections.length === 1 ? 'connection' : 'connections';
|
|
92
|
+
const kindList = invalidKindConnections.map(c => `${c.name} has kind ${c.agentKind} but should be ${c.networkKind}`).join(', ');
|
|
93
|
+
const invalidKindMessage = `The ${noun} ${kindList}.`;
|
|
94
|
+
message = message.length === 0 ? invalidKindMessage : `${message}. ${invalidKindMessage}`;
|
|
95
|
+
}
|
|
96
|
+
throw new base_error_1.BaseError(code, message);
|
|
97
|
+
},
|
|
98
|
+
noBrokerForImplementation(implementation) {
|
|
99
|
+
const code = 1015;
|
|
100
|
+
const message = `No broker defined for implementation ${implementation}.`;
|
|
101
|
+
throw new base_error_1.BaseError(code, message);
|
|
102
|
+
},
|
|
103
|
+
unsupportedToolType(entity) {
|
|
104
|
+
const code = 1016;
|
|
105
|
+
const message = `Unknown tool type in '${entity}'.`;
|
|
106
|
+
throw new base_error_1.BaseError(code, message);
|
|
107
|
+
},
|
|
108
|
+
invalidAgentScriptPath(entity) {
|
|
109
|
+
const code = 1017;
|
|
110
|
+
const message = `Invalid agent script path or unsafe content for: '${entity}'.`;
|
|
111
|
+
throw new base_error_1.BaseError(code, message);
|
|
112
|
+
},
|
|
113
|
+
errorParsingAgentFile(fileName, error) {
|
|
114
|
+
const code = 1018;
|
|
115
|
+
const message = `Error while trying to parse ${fileName}.`;
|
|
116
|
+
throw new base_error_1.BaseError(code, message, error);
|
|
117
|
+
},
|
|
118
|
+
policyBindingNotFound(name) {
|
|
119
|
+
const code = 1019;
|
|
120
|
+
const message = `Policy binding with name '${name}' was not found.`;
|
|
121
|
+
throw new base_error_1.BaseError(code, message);
|
|
122
|
+
},
|
|
123
|
+
brokerKindMismatch(implementation, kind, brokerKind) {
|
|
124
|
+
const code = 1020;
|
|
125
|
+
const message = `Broker for implementation '${implementation}' does not support interface kind '${kind}'. Broker kind is '${brokerKind}'.`;
|
|
126
|
+
throw new base_error_1.BaseError(code, message);
|
|
127
|
+
},
|
|
128
|
+
brokerIdMismatch(implementation, targetBrokerId, brokerId) {
|
|
129
|
+
const code = 1021;
|
|
130
|
+
const message = `Broker ID mismatch for implementation '${implementation}'. Expected '${brokerId}' but found '${targetBrokerId}'.`;
|
|
131
|
+
throw new base_error_1.BaseError(code, message);
|
|
132
|
+
},
|
|
133
|
+
invalidAgentNetworkProjectDescriptor(details) {
|
|
134
|
+
const code = 1022;
|
|
135
|
+
const message = `Agent Network project descriptor is invalid. Details: ${details}.`;
|
|
136
|
+
throw new base_error_1.BaseError(code, message);
|
|
137
|
+
},
|
|
138
|
+
brokerSupportedInterfacesUrlMismatch(brokerId, baseUrls) {
|
|
139
|
+
const code = 1023;
|
|
140
|
+
const baseUrlList = baseUrls.map(baseUrl => `'${baseUrl}'`).join(', ');
|
|
141
|
+
const message = `Broker '${brokerId}' has supported interfaces with different base URLs in 'interfaces.a2a.card.supportedInterfaces'. All supported interfaces must share the same base URL (scheme, host, and port); they may differ only on path. Found base URLs: ${baseUrlList}.`;
|
|
142
|
+
throw new base_error_1.BaseError(code, message);
|
|
143
|
+
},
|
|
144
|
+
brokerUnsupportedProtocolBinding(brokerId, binding, supported) {
|
|
145
|
+
const code = 1024;
|
|
146
|
+
const found = binding ? `'${binding}'` : 'a missing value';
|
|
147
|
+
const supportedList = supported.map(value => `'${value}'`).join(', ');
|
|
148
|
+
const message = `Broker '${brokerId}' has an unsupported 'protocolBinding' (${found}) in 'interfaces.a2a.card.supportedInterfaces'. Supported values are: ${supportedList}.`;
|
|
149
|
+
throw new base_error_1.BaseError(code, message);
|
|
150
|
+
},
|
|
78
151
|
// Publish errors
|
|
79
152
|
organizationAccessError(groupId) {
|
|
80
153
|
const code = 2001;
|
|
@@ -98,54 +171,74 @@ exports.ErrorFactory = {
|
|
|
98
171
|
},
|
|
99
172
|
assetTypeMismatchError(assetGAV, typeToPublish, exchangeResult) {
|
|
100
173
|
const code = 2005;
|
|
101
|
-
const message = `Error trying to publish asset with group-id:'${assetGAV.groupId}', asset-id:'${assetGAV.assetId}',
|
|
102
|
-
`version:'${assetGAV.version}' and type:'${typeToPublish}'. ` +
|
|
103
|
-
`Asset already exists with type:'${exchangeResult.type}' and version:'${exchangeResult.version}'.`;
|
|
174
|
+
const message = `Error trying to publish asset with group-id:'${assetGAV.groupId}', asset-id:'${assetGAV.assetId}', version:'${assetGAV.version}' and type:'${typeToPublish}'. Asset already exists with type:'${exchangeResult.type}' and version:'${exchangeResult.version}'.`;
|
|
104
175
|
throw new base_error_1.BaseError(code, message);
|
|
105
176
|
},
|
|
106
|
-
|
|
177
|
+
ownershipConflictsError(assetLabel, project) {
|
|
107
178
|
const code = 2006;
|
|
108
|
-
const message = `
|
|
109
|
-
|
|
110
|
-
throw new base_error_1.BaseError(code, message, error);
|
|
179
|
+
const message = `Asset '${assetLabel}' belongs to another project '${project}'.`;
|
|
180
|
+
return new base_error_1.BaseError(code, message);
|
|
111
181
|
},
|
|
112
182
|
// Deploy errors
|
|
183
|
+
throwCreateApiError(apiLabel, error) {
|
|
184
|
+
throw this.createApiError(apiLabel, error);
|
|
185
|
+
},
|
|
113
186
|
createApiError(apiLabel, error, additionalMessage) {
|
|
114
187
|
const code = 3001;
|
|
115
188
|
const message = `Error while trying to create '${apiLabel}' in API Manager.` + (additionalMessage ? ` ${additionalMessage}` : '');
|
|
116
189
|
return new base_error_1.BaseError(code, message, error);
|
|
117
190
|
},
|
|
191
|
+
throwApplyPolicyError(groupId, assetId, version, error) {
|
|
192
|
+
throw this.applyPolicyError(groupId, assetId, version, error);
|
|
193
|
+
},
|
|
118
194
|
applyPolicyError(groupId, assetId, version, error) {
|
|
119
195
|
const code = 3002;
|
|
120
196
|
const message = `Error while trying to apply policy: '${groupId}:${assetId}:${version}'.`;
|
|
121
197
|
return new base_error_1.BaseError(code, message, error);
|
|
122
198
|
},
|
|
199
|
+
throwOutboundPolicyError(groupId, assetId, version, error) {
|
|
200
|
+
throw this.outboundPolicyError(groupId, assetId, version, error);
|
|
201
|
+
},
|
|
123
202
|
outboundPolicyError(groupId, assetId, version, error) {
|
|
124
203
|
const code = 3003;
|
|
125
204
|
const message = `Error while trying to apply outbound policy: '${groupId}:${assetId}:${version}'.`;
|
|
126
205
|
return new base_error_1.BaseError(code, message, error);
|
|
127
206
|
},
|
|
207
|
+
throwDeployError(apiLabel, gatewayName, error) {
|
|
208
|
+
throw this.deployError(apiLabel, gatewayName, error);
|
|
209
|
+
},
|
|
128
210
|
deployError(apiLabel, gatewayName, error) {
|
|
129
211
|
const code = 3004;
|
|
130
212
|
const message = `Error while trying to deploy '${apiLabel}' into '${gatewayName}'.`;
|
|
131
213
|
return new base_error_1.BaseError(code, message, error);
|
|
132
214
|
},
|
|
215
|
+
throwConnectionNotFoundError(groupId, assetId, version) {
|
|
216
|
+
throw this.connectionNotFoundError(groupId, assetId, version);
|
|
217
|
+
},
|
|
133
218
|
connectionNotFoundError(groupId, assetId, version) {
|
|
134
219
|
const code = 3005;
|
|
135
220
|
const message = `Unable to find a connection for '${groupId}:${assetId}:${version}'.`;
|
|
136
221
|
return new base_error_1.BaseError(code, message);
|
|
137
222
|
},
|
|
223
|
+
throwGettingEgressConnectionError(targetId, runtimeVersion, organizationId, environmentId, error) {
|
|
224
|
+
throw this.gettingEgressConnectionError(targetId, runtimeVersion, organizationId, environmentId, error);
|
|
225
|
+
},
|
|
138
226
|
gettingEgressConnectionError(targetId, runtimeVersion, organizationId, environmentId, error) {
|
|
139
227
|
const code = 3006;
|
|
140
|
-
const message = `Error while trying to get egress connection for target '${targetId}'
|
|
141
|
-
`with runtime version '${runtimeVersion}' in organization '${organizationId}' and environment '${environmentId}'.`;
|
|
228
|
+
const message = `Error while trying to get egress connection for target '${targetId}' with runtime version '${runtimeVersion}' in organization '${organizationId}' and environment '${environmentId}'.`;
|
|
142
229
|
return new base_error_1.BaseError(code, message, error);
|
|
143
230
|
},
|
|
231
|
+
throwDeployAPIError(error) {
|
|
232
|
+
throw this.deployAPIError(error);
|
|
233
|
+
},
|
|
144
234
|
deployAPIError(error) {
|
|
145
235
|
const code = 3007;
|
|
146
236
|
const message = 'Error while trying to deploy an API.';
|
|
147
237
|
return new base_error_1.BaseError(code, message, error);
|
|
148
238
|
},
|
|
239
|
+
throwBrokerGroupDeploymentError() {
|
|
240
|
+
throw this.brokerGroupDeploymentError();
|
|
241
|
+
},
|
|
149
242
|
brokerGroupDeploymentError() {
|
|
150
243
|
const code = 3008;
|
|
151
244
|
const message = 'Broker group deployment failed. Please check the logs for more details.';
|
|
@@ -153,14 +246,20 @@ exports.ErrorFactory = {
|
|
|
153
246
|
},
|
|
154
247
|
unableToResolve(ref) {
|
|
155
248
|
const code = 3009;
|
|
156
|
-
const message = `Unable to resolve: groupId:'${ref.groupId}' assetId:'${ref.assetId}' version:'${ref.version}'.`;
|
|
157
|
-
|
|
249
|
+
const message = `Unable to resolve: groupId:'${ref.groupId}' assetId:'${ref.assetId}' version:'${ref.version}'. Please verify that the project has been built and published before running the deploy command.`;
|
|
250
|
+
throw new base_error_1.BaseError(code, message);
|
|
251
|
+
},
|
|
252
|
+
throwCreatePatchApiError(apiLabel, error) {
|
|
253
|
+
throw this.createPatchApiError(apiLabel, error);
|
|
158
254
|
},
|
|
159
255
|
createPatchApiError(apiLabel, error) {
|
|
160
256
|
const code = 3010;
|
|
161
257
|
const message = `Error while trying to update '${apiLabel}' in API Manager.`;
|
|
162
258
|
return new base_error_1.BaseError(code, message, error);
|
|
163
259
|
},
|
|
260
|
+
throwDeletePolicyError(apiLabel, policyId, error) {
|
|
261
|
+
throw this.deletePolicyError(apiLabel, policyId, error);
|
|
262
|
+
},
|
|
164
263
|
deletePolicyError(apiLabel, policyId, error) {
|
|
165
264
|
const code = 3011;
|
|
166
265
|
const message = `Error while trying to delete policy '${policyId}' '${apiLabel}' in API Manager.`;
|
|
@@ -169,36 +268,22 @@ exports.ErrorFactory = {
|
|
|
169
268
|
noTranscodingFoundFor(transcoding) {
|
|
170
269
|
const code = 3012;
|
|
171
270
|
const message = `No Transcoding policy found for ${transcoding}.`;
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
requestFailed(status, maxRetries) {
|
|
175
|
-
const code = 3013;
|
|
176
|
-
const message = `Request to check the status of the deploying application failed after ${maxRetries} attempts. Last status: ${status}`;
|
|
177
|
-
return new base_error_1.BaseError(code, message);
|
|
178
|
-
},
|
|
179
|
-
requestFailedWithError(maxRetries, error) {
|
|
180
|
-
const code = 3014;
|
|
181
|
-
const message = `Request to check the status of the deploying application failed after ${maxRetries} attempts with error.`;
|
|
182
|
-
return new base_error_1.BaseError(code, message, error);
|
|
271
|
+
throw new base_error_1.BaseError(code, message);
|
|
183
272
|
},
|
|
184
|
-
gatewayTargetSpaceError(ingressGW, egressGW,
|
|
273
|
+
gatewayTargetSpaceError(ingressGW, egressGW, runtimeTarget) {
|
|
185
274
|
const code = 3015;
|
|
186
|
-
const message =
|
|
187
|
-
|
|
188
|
-
`is not compatible with the ingress gateway '${ingressGW.name}' target '${ingressGW.targetName}' (ID: ${ingressGW.id}) ` +
|
|
189
|
-
`and egress gateway '${egressGW.name} (ID: ${egressGW.id})' target '${egressGW.targetName}'`;
|
|
190
|
-
return new base_error_1.BaseError(code, message);
|
|
275
|
+
const message = `There is a target space mismatch error between the gateways and the target space. Target space '${runtimeTarget.name}' (ID: ${runtimeTarget.id}) of type '${runtimeTarget.type}' is not compatible with the ingress gateway '${ingressGW.name}' target '${ingressGW.targetName}' (ID: ${ingressGW.id}) and egress gateway '${egressGW.name} (ID: ${egressGW.id})' target '${egressGW.targetName}'`;
|
|
276
|
+
throw new base_error_1.BaseError(code, message);
|
|
191
277
|
},
|
|
192
278
|
createApiSpecNotFound(apiLabel, type) {
|
|
193
279
|
const code = 3016;
|
|
194
|
-
const message = `Asset '${apiLabel.groupId}:${apiLabel.assetId}:${apiLabel.version}' of type '${type}'
|
|
195
|
-
'does not exist in Exchange. Please, publish your Agent Network before deploying.';
|
|
280
|
+
const message = `Asset '${apiLabel.groupId}:${apiLabel.assetId}:${apiLabel.version}' of type '${type}' does not exist in Exchange. Please, publish your Agent Network before deploying.`;
|
|
196
281
|
throw new base_error_1.BaseError(code, message);
|
|
197
282
|
},
|
|
198
283
|
requestTimeout(command, time) {
|
|
199
284
|
const code = 3017;
|
|
200
285
|
const message = `❌ Failed to ${command} the application due to request timeout (${time}ms). Please try again later.`;
|
|
201
|
-
|
|
286
|
+
throw new base_error_1.BaseError(code, message);
|
|
202
287
|
},
|
|
203
288
|
commandTimeout(command, time, requestId, steps) {
|
|
204
289
|
const code = 3018;
|
|
@@ -219,63 +304,86 @@ exports.ErrorFactory = {
|
|
|
219
304
|
},
|
|
220
305
|
nonPublishedAssetsFoundError(nonPublishedAssets) {
|
|
221
306
|
const code = 3020;
|
|
222
|
-
const assetList = nonPublishedAssets.map(asset =>
|
|
223
|
-
|
|
224
|
-
|
|
307
|
+
const assetList = nonPublishedAssets.map(asset => {
|
|
308
|
+
const parts = [`Group ID: ${asset.groupId}`, `Asset ID: ${asset.assetId}`];
|
|
309
|
+
if (asset.version) {
|
|
310
|
+
parts.push(`Version: ${asset.version}`);
|
|
311
|
+
}
|
|
312
|
+
else if (asset.versionGroup) {
|
|
313
|
+
parts.push(`Version group: ${asset.versionGroup}`);
|
|
314
|
+
}
|
|
315
|
+
return `[${parts.join(', ')}]`;
|
|
316
|
+
}).join(', ');
|
|
317
|
+
const message = `Agent Network project must be published to Exchange before deployment. The following assets were not found in Exchange: ${assetList}.`;
|
|
225
318
|
return new base_error_1.BaseError(code, message);
|
|
226
319
|
},
|
|
320
|
+
throwNoGatewayFoundForInstance(instance, protectionDirection) {
|
|
321
|
+
throw this.noGatewayFoundForInstance(instance, protectionDirection);
|
|
322
|
+
},
|
|
227
323
|
noGatewayFoundForInstance(instance, protectionDirection) {
|
|
228
324
|
const code = 3021;
|
|
229
325
|
const message = `No gateway specified for API instance ${instance} with protection direction ${protectionDirection}.`;
|
|
230
326
|
return new base_error_1.BaseError(code, message);
|
|
231
327
|
},
|
|
328
|
+
throwAssetNotFoundForInstance(instance, asset) {
|
|
329
|
+
throw this.assetNotFoundForInstance(instance, asset);
|
|
330
|
+
},
|
|
232
331
|
assetNotFoundForInstance(instance, asset) {
|
|
233
332
|
const code = 3022;
|
|
234
333
|
const message = `Failed to deploy instance ${instance}. Asset ${asset.groupId}:${asset.assetId}:${asset.version} was not found in Exchange.`;
|
|
235
334
|
return new base_error_1.BaseError(code, message);
|
|
236
335
|
},
|
|
336
|
+
throwAssetNotFoundForConnection(connection, asset) {
|
|
337
|
+
throw this.assetNotFoundForConnection(connection, asset);
|
|
338
|
+
},
|
|
237
339
|
assetNotFoundForConnection(connection, asset) {
|
|
238
340
|
const code = 3023;
|
|
239
341
|
const message = `Failed to deploy connection ${connection}. Asset ${asset.groupId}:${asset.assetId}:${asset.version} was not found in Exchange.`;
|
|
240
342
|
return new base_error_1.BaseError(code, message);
|
|
241
343
|
},
|
|
344
|
+
throwMissingRequiredUpstreamUrl(instance) {
|
|
345
|
+
throw this.missingRequiredUpstreamUrl(instance);
|
|
346
|
+
},
|
|
242
347
|
missingRequiredUpstreamUrl(instance) {
|
|
243
348
|
const code = 3024;
|
|
244
349
|
const message = `Missing upstream URL for instance ${instance}.`;
|
|
245
|
-
|
|
350
|
+
throw new base_error_1.BaseError(code, message);
|
|
246
351
|
},
|
|
247
352
|
dependencyFailure(component, facet, stage) {
|
|
248
353
|
const code = 3025;
|
|
249
|
-
const message = `Stage ${stage} of ${facet} facet for component ${component} was aborted due to a failure
|
|
250
|
-
'in a dependant deployment task. Please check for any error messages in the command output.';
|
|
354
|
+
const message = `Stage ${stage} of ${facet} facet for component ${component} was aborted due to a failure in a dependant deployment task. Please check for any error messages in the command output.`;
|
|
251
355
|
return new base_error_1.BaseError(code, message);
|
|
252
356
|
},
|
|
253
|
-
apiBelongsToAnotherProject(
|
|
357
|
+
apiBelongsToAnotherProject(instanceType, instanceId, project) {
|
|
254
358
|
const code = 3026;
|
|
255
|
-
const message = `
|
|
359
|
+
const message = `Duplicated ${instanceType} name: ${instanceId}. This ${instanceType} is already defined in project '${project}'. Please choose a different name or reuse the existing ${instanceType}.`;
|
|
256
360
|
return new base_error_1.BaseError(code, message);
|
|
257
361
|
},
|
|
258
362
|
invalidSourceValue(source, label) {
|
|
259
363
|
const code = 3027;
|
|
260
364
|
const message = `Invalid source value for ${source} for ${label}.`;
|
|
261
|
-
|
|
365
|
+
throw new base_error_1.BaseError(code, message);
|
|
262
366
|
},
|
|
263
|
-
|
|
367
|
+
agentGraphDeploymentError() {
|
|
264
368
|
const code = 3028;
|
|
265
|
-
const message =
|
|
369
|
+
const message = 'Agent Graph deployment failed. Please check the logs for more details.';
|
|
266
370
|
return new base_error_1.BaseError(code, message);
|
|
267
371
|
},
|
|
268
372
|
connectionRefNotFoundError(groupId, assetId, connectionName) {
|
|
269
373
|
const code = 3029;
|
|
270
374
|
const message = `Connection '${connectionName}' not found for asset '${groupId}:${assetId}'. ` +
|
|
271
|
-
'Verify the connection is
|
|
375
|
+
'Verify the connection is published and the name in \'connection.ref.name\' matches a defined connection.';
|
|
272
376
|
return new base_error_1.BaseError(code, message);
|
|
273
377
|
},
|
|
378
|
+
missingGatewayForSharedSpace() {
|
|
379
|
+
const code = 3032;
|
|
380
|
+
const message = 'Shared space deployment requires a gateway to set affinityDeploymentId, but none was provided.';
|
|
381
|
+
throw new base_error_1.BaseError(code, message);
|
|
382
|
+
},
|
|
274
383
|
// Gateways setup errors
|
|
275
384
|
noDomainsFound(organizationId, environmentId, targetSpace, reason) {
|
|
276
385
|
const code = 4001;
|
|
277
|
-
const message = `No domains found for organization ID '${organizationId}', environment ID '${environmentId}'
|
|
278
|
-
`and target-space '${targetSpace}'. Make sure that a private network is created in the target space '${targetSpace}'.`;
|
|
386
|
+
const message = `No domains found for organization ID '${organizationId}', environment ID '${environmentId}' and target-space '${targetSpace}'. Make sure that a private network is created in the target space '${targetSpace}'.`;
|
|
279
387
|
throw new base_error_1.BaseError(code, message, reason);
|
|
280
388
|
},
|
|
281
389
|
setupIngressGatewayError(ingress, error) {
|
|
@@ -308,15 +416,12 @@ exports.ErrorFactory = {
|
|
|
308
416
|
},
|
|
309
417
|
gatewayNotFoundError(gatewayName, gateways, environmentId, environmentName) {
|
|
310
418
|
const code = 4006;
|
|
311
|
-
const message = `Gateway with name '${gatewayName}' not found in environment '${environmentName}' (ID: ${environmentId}).
|
|
312
|
-
`Available gateways are : ${JSON.stringify(gateways.map(gw => gw.name))}`;
|
|
419
|
+
const message = `Gateway with name '${gatewayName}' not found in environment '${environmentName}' (ID: ${environmentId}). Available gateways are : ${JSON.stringify(gateways.map(gw => gw.name))}`;
|
|
313
420
|
throw new base_error_1.BaseError(code, message);
|
|
314
421
|
},
|
|
315
|
-
|
|
422
|
+
runtimeTargetNotFoundError(runtimeTargetName, runtimeTargets, environmentId, environmentName) {
|
|
316
423
|
const code = 4007;
|
|
317
|
-
const message = `Can't find
|
|
318
|
-
`Available spaces are: ${JSON.stringify(privateSpaces.map(item => item.name))}. ` +
|
|
319
|
-
'To create a private space, see: https://docs.mulesoft.com/cloudhub-2/ps-create-configure';
|
|
424
|
+
const message = `Can't find runtime target: '${runtimeTargetName}' in environment '${environmentName}' (ID: '${environmentId}'). Available spaces are: ${JSON.stringify(runtimeTargets.map(item => item.name))}. To create a runtime target, see: https://docs.mulesoft.com/cloudhub-2/ps-create-configure`;
|
|
320
425
|
throw new base_error_1.BaseError(code, message);
|
|
321
426
|
},
|
|
322
427
|
unableToRetrieveTargetSpaceMetadata(targetSpaceId, status) {
|
|
@@ -344,19 +449,26 @@ exports.ErrorFactory = {
|
|
|
344
449
|
const message = `No gateway versions found for channel '${channelName}'`;
|
|
345
450
|
throw new base_error_1.BaseError(code, message);
|
|
346
451
|
},
|
|
347
|
-
gatewayAlreadyExists(
|
|
452
|
+
gatewayAlreadyExists(gatewayName, environmentName, conflictingTargetSpaceName) {
|
|
348
453
|
const code = 4013;
|
|
349
|
-
const
|
|
454
|
+
const location = conflictingTargetSpaceName ?
|
|
455
|
+
`in environment '${environmentName}' (in target space '${conflictingTargetSpaceName}')` :
|
|
456
|
+
`in environment '${environmentName}' under a different target space`;
|
|
457
|
+
const message = `Gateway name '${gatewayName}' is already in use ${location}. Gateway names must be unique across all target spaces in an environment. Choose a different name.`;
|
|
350
458
|
throw new base_error_1.BaseError(code, message);
|
|
351
459
|
},
|
|
352
460
|
setupGatewayInsufficientResourcesError(resourceId, error) {
|
|
353
461
|
const code = 4014;
|
|
354
462
|
const referenceUrl = '/cloudhub/#/console/home/managed-gateways';
|
|
355
|
-
const message = setupErrorMsg(resourceId)
|
|
356
|
-
' You have reached the maximum number of available gateways for this organization. ' +
|
|
357
|
-
'Delete a gateway or increase your organization limits.';
|
|
463
|
+
const message = `${setupErrorMsg(resourceId)} You have reached the maximum number of available gateways for this organization. Delete a gateway or increase your organization limits.`;
|
|
358
464
|
throw new base_error_1.BaseError(code, message, error, referenceUrl);
|
|
359
465
|
},
|
|
466
|
+
missingDomainsResponse(direction) {
|
|
467
|
+
const code = 4015;
|
|
468
|
+
const message = `Domains not found while resolving the ${direction} gateway public URL for a non-shared target. ` +
|
|
469
|
+
'Domains are required for non-shared targets, but none was found.';
|
|
470
|
+
throw new base_error_1.BaseError(code, message);
|
|
471
|
+
},
|
|
360
472
|
// access-management errors
|
|
361
473
|
noEntitlementForOrganization(organizationId, status) {
|
|
362
474
|
const code = 5001;
|
|
@@ -379,10 +491,10 @@ exports.ErrorFactory = {
|
|
|
379
491
|
const message = `Invalid strategy '${(strategyVersion === null || strategyVersion === void 0 ? void 0 : strategyVersion.strategy) || 'no value'}' version '${(strategyVersion === null || strategyVersion === void 0 ? void 0 : strategyVersion.version) || 'no value'}' for dependency '${dependencyId}'`;
|
|
380
492
|
throw new base_error_1.BaseError(code, message);
|
|
381
493
|
},
|
|
382
|
-
invalidMetadataFile(metadataFilePath) {
|
|
494
|
+
invalidMetadataFile(metadataFilePath, cause) {
|
|
383
495
|
const code = 6004;
|
|
384
496
|
const message = `Invalid metadata file '${metadataFilePath}'`;
|
|
385
|
-
throw new base_error_1.BaseError(code, message);
|
|
497
|
+
throw new base_error_1.BaseError(code, message, cause);
|
|
386
498
|
},
|
|
387
499
|
runtimeDependenciesFileNotFound() {
|
|
388
500
|
const code = 6005;
|
|
@@ -391,7 +503,7 @@ exports.ErrorFactory = {
|
|
|
391
503
|
},
|
|
392
504
|
invalidDependencyVersion(version) {
|
|
393
505
|
const code = 6006;
|
|
394
|
-
const message = `Dependency version '${version}' is invalid. Version should use the SemVer format. Examples:
|
|
506
|
+
const message = `Dependency version '${version}' is invalid. Version should use the SemVer format. Examples: 0.0.0 or 2.1.3`;
|
|
395
507
|
throw new base_error_1.BaseError(code, message);
|
|
396
508
|
},
|
|
397
509
|
// Create command errors
|
|
@@ -402,13 +514,14 @@ exports.ErrorFactory = {
|
|
|
402
514
|
},
|
|
403
515
|
invalidAssetVersion(assetVersion) {
|
|
404
516
|
const code = 7002;
|
|
405
|
-
const message = `Asset version '${assetVersion}' is invalid. Version should use the SemVer format. Examples:
|
|
517
|
+
const message = `Asset version '${assetVersion}' is invalid. Version should use the SemVer format. Examples: 0.0.0 or 2.1.3`;
|
|
406
518
|
throw new base_error_1.BaseError(code, message);
|
|
407
519
|
},
|
|
408
520
|
invalidGroupId(groupId, memberOfOrganizations) {
|
|
409
521
|
const code = 7003;
|
|
410
|
-
const
|
|
411
|
-
|
|
522
|
+
const orgsList = memberOfOrganizations && memberOfOrganizations.length > 0 ?
|
|
523
|
+
memberOfOrganizations.map(org => `${org.name} (${org.id})`).join(', ') : '';
|
|
524
|
+
const orgsMsg = orgsList ? ` You are a member of these orgs: ${orgsList}.` : '';
|
|
412
525
|
const message = `Error: group-id '${groupId}' not found.${orgsMsg}`;
|
|
413
526
|
throw new base_error_1.BaseError(code, message);
|
|
414
527
|
},
|
|
@@ -433,10 +546,10 @@ exports.ErrorFactory = {
|
|
|
433
546
|
const message = `Error while trying to get policy version for '${groupId}:${policyId}'`;
|
|
434
547
|
throw new base_error_1.BaseError(code, message, error);
|
|
435
548
|
},
|
|
436
|
-
policyValidationFailed(
|
|
549
|
+
policyValidationFailed(validationErrors) {
|
|
437
550
|
const code = 8002;
|
|
438
551
|
const message = 'Error while trying to validate policies';
|
|
439
|
-
throw new base_error_1.BaseError(code, message,
|
|
552
|
+
throw new base_error_1.BaseError(code, message, validationErrors);
|
|
440
553
|
},
|
|
441
554
|
schemaNotFoundForAsset(assetId, schemaFileName) {
|
|
442
555
|
const code = 8003;
|
|
@@ -448,16 +561,182 @@ exports.ErrorFactory = {
|
|
|
448
561
|
const message = `Dependency version not found for groupId '${groupId}' and assetId '${assetId}' in the project descriptor file.`;
|
|
449
562
|
throw new base_error_1.BaseError(code, message);
|
|
450
563
|
},
|
|
451
|
-
//
|
|
452
|
-
|
|
453
|
-
const code =
|
|
564
|
+
// undeploy/unpublish errors
|
|
565
|
+
undeployError(message) {
|
|
566
|
+
const code = 3030;
|
|
567
|
+
return new base_error_1.BaseError(code, message);
|
|
568
|
+
},
|
|
569
|
+
unpublishError(message) {
|
|
570
|
+
const code = 2010;
|
|
571
|
+
return new base_error_1.BaseError(code, message);
|
|
572
|
+
},
|
|
573
|
+
incompatibleToolingVersionPublish(expected, got) {
|
|
574
|
+
const code = 2011;
|
|
575
|
+
const message = `The project was built with an incompatible CLI version. Please rebuild your project with the latest CLI version. (expected toolingVersion ${expected}, got ${got})`;
|
|
576
|
+
return new base_error_1.BaseError(code, message);
|
|
577
|
+
},
|
|
578
|
+
projectNotBuiltPublish() {
|
|
579
|
+
const code = 2012;
|
|
580
|
+
const message = 'Project has not been built, please build your Agent Network project before publishing.';
|
|
581
|
+
return new base_error_1.BaseError(code, message);
|
|
582
|
+
},
|
|
583
|
+
invalidPolicy(groupId, policyId, minorVersion) {
|
|
584
|
+
const code = 3031;
|
|
585
|
+
const message = `Empty or invalid metadata response for ${groupId}:${policyId}:${minorVersion}`;
|
|
586
|
+
return new base_error_1.BaseError(code, message);
|
|
587
|
+
},
|
|
588
|
+
invalidGAVFormat(input) {
|
|
589
|
+
const code = 3033;
|
|
590
|
+
const message = `Invalid GAV format: '${input}'. Expected format: 'groupId:assetId:version'.`;
|
|
591
|
+
return new base_error_1.BaseError(code, message);
|
|
592
|
+
},
|
|
593
|
+
parentAssetNotFound(gav) {
|
|
594
|
+
const code = 3034;
|
|
595
|
+
const message = `Parent asset '${gav.groupId}:${gav.assetId}:${gav.version}' not found in Exchange.`;
|
|
596
|
+
return new base_error_1.BaseError(code, message);
|
|
597
|
+
},
|
|
598
|
+
invalidAgentProtocol(groupId, assetId, connectionName) {
|
|
599
|
+
const code = 3036;
|
|
600
|
+
const message = `Agent metadata for '${groupId}:${assetId}' has no protocol declared for connection '${connectionName}'.`;
|
|
601
|
+
return new base_error_1.BaseError(code, message);
|
|
602
|
+
},
|
|
603
|
+
unsupportedAgentProtocol(groupId, assetId, connectionName) {
|
|
604
|
+
const code = 3037;
|
|
605
|
+
const message = `Agent '${groupId}:${assetId}' for connection '${connectionName}' does not expose an A2A protocol (a2a or a2a_v1). Only A2A agents can be connected.`;
|
|
454
606
|
return new base_error_1.BaseError(code, message);
|
|
455
607
|
},
|
|
456
|
-
|
|
608
|
+
networkLockMissing(reason) {
|
|
609
|
+
return new base_error_1.BaseError(3041, reason);
|
|
610
|
+
},
|
|
611
|
+
networkLockMalformed(reason) {
|
|
612
|
+
return new base_error_1.BaseError(3042, reason);
|
|
613
|
+
},
|
|
614
|
+
incompatibleToolingVersionDeploy(expected, got) {
|
|
615
|
+
const code = 3045;
|
|
616
|
+
const message = `The project was built with an incompatible CLI version. Please rebuild your project with the latest CLI version and then republish. (expected toolingVersion ${expected}, got ${got})`;
|
|
617
|
+
return new base_error_1.BaseError(code, message);
|
|
618
|
+
},
|
|
619
|
+
projectNotBuiltDeploy() {
|
|
620
|
+
const code = 3046;
|
|
621
|
+
const message = 'Project has not been built, please build your Agent Network project before deploying.';
|
|
622
|
+
return new base_error_1.BaseError(code, message);
|
|
623
|
+
},
|
|
624
|
+
assetMissingFromNetworkLock(assetId) {
|
|
625
|
+
return new base_error_1.BaseError(3044, `Asset '${assetId}' is missing from the network lock file.`);
|
|
626
|
+
},
|
|
627
|
+
// Access management errors
|
|
457
628
|
credentialsValidationsError(description) {
|
|
458
629
|
const code = 10001;
|
|
459
630
|
const message = `Error validating credentials: ${description}`;
|
|
460
631
|
throw new base_error_1.BaseError(code, message);
|
|
461
632
|
},
|
|
633
|
+
// Gateway flag errors
|
|
634
|
+
gatewayFlagsMutuallyExclusive() {
|
|
635
|
+
const code = 11001;
|
|
636
|
+
const message = '--gateway is mutually exclusive with --ingress-gw and --egress-gw. ' +
|
|
637
|
+
'Use --gateway <name> for a single gateway, or --ingress-gw <name> [--egress-gw <name>] for separate gateways.';
|
|
638
|
+
throw new base_error_1.BaseError(code, message);
|
|
639
|
+
},
|
|
640
|
+
egressGwRequiresIngress() {
|
|
641
|
+
const code = 11002;
|
|
642
|
+
const message = '--egress-gw requires --ingress-gw. ' +
|
|
643
|
+
'Pass both --ingress-gw <name> --egress-gw <name> for separate gateways, or --gateway <name> for a single gateway.';
|
|
644
|
+
throw new base_error_1.BaseError(code, message);
|
|
645
|
+
},
|
|
646
|
+
gatewayFlagRequired() {
|
|
647
|
+
const code = 11003;
|
|
648
|
+
const message = 'A gateway must be specified. ' +
|
|
649
|
+
'Use --gateway <name> for a single gateway, or --ingress-gw <name> [--egress-gw <name>] for separate gateways.';
|
|
650
|
+
throw new base_error_1.BaseError(code, message);
|
|
651
|
+
},
|
|
652
|
+
separateGatewayModeNotSupportedInSharedSpace() {
|
|
653
|
+
const code = 11004;
|
|
654
|
+
const message = 'Separate-gateways mode (--ingress-gw / --egress-gw) is not supported in Shared Space. ' +
|
|
655
|
+
'Use --gateway for single-gateway mode, or pass a Private Space name to --target-space.';
|
|
656
|
+
throw new base_error_1.BaseError(code, message);
|
|
657
|
+
},
|
|
658
|
+
singleGatewayTargetSpaceMismatch(providedTargetSpace, gateway) {
|
|
659
|
+
const code = 11005;
|
|
660
|
+
const message = `Target space '${providedTargetSpace}' passed via --target-space does not match the gateway '${gateway.name}' target space '${gateway.targetName}' (ID: ${gateway.targetId}). ` +
|
|
661
|
+
'In single-gateway mode, --target-space is optional; when provided it must match the gateway\'s target space, or be omitted to let the gateway determine it.';
|
|
662
|
+
throw new base_error_1.BaseError(code, message);
|
|
663
|
+
},
|
|
664
|
+
// MCP introspection errors (1020-1029 range)
|
|
665
|
+
mcpMainYamlNotFound(yamlPath) {
|
|
666
|
+
const code = 1020;
|
|
667
|
+
const message = `Agent network main file not found at ${yamlPath}. Check the 'main' field in exchange.json.`;
|
|
668
|
+
throw new base_error_1.BaseError(code, message);
|
|
669
|
+
},
|
|
670
|
+
mcpYamlParseError(yamlPath, reason) {
|
|
671
|
+
const code = 1021;
|
|
672
|
+
const message = `Failed to parse ${yamlPath}: ${reason}`;
|
|
673
|
+
throw new base_error_1.BaseError(code, message);
|
|
674
|
+
},
|
|
675
|
+
mcpServerJsonNotFound(filePath, reason) {
|
|
676
|
+
const code = 1022;
|
|
677
|
+
const message = `Failed to read server.json at ${filePath}: ${reason}`;
|
|
678
|
+
throw new base_error_1.BaseError(code, message);
|
|
679
|
+
},
|
|
680
|
+
mcpServerJsonInvalidJson(filePath, reason) {
|
|
681
|
+
const code = 1023;
|
|
682
|
+
const message = `server.json is not valid JSON at ${filePath}: ${reason}`;
|
|
683
|
+
throw new base_error_1.BaseError(code, message);
|
|
684
|
+
},
|
|
685
|
+
mcpServerJsonSchemaValidation(errors) {
|
|
686
|
+
const code = 1024;
|
|
687
|
+
const message = `server.json failed schema validation:\n${errors}`;
|
|
688
|
+
throw new base_error_1.BaseError(code, message);
|
|
689
|
+
},
|
|
690
|
+
mcpServerJsonNoRemotes() {
|
|
691
|
+
const code = 1025;
|
|
692
|
+
const message = 'server.json has no remotes; only remote servers are supported';
|
|
693
|
+
throw new base_error_1.BaseError(code, message);
|
|
694
|
+
},
|
|
695
|
+
mcpServerJsonMultipleRemotes(available) {
|
|
696
|
+
const code = 1026;
|
|
697
|
+
const message = `server.json defines multiple remotes (${available}); use --transport to pick one`;
|
|
698
|
+
throw new base_error_1.BaseError(code, message);
|
|
699
|
+
},
|
|
700
|
+
mcpServerJsonRemoteNotFound(requested, available) {
|
|
701
|
+
const code = 1027;
|
|
702
|
+
const message = `No ${requested} remote found in server.json. Available: ${available}`;
|
|
703
|
+
throw new base_error_1.BaseError(code, message);
|
|
704
|
+
},
|
|
705
|
+
mcpInvalidRemoteProtocol(protocol) {
|
|
706
|
+
const code = 1028;
|
|
707
|
+
const message = `Invalid protocol in server.json remote URL: ${protocol}. Only http: and https: are supported.`;
|
|
708
|
+
throw new base_error_1.BaseError(code, message);
|
|
709
|
+
},
|
|
710
|
+
mcpInvalidRemoteUrl(reason) {
|
|
711
|
+
const code = 1029;
|
|
712
|
+
const message = `Invalid URL in server.json remote: ${reason}`;
|
|
713
|
+
return new base_error_1.BaseError(code, message);
|
|
714
|
+
},
|
|
715
|
+
mcpInvalidRegistryKey(key) {
|
|
716
|
+
const code = 1030;
|
|
717
|
+
const message = `Registry key "${key}" contains invalid characters. Only lowercase letters, digits, and hyphens are allowed.`;
|
|
718
|
+
return new base_error_1.BaseError(code, message);
|
|
719
|
+
},
|
|
720
|
+
mcpCannotDeriveRegistryKey(reason) {
|
|
721
|
+
const code = 1031;
|
|
722
|
+
const message = `Cannot derive a registry key: ${reason}`;
|
|
723
|
+
return new base_error_1.BaseError(code, message);
|
|
724
|
+
},
|
|
725
|
+
assetIdTooLongForDeployment(assetId, maxLength) {
|
|
726
|
+
const code = 1032;
|
|
727
|
+
const message = `Project asset ID '${assetId}' (${assetId.length} characters) exceeds the ${maxLength}-character limit on deployment names. Shorten the project's asset ID and rebuild.`;
|
|
728
|
+
return new base_error_1.BaseError(code, message);
|
|
729
|
+
},
|
|
730
|
+
invalidExchangeJson(exchangeJsonPath, cause) {
|
|
731
|
+
const code = 1033;
|
|
732
|
+
const reason = cause instanceof Error ? cause.message : String(cause);
|
|
733
|
+
const message = `exchange.json at '${exchangeJsonPath}' is not valid JSON: ${reason}`;
|
|
734
|
+
return new base_error_1.BaseError(code, message);
|
|
735
|
+
},
|
|
736
|
+
// generic
|
|
737
|
+
genericError(message) {
|
|
738
|
+
const code = 9001;
|
|
739
|
+
return new base_error_1.BaseError(code, message);
|
|
740
|
+
},
|
|
462
741
|
};
|
|
463
742
|
//# sourceMappingURL=error-factory.js.map
|