mulesoft-anypoint-cli-agent-fabric-plugin 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GETTING_STARTED.md +396 -0
- package/README.md +61 -23
- package/TROUBLESHOOTING.md +468 -0
- package/dist/commands/agent-network/project/agent-console.d.ts +3 -2
- package/dist/commands/agent-network/project/agent-console.js +3 -1
- package/dist/commands/agent-network/project/agent-console.js.map +1 -1
- package/dist/commands/agent-network/project/broker/create.d.ts +3 -2
- package/dist/commands/agent-network/project/broker/create.js +3 -1
- package/dist/commands/agent-network/project/broker/create.js.map +1 -1
- package/dist/commands/agent-network/project/build.d.ts +4 -3
- package/dist/commands/agent-network/project/build.js +13 -8
- package/dist/commands/agent-network/project/build.js.map +1 -1
- package/dist/commands/agent-network/project/create.d.ts +11 -6
- package/dist/commands/agent-network/project/create.js +52 -16
- package/dist/commands/agent-network/project/create.js.map +1 -1
- package/dist/commands/agent-network/project/deploy.d.ts +4 -2
- package/dist/commands/agent-network/project/deploy.js +45 -26
- package/dist/commands/agent-network/project/deploy.js.map +1 -1
- package/dist/commands/agent-network/project/export-logs.d.ts +3 -2
- package/dist/commands/agent-network/project/export-logs.js +3 -2
- package/dist/commands/agent-network/project/export-logs.js.map +1 -1
- package/dist/commands/agent-network/project/mcp/introspect.d.ts +7 -3
- package/dist/commands/agent-network/project/mcp/introspect.js +14 -9
- package/dist/commands/agent-network/project/mcp/introspect.js.map +1 -1
- package/dist/commands/agent-network/project/publish.d.ts +3 -4
- package/dist/commands/agent-network/project/publish.js +11 -14
- package/dist/commands/agent-network/project/publish.js.map +1 -1
- package/dist/commands/agent-network/project/run-local.d.ts +14 -2
- package/dist/commands/agent-network/project/run-local.js +339 -60
- package/dist/commands/agent-network/project/run-local.js.map +1 -1
- package/dist/commands/agent-network/project/secrets.d.ts +3 -2
- package/dist/commands/agent-network/project/secrets.js +3 -1
- package/dist/commands/agent-network/project/secrets.js.map +1 -1
- package/dist/commands/agent-network/project/stop-local.d.ts +3 -2
- package/dist/commands/agent-network/project/stop-local.js +3 -2
- package/dist/commands/agent-network/project/stop-local.js.map +1 -1
- package/dist/commands/agent-network/project/undeploy.d.ts +3 -2
- package/dist/commands/agent-network/project/undeploy.js +19 -12
- package/dist/commands/agent-network/project/undeploy.js.map +1 -1
- package/dist/commands/agent-network/project/unpublish.d.ts +3 -2
- package/dist/commands/agent-network/project/unpublish.js +26 -19
- package/dist/commands/agent-network/project/unpublish.js.map +1 -1
- package/dist/commands/agent-network/setup/dependencies.d.ts +4 -3
- package/dist/commands/agent-network/setup/dependencies.js +7 -4
- package/dist/commands/agent-network/setup/dependencies.js.map +1 -1
- package/dist/commands/agent-network/setup/gateways.d.ts +3 -2
- package/dist/commands/agent-network/setup/gateways.js +3 -3
- package/dist/commands/agent-network/setup/gateways.js.map +1 -1
- package/dist/errors/base-error.d.ts +6 -0
- package/dist/errors/base-error.js +49 -20
- package/dist/errors/base-error.js.map +1 -1
- package/dist/errors/error-factory.d.ts +62 -4
- package/dist/errors/error-factory.js +341 -13
- package/dist/errors/error-factory.js.map +1 -1
- package/dist/helpers/connection.d.ts +6 -2
- package/dist/helpers/connection.js +13 -6
- package/dist/helpers/connection.js.map +1 -1
- package/dist/helpers/dependency-manager.d.ts +14 -5
- package/dist/helpers/dependency-manager.js +185 -51
- package/dist/helpers/dependency-manager.js.map +1 -1
- package/dist/helpers/policy-helper.js +256 -26
- package/dist/helpers/policy-helper.js.map +1 -1
- package/dist/helpers/project/constants.d.ts +1 -1
- package/dist/helpers/proxy-agent.d.ts +2 -0
- package/dist/helpers/proxy-agent.js +26 -0
- package/dist/helpers/proxy-agent.js.map +1 -0
- package/dist/helpers/proxy-fetch.d.ts +5 -0
- package/dist/helpers/proxy-fetch.js +102 -0
- package/dist/helpers/proxy-fetch.js.map +1 -0
- package/dist/helpers/request-logging.d.ts +4 -0
- package/dist/helpers/request-logging.js +96 -2
- package/dist/helpers/request-logging.js.map +1 -1
- package/dist/helpers/types.d.ts +5 -0
- package/dist/helpers/utils.d.ts +1 -0
- package/dist/helpers/utils.js +16 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/init/check-node-version.d.ts +6 -0
- package/dist/hooks/init/check-node-version.js +34 -0
- package/dist/hooks/init/check-node-version.js.map +1 -0
- package/dist/resources/runtime-dependencies.json +5 -1
- package/dist/resources/schemas/broker-deployment-settings.schema.json +4 -0
- package/dist/resources/schemas/runtime-dependencies-schema.json +21 -0
- package/dist/types/agent-network-v2.d.ts +55 -9
- package/dist/types/agent-network-v2.js.map +1 -1
- package/dist/types/agent-network.d.ts +0 -4
- package/dist/types/agent-network.js.map +1 -1
- package/dist/types/types.d.ts +25 -3
- package/dist/utils/agent-fabric-commands.d.ts +24 -0
- package/dist/utils/agent-fabric-commands.js +39 -0
- package/dist/utils/agent-fabric-commands.js.map +1 -0
- package/dist/utils/builders/builder.d.ts +2 -0
- package/dist/utils/builders/builder.js +22 -1
- package/dist/utils/builders/builder.js.map +1 -1
- package/dist/utils/builders/common/connection-facet-helpers.d.ts +2 -0
- package/dist/utils/builders/common/connection-facet-helpers.js +4 -1
- package/dist/utils/builders/common/connection-facet-helpers.js.map +1 -1
- package/dist/utils/builders/common/network-builder-helpers.d.ts +5 -0
- package/dist/utils/builders/common/network-builder-helpers.js +8 -0
- package/dist/utils/builders/common/network-builder-helpers.js.map +1 -1
- package/dist/utils/builders/common/network-metadata.js +1 -1
- package/dist/utils/builders/common/network-metadata.js.map +1 -1
- package/dist/utils/builders/common/types.d.ts +1 -1
- package/dist/utils/builders/local-space-resolver.d.ts +13 -3
- package/dist/utils/builders/local-space-resolver.js +16 -3
- package/dist/utils/builders/local-space-resolver.js.map +1 -1
- package/dist/utils/builders/policies-factory.d.ts +6 -2
- package/dist/utils/builders/policies-factory.js +106 -8
- package/dist/utils/builders/policies-factory.js.map +1 -1
- package/dist/utils/builders/project-builder-impl.d.ts +20 -1
- package/dist/utils/builders/project-builder-impl.js +40 -4
- package/dist/utils/builders/project-builder-impl.js.map +1 -1
- package/dist/utils/builders/project-builder.d.ts +18 -3
- package/dist/utils/builders/project-builder.js +4 -2
- package/dist/utils/builders/project-builder.js.map +1 -1
- package/dist/utils/builders/remote-space-resolver.d.ts +3 -3
- package/dist/utils/builders/remote-space-resolver.js +47 -32
- package/dist/utils/builders/remote-space-resolver.js.map +1 -1
- package/dist/utils/builders/space-serializer.d.ts +2 -0
- package/dist/utils/builders/space-serializer.js +12 -2
- package/dist/utils/builders/space-serializer.js.map +1 -1
- package/dist/utils/builders/v1/broker-builder.d.ts +1 -0
- package/dist/utils/builders/v1/broker-builder.js +45 -9
- package/dist/utils/builders/v1/broker-builder.js.map +1 -1
- package/dist/utils/builders/v1/connections-builder.js +3 -0
- package/dist/utils/builders/v1/connections-builder.js.map +1 -1
- package/dist/utils/builders/v1/network-builder.js +22 -4
- package/dist/utils/builders/v1/network-builder.js.map +1 -1
- package/dist/utils/builders/v2/broker-builder.js +1 -1
- package/dist/utils/builders/v2/broker-builder.js.map +1 -1
- package/dist/utils/builders/v2/connection-interfaces.d.ts +5 -0
- package/dist/utils/builders/v2/connection-interfaces.js +68 -0
- package/dist/utils/builders/v2/connection-interfaces.js.map +1 -0
- package/dist/utils/builders/v2/connections-builder.d.ts +5 -1
- package/dist/utils/builders/v2/connections-builder.js +120 -20
- package/dist/utils/builders/v2/connections-builder.js.map +1 -1
- package/dist/utils/builders/v2/llm-builder.js +17 -6
- package/dist/utils/builders/v2/llm-builder.js.map +1 -1
- package/dist/utils/builders/v2/network-builder.js +10 -1
- package/dist/utils/builders/v2/network-builder.js.map +1 -1
- package/dist/utils/constants.d.ts +22 -1
- package/dist/utils/constants.js +26 -4
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/deployment-settings.d.ts +1 -0
- package/dist/utils/deployment-settings.js.map +1 -1
- package/dist/utils/dry-run/dry-run-render.d.ts +1 -0
- package/dist/utils/dry-run/dry-run-render.js +23 -13
- package/dist/utils/dry-run/dry-run-render.js.map +1 -1
- package/dist/utils/exchange.d.ts +1 -0
- package/dist/utils/exchange.js +20 -0
- package/dist/utils/exchange.js.map +1 -1
- package/dist/utils/facets/agent-graph-facet.d.ts +1 -1
- package/dist/utils/facets/agent-graph-facet.js +10 -9
- package/dist/utils/facets/agent-graph-facet.js.map +1 -1
- package/dist/utils/facets/api-instance-facet.d.ts +2 -0
- package/dist/utils/facets/api-instance-facet.js +75 -19
- package/dist/utils/facets/api-instance-facet.js.map +1 -1
- package/dist/utils/facets/apim-policy-helpers.d.ts +29 -2
- package/dist/utils/facets/apim-policy-helpers.js +19 -5
- package/dist/utils/facets/apim-policy-helpers.js.map +1 -1
- package/dist/utils/facets/asset-facet.d.ts +2 -0
- package/dist/utils/facets/asset-facet.js +75 -40
- package/dist/utils/facets/asset-facet.js.map +1 -1
- package/dist/utils/facets/connection-facet.d.ts +6 -0
- package/dist/utils/facets/connection-facet.js +202 -22
- package/dist/utils/facets/connection-facet.js.map +1 -1
- package/dist/utils/facets/deployment-helpers.d.ts +2 -1
- package/dist/utils/facets/deployment-helpers.js +28 -21
- package/dist/utils/facets/deployment-helpers.js.map +1 -1
- package/dist/utils/facets/deployment-runner.js +88 -6
- package/dist/utils/facets/deployment-runner.js.map +1 -1
- package/dist/utils/facets/facets.d.ts +6 -0
- package/dist/utils/facets/facets.js +56 -9
- package/dist/utils/facets/facets.js.map +1 -1
- package/dist/utils/facets/mule-application-facet.js +2 -2
- package/dist/utils/facets/mule-application-facet.js.map +1 -1
- package/dist/utils/facets/publication-metadata-patcher.d.ts +7 -1
- package/dist/utils/facets/publication-metadata-patcher.js +32 -17
- package/dist/utils/facets/publication-metadata-patcher.js.map +1 -1
- package/dist/utils/facets/secret-manager-client.d.ts +29 -0
- package/dist/utils/facets/secret-manager-client.js +172 -0
- package/dist/utils/facets/secret-manager-client.js.map +1 -0
- package/dist/utils/facets/secret-ref-validator.d.ts +11 -0
- package/dist/utils/facets/secret-ref-validator.js +80 -0
- package/dist/utils/facets/secret-ref-validator.js.map +1 -0
- package/dist/utils/facets/secret-tls-validator.d.ts +6 -0
- package/dist/utils/facets/secret-tls-validator.js +59 -0
- package/dist/utils/facets/secret-tls-validator.js.map +1 -0
- package/dist/utils/gateway.d.ts +3 -0
- package/dist/utils/gateway.js +70 -1
- package/dist/utils/gateway.js.map +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/maven-proxy.d.ts +10 -0
- package/dist/utils/maven-proxy.js +118 -0
- package/dist/utils/maven-proxy.js.map +1 -0
- package/dist/utils/registry/registry-errors.d.ts +4 -0
- package/dist/utils/registry/registry-errors.js +36 -0
- package/dist/utils/registry/registry-errors.js.map +1 -0
- package/dist/utils/registry/registry-response.d.ts +46 -0
- package/dist/utils/registry/registry-response.js +264 -0
- package/dist/utils/registry/registry-response.js.map +1 -0
- package/dist/utils/request-executor.d.ts +9 -1
- package/dist/utils/request-executor.js +6 -3
- package/dist/utils/request-executor.js.map +1 -1
- package/dist/utils/run-local/build-status.js +4 -2
- package/dist/utils/run-local/build-status.js.map +1 -1
- package/dist/utils/run-local/index.d.ts +1 -1
- package/dist/utils/run-local/index.js +2 -1
- package/dist/utils/run-local/index.js.map +1 -1
- package/dist/utils/run-local/local-a2a-upstream.d.ts +1 -0
- package/dist/utils/run-local/local-a2a-upstream.js +5 -4
- package/dist/utils/run-local/local-a2a-upstream.js.map +1 -1
- package/dist/utils/run-local/local-tls-model.d.ts +18 -0
- package/dist/utils/run-local/local-tls-model.js +97 -0
- package/dist/utils/run-local/local-tls-model.js.map +1 -0
- package/dist/utils/run-local/local-tls.d.ts +37 -0
- package/dist/utils/run-local/local-tls.js +245 -0
- package/dist/utils/run-local/local-tls.js.map +1 -0
- package/dist/utils/run-local/policy-resolver.js +5 -0
- package/dist/utils/run-local/policy-resolver.js.map +1 -1
- package/dist/utils/run-local/runtime-environment-manager.d.ts +23 -2
- package/dist/utils/run-local/runtime-environment-manager.js +236 -6
- package/dist/utils/run-local/runtime-environment-manager.js.map +1 -1
- package/dist/utils/run-local/secrets-manager.d.ts +1 -0
- package/dist/utils/run-local/secrets-manager.js +2 -1
- package/dist/utils/run-local/secrets-manager.js.map +1 -1
- package/dist/utils/sanitize.d.ts +3 -0
- package/dist/utils/sanitize.js +45 -0
- package/dist/utils/sanitize.js.map +1 -0
- package/dist/utils/variables.d.ts +28 -6
- package/dist/utils/variables.js +114 -14
- package/dist/utils/variables.js.map +1 -1
- package/package.json +12 -10
- package/scripts/extract-error-catalog.js +88 -0
- package/templates/agentic-network/agent-network.yaml.template +1 -7
- package/templates/agentic-network/brokers/broker1.agent.template +1 -1
- package/templates/agentic-network/exchange.json.template +9 -1
|
@@ -7,10 +7,33 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.ErrorFactory = exports.UNDEPLOY_FAIL_CLOSED_CODE = exports.DEPLOYED_RESOURCES_EXIST_ON_UNPUBLISH_CODE = void 0;
|
|
9
9
|
const base_error_1 = require("./base-error");
|
|
10
|
-
const constants_1 = require("../
|
|
10
|
+
const constants_1 = require("../helpers/project/constants");
|
|
11
|
+
const constants_2 = require("../utils/constants");
|
|
12
|
+
const request_utils_1 = require("../helpers/request-utils");
|
|
13
|
+
const sanitize_1 = require("../utils/sanitize");
|
|
14
|
+
const utils_1 = require("../helpers/utils");
|
|
11
15
|
const setupErrorMsg = (resourceId) => `Error while trying to setup ${resourceId}.`;
|
|
16
|
+
const describeSecretManagerError = (error) => {
|
|
17
|
+
var _a;
|
|
18
|
+
if ((0, request_utils_1.isAnAxiosError)(error)) {
|
|
19
|
+
const status = (_a = error.response) === null || _a === void 0 ? void 0 : _a.status;
|
|
20
|
+
if (status === 401 || status === 403 || status === 404) {
|
|
21
|
+
return 'The organization may not be entitled to the secret manager, or the session lacks access to it.';
|
|
22
|
+
}
|
|
23
|
+
if (status !== undefined) {
|
|
24
|
+
return `The secret manager responded with HTTP ${status}.`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return 'The secret manager could not be reached.';
|
|
28
|
+
};
|
|
12
29
|
exports.DEPLOYED_RESOURCES_EXIST_ON_UNPUBLISH_CODE = 2007;
|
|
13
30
|
exports.UNDEPLOY_FAIL_CLOSED_CODE = 3030;
|
|
31
|
+
// Only the request IDs: forwarding all response headers would leak set-cookie and friends.
|
|
32
|
+
function correlationIds(headers) {
|
|
33
|
+
const requestId = headers === null || headers === void 0 ? void 0 : headers[utils_1.X_REQUEST_ID];
|
|
34
|
+
const sfdcRequestId = headers === null || headers === void 0 ? void 0 : headers['x-sfdc-request-id'];
|
|
35
|
+
return { ...(requestId && { requestId }), ...(sfdcRequestId && { sfdcRequestId }) };
|
|
36
|
+
}
|
|
14
37
|
exports.ErrorFactory = {
|
|
15
38
|
// Build errors
|
|
16
39
|
projectDescriptorNotFound(definitionRef, exchangeJsonFile) {
|
|
@@ -35,7 +58,7 @@ exports.ErrorFactory = {
|
|
|
35
58
|
},
|
|
36
59
|
validatingAgentNetworkError(status) {
|
|
37
60
|
const code = 1005;
|
|
38
|
-
const message = `Error while validating the Agent Network. Exit status: '${status}'.`;
|
|
61
|
+
const message = `Error while validating the Agent Network. Exit status: '${status}'. If the output above does not explain the failure, verify that JAVA_HOME points to a supported JDK.`;
|
|
39
62
|
throw new base_error_1.BaseError(code, message);
|
|
40
63
|
},
|
|
41
64
|
buildingAgentNetworkError(status) {
|
|
@@ -83,6 +106,11 @@ exports.ErrorFactory = {
|
|
|
83
106
|
const message = `Unsupported Agent Network schema version '${schemaVersion}'. Supported versions: ${supported}.`;
|
|
84
107
|
throw new base_error_1.BaseError(code, message);
|
|
85
108
|
},
|
|
109
|
+
unsupportedLocalRunSchema(schemaVersion) {
|
|
110
|
+
const code = 1013;
|
|
111
|
+
const message = `Unsupported Agent Network schema version '${schemaVersion}'. Local run accepts a document headed by agentNetwork.`;
|
|
112
|
+
throw new base_error_1.BaseError(code, message);
|
|
113
|
+
},
|
|
86
114
|
validationConnectionsError(orphanConnections, invalidKindConnections) {
|
|
87
115
|
const code = 1014;
|
|
88
116
|
let message = '';
|
|
@@ -151,6 +179,73 @@ exports.ErrorFactory = {
|
|
|
151
179
|
const message = `Broker '${brokerId}' has an unsupported 'protocolBinding' (${found}) in 'interfaces.a2a.card.supportedInterfaces'. Supported values are: ${supportedList}.`;
|
|
152
180
|
throw new base_error_1.BaseError(code, message);
|
|
153
181
|
},
|
|
182
|
+
pushNotificationNotSupported(brokerId) {
|
|
183
|
+
const code = 1035;
|
|
184
|
+
const message = `Broker '${brokerId}' declares 'capabilities.pushNotifications: true' in 'interfaces.a2a.card', but push notifications are not supported. Set it to false and try again.`;
|
|
185
|
+
throw new base_error_1.BaseError(code, message);
|
|
186
|
+
},
|
|
187
|
+
variableKeyCollision(firstPath, secondPath, flattenedKey) {
|
|
188
|
+
const code = 1036;
|
|
189
|
+
const message = `Variable name collision: '${firstPath}' and '${secondPath}' both resolve to the flattened key '${flattenedKey}'. Rename one, or use nested objects consistently.`;
|
|
190
|
+
return new base_error_1.BaseError(code, message);
|
|
191
|
+
},
|
|
192
|
+
variableNameContainsColon(path) {
|
|
193
|
+
const code = 1037;
|
|
194
|
+
const message = `Variable name '${path}' contains a ':', which is a restricted character and is not allowed in a variable key or category name.`;
|
|
195
|
+
return new base_error_1.BaseError(code, message);
|
|
196
|
+
},
|
|
197
|
+
a2aInterfacesNotSupportedForV03(connectionName) {
|
|
198
|
+
const code = 1042;
|
|
199
|
+
const message = `"interfaces" is not supported for A2A v0.3 agents (connection ${connectionName}).`;
|
|
200
|
+
return new base_error_1.BaseError(code, message);
|
|
201
|
+
},
|
|
202
|
+
invalidA2aInterfaceBasePath(basePath, protocol) {
|
|
203
|
+
const code = 1043;
|
|
204
|
+
const message = `Invalid interfaces.${protocol}.basePath '${basePath}'. ` +
|
|
205
|
+
'Each basePath must be an absolute path starting with \'/\' (root and trailing \'/\' are allowed) ' +
|
|
206
|
+
'with no \'..\' segments (including percent-encoded forms), mid-path empty segments, or URL schemes.';
|
|
207
|
+
return new base_error_1.BaseError(code, message);
|
|
208
|
+
},
|
|
209
|
+
invalidA2aInterfaceProtocol(protocol) {
|
|
210
|
+
const code = 1044;
|
|
211
|
+
const message = `Invalid interfaces binding key '${protocol}'. Allowed keys are jsonrpc, http, and grpc.`;
|
|
212
|
+
return new base_error_1.BaseError(code, message);
|
|
213
|
+
},
|
|
214
|
+
invalidA2aInterfacesShape(location) {
|
|
215
|
+
const code = 1045;
|
|
216
|
+
const message = `Invalid ${location}. It must be a plain object, not an array, string, or other scalar.`;
|
|
217
|
+
return new base_error_1.BaseError(code, message);
|
|
218
|
+
},
|
|
219
|
+
javaHomeNotSet() {
|
|
220
|
+
const code = 1046;
|
|
221
|
+
const message = 'JAVA_HOME is not set. Set JAVA_HOME to the installation directory of a supported JDK.';
|
|
222
|
+
return new base_error_1.BaseError(code, message);
|
|
223
|
+
},
|
|
224
|
+
javaExecutableError(javaExecutable, reason) {
|
|
225
|
+
const code = 1047;
|
|
226
|
+
const message = `Unable to run Java at '${javaExecutable}': ${reason}. Verify that JAVA_HOME points to a supported JDK installation.`;
|
|
227
|
+
return new base_error_1.BaseError(code, message);
|
|
228
|
+
},
|
|
229
|
+
invalidSecretRefDeclaration(variableName, reason) {
|
|
230
|
+
const code = 1048;
|
|
231
|
+
const message = `Variable '${(0, sanitize_1.sanitizeForLog)(variableName)}' has an invalid secretRef declaration (${(0, sanitize_1.sanitizeForLog)(reason)}). A secretRef requires non-empty group and name strings and cannot be combined with default, secret, or optional.`;
|
|
232
|
+
return new base_error_1.BaseError(code, message);
|
|
233
|
+
},
|
|
234
|
+
secretRefNotWholeSensitiveField(variableName, location) {
|
|
235
|
+
const code = 1049;
|
|
236
|
+
const message = `Shared secret '${(0, sanitize_1.sanitizeForLog)(variableName)}' at '${(0, sanitize_1.sanitizeForLog)(location)}' is not allowed. A shared secret is only valid as the entire value of a sensitive policy configuration field.`;
|
|
237
|
+
return new base_error_1.BaseError(code, message);
|
|
238
|
+
},
|
|
239
|
+
secretRefNotEntireFieldValue(variableName, location) {
|
|
240
|
+
const code = 1049;
|
|
241
|
+
const message = `Shared secret '${(0, sanitize_1.sanitizeForLog)(variableName)}' at '${(0, sanitize_1.sanitizeForLog)(location)}' is not allowed. A shared secret can only be used as the entire value of the field and cannot be prefixed or suffixed.`;
|
|
242
|
+
return new base_error_1.BaseError(code, message);
|
|
243
|
+
},
|
|
244
|
+
secretRefFieldNotSensitive(variableName, location) {
|
|
245
|
+
const code = 1049;
|
|
246
|
+
const message = `Shared secret '${(0, sanitize_1.sanitizeForLog)(variableName)}' at '${(0, sanitize_1.sanitizeForLog)(location)}' is not allowed. A shared secret is not supported on this policy configuration field because the field does not accept a sensitive value.`;
|
|
247
|
+
return new base_error_1.BaseError(code, message);
|
|
248
|
+
},
|
|
154
249
|
// Publish errors
|
|
155
250
|
organizationAccessError(groupId) {
|
|
156
251
|
const code = 2001;
|
|
@@ -219,6 +314,27 @@ exports.ErrorFactory = {
|
|
|
219
314
|
const message = `Error while trying to apply policies for '${apiLabel}' in API Manager.`;
|
|
220
315
|
return new base_error_1.BaseError(code, message, error);
|
|
221
316
|
},
|
|
317
|
+
tlsContextValidationError(connectionId, error) {
|
|
318
|
+
const code = 3035;
|
|
319
|
+
const message = `Unable to validate the TLS context for connection '${(0, sanitize_1.sanitizeForLog)(connectionId)}' against the secret manager. ${describeSecretManagerError(error)}`;
|
|
320
|
+
return new base_error_1.BaseError(code, message, error);
|
|
321
|
+
},
|
|
322
|
+
tlsContextSecretGroupNotFound(connectionId, groupName) {
|
|
323
|
+
const code = 3038;
|
|
324
|
+
const message = `Secret group '${(0, sanitize_1.sanitizeForLog)(groupName)}' referenced by the TLS context of connection '${(0, sanitize_1.sanitizeForLog)(connectionId)}' was not found in the target environment's secret manager.`;
|
|
325
|
+
return new base_error_1.BaseError(code, message);
|
|
326
|
+
},
|
|
327
|
+
tlsContextNotFound(connectionId, tlsContextName, groupName) {
|
|
328
|
+
const code = 3039;
|
|
329
|
+
const message = `TLS context '${(0, sanitize_1.sanitizeForLog)(tlsContextName)}' was not found in secret group '${(0, sanitize_1.sanitizeForLog)(groupName)}' referenced by connection '${(0, sanitize_1.sanitizeForLog)(connectionId)}' in the target environment's secret manager.`;
|
|
330
|
+
return new base_error_1.BaseError(code, message);
|
|
331
|
+
},
|
|
332
|
+
secretTlsValidationFailed(details) {
|
|
333
|
+
const code = 3040;
|
|
334
|
+
const detailLines = details.map(detail => ` - ${detail}`).join('\n');
|
|
335
|
+
const message = `Secret and TLS context validation failed before deploy:\n${detailLines}`;
|
|
336
|
+
return new base_error_1.BaseError(code, message);
|
|
337
|
+
},
|
|
222
338
|
throwDeployError(apiLabel, gatewayName, error) {
|
|
223
339
|
throw this.deployError(apiLabel, gatewayName, error);
|
|
224
340
|
},
|
|
@@ -412,6 +528,122 @@ exports.ErrorFactory = {
|
|
|
412
528
|
const message = `Publication before deployment failed. Deployment aborted. ${this.describe(error)}`;
|
|
413
529
|
return new base_error_1.BaseError(code, message, error);
|
|
414
530
|
},
|
|
531
|
+
llmAuthenticationKindNotSupported(connectionName, kind, supportedKinds) {
|
|
532
|
+
const code = 3060;
|
|
533
|
+
const message = `Connection '${connectionName}' uses authentication kind '${kind}', which is not supported by the referenced LLM. Supported kinds: ${supportedKinds.join(', ')}.`;
|
|
534
|
+
throw new base_error_1.BaseError(code, message);
|
|
535
|
+
},
|
|
536
|
+
llmAssetRequiresV2(ref) {
|
|
537
|
+
const code = 3061;
|
|
538
|
+
const message = `LLM asset '${ref.groupId}:${ref.assetId}:${ref.version}' declares 'inputFormat' and uses the V2 outbound authentication model; it cannot be referenced from a V1 Agent Network project.`;
|
|
539
|
+
throw new base_error_1.BaseError(code, message);
|
|
540
|
+
},
|
|
541
|
+
llmInputFormatRequiresAuthentication(ref) {
|
|
542
|
+
const code = 3062;
|
|
543
|
+
const message = `LLM asset '${ref.groupId}:${ref.assetId}:${ref.version}' declares 'inputFormat' but no non-empty 'authentication' block; V2 llm-metadata assets must declare 'authentication' (use authentication kind 'none' for no-auth).`;
|
|
544
|
+
throw new base_error_1.BaseError(code, message);
|
|
545
|
+
},
|
|
546
|
+
llmModelNotDeclared(connectionName, ref, invalid, declared) {
|
|
547
|
+
const code = 3063;
|
|
548
|
+
const message = `Connection '${connectionName}' requests model(s) ${invalid.map(m => `'${m}'`).join(', ')} which are not declared by LLM asset '${ref.groupId}:${ref.assetId}:${ref.version}'. Declared models: ${declared.map(m => `'${m}'`).join(', ')}.`;
|
|
549
|
+
throw new base_error_1.BaseError(code, message);
|
|
550
|
+
},
|
|
551
|
+
llmAuthenticationKindUnmapped(connectionName, kind, supportedKinds) {
|
|
552
|
+
const code = 3064;
|
|
553
|
+
const message = `Connection '${connectionName}' uses authentication kind '${kind}', for which the CLI has no policy mapping. Kinds with a policy mapping: ${supportedKinds.join(', ')}.`;
|
|
554
|
+
throw new base_error_1.BaseError(code, message);
|
|
555
|
+
},
|
|
556
|
+
llmAdapterPolicyNotFound(connectionName, llmRef, groupId, assetId, error) {
|
|
557
|
+
const code = 3065;
|
|
558
|
+
const message = `Connection '${connectionName}' references LLM asset '${llmRef.groupId}:${llmRef.assetId}:${llmRef.version}', whose adapter policy '${groupId}:${assetId}' was not found in Exchange.`;
|
|
559
|
+
throw new base_error_1.BaseError(code, message, error);
|
|
560
|
+
},
|
|
561
|
+
llmAdapterPolicyLookupFailed(connectionName, llmRef, groupId, assetId, error) {
|
|
562
|
+
const code = 3066;
|
|
563
|
+
const message = `Could not resolve the adapter policy '${groupId}:${assetId}' for connection '${connectionName}' (LLM asset '${llmRef.groupId}:${llmRef.assetId}:${llmRef.version}').`;
|
|
564
|
+
throw new base_error_1.BaseError(code, message, error);
|
|
565
|
+
},
|
|
566
|
+
cardAuthenticationUpstreamsError(apiLabel, error) {
|
|
567
|
+
const code = 3067;
|
|
568
|
+
const message = `Error while trying to configure the agent and card upstreams for '${apiLabel}' in API Manager. Agent card authentication may require Flex Gateway 1.5.0 or later. ${this.describe(error)}`;
|
|
569
|
+
return new base_error_1.BaseError(code, message, error);
|
|
570
|
+
},
|
|
571
|
+
outboundPolicyUpstreamLabelNotFound(upstreamLabel, assetId) {
|
|
572
|
+
const code = 3068;
|
|
573
|
+
const message = `No upstream labelled '${upstreamLabel}' found; outbound policy '${assetId}' cannot be applied.`;
|
|
574
|
+
return new base_error_1.BaseError(code, message);
|
|
575
|
+
},
|
|
576
|
+
secretRefGroupNotFound(groupName, variableName) {
|
|
577
|
+
const code = 3069;
|
|
578
|
+
const message = `Secret group '${(0, sanitize_1.sanitizeForLog)(groupName)}' referenced by shared secret '${(0, sanitize_1.sanitizeForLog)(variableName)}' was not found in the target environment's secret manager.`;
|
|
579
|
+
return new base_error_1.BaseError(code, message);
|
|
580
|
+
},
|
|
581
|
+
sharedSecretNotFound(groupName, secretName, variableName) {
|
|
582
|
+
const code = 3070;
|
|
583
|
+
const message = `Shared secret '${(0, sanitize_1.sanitizeForLog)(secretName)}' was not found in secret group '${(0, sanitize_1.sanitizeForLog)(groupName)}' referenced by variable '${(0, sanitize_1.sanitizeForLog)(variableName)}'.`;
|
|
584
|
+
return new base_error_1.BaseError(code, message);
|
|
585
|
+
},
|
|
586
|
+
secretRefNotEligible(groupName, secretName, variableName) {
|
|
587
|
+
const code = 3071;
|
|
588
|
+
const message = `Shared secret '${(0, sanitize_1.sanitizeForLog)(secretName)}' in group '${(0, sanitize_1.sanitizeForLog)(groupName)}' referenced by variable '${(0, sanitize_1.sanitizeForLog)(variableName)}' is not eligible: the secret group is not downloadable or the shared secret is not a Blob.`;
|
|
589
|
+
return new base_error_1.BaseError(code, message);
|
|
590
|
+
},
|
|
591
|
+
duplicateSecretGroup(groupName, variableName) {
|
|
592
|
+
const code = 3072;
|
|
593
|
+
const message = `More than one secret group is named '${(0, sanitize_1.sanitizeForLog)(groupName)}' for variable '${(0, sanitize_1.sanitizeForLog)(variableName)}'.`;
|
|
594
|
+
return new base_error_1.BaseError(code, message);
|
|
595
|
+
},
|
|
596
|
+
duplicateSharedSecret(secretName, groupName, variableName) {
|
|
597
|
+
const code = 3072;
|
|
598
|
+
const message = `More than one shared secret is named '${(0, sanitize_1.sanitizeForLog)(secretName)}' in group '${(0, sanitize_1.sanitizeForLog)(groupName)}' for variable '${(0, sanitize_1.sanitizeForLog)(variableName)}'.`;
|
|
599
|
+
return new base_error_1.BaseError(code, message);
|
|
600
|
+
},
|
|
601
|
+
secretRefIdNotUuid(groupName, secretName, variableName) {
|
|
602
|
+
const code = 3072;
|
|
603
|
+
const message = `Shared secret '${(0, sanitize_1.sanitizeForLog)(secretName)}' in group '${(0, sanitize_1.sanitizeForLog)(groupName)}' referenced by variable '${(0, sanitize_1.sanitizeForLog)(variableName)}' resolved to an id that is not a UUID.`;
|
|
604
|
+
return new base_error_1.BaseError(code, message);
|
|
605
|
+
},
|
|
606
|
+
secretRefValidationFailed(details) {
|
|
607
|
+
const code = 3072;
|
|
608
|
+
const detailLines = details.map(detail => ` - ${(0, sanitize_1.sanitizeForLog)(detail)}`).join('\n');
|
|
609
|
+
const message = `Shared secret validation failed before deploy:\n${detailLines}`;
|
|
610
|
+
return new base_error_1.BaseError(code, message);
|
|
611
|
+
},
|
|
612
|
+
sharedSecretsCallFailed(target, error) {
|
|
613
|
+
var _a;
|
|
614
|
+
const code = 3073;
|
|
615
|
+
const status = (0, request_utils_1.isAnAxiosError)(error) ? (_a = error.response) === null || _a === void 0 ? void 0 : _a.status : undefined;
|
|
616
|
+
const message = status ?
|
|
617
|
+
`Secret Manager call failed (HTTP ${status}) while resolving shared secrets for '${(0, sanitize_1.sanitizeForLog)(target)}'.` :
|
|
618
|
+
`Secret Manager call failed while resolving shared secrets for '${(0, sanitize_1.sanitizeForLog)(target)}'.`;
|
|
619
|
+
return new base_error_1.BaseError(code, message, error);
|
|
620
|
+
},
|
|
621
|
+
secretRefPropertyNotAllowed(variableName) {
|
|
622
|
+
const code = 3074;
|
|
623
|
+
const message = `Cannot override shared secret '${(0, sanitize_1.sanitizeForLog)(variableName)}' with --property. Platform deploy resolves it from Secret Manager.`;
|
|
624
|
+
return new base_error_1.BaseError(code, message);
|
|
625
|
+
},
|
|
626
|
+
gatewayNotDeployable(gatewayName, status, role) {
|
|
627
|
+
const code = 3075;
|
|
628
|
+
let who = 'Gateway';
|
|
629
|
+
if (role === 'ingress') {
|
|
630
|
+
who = 'Ingress gateway';
|
|
631
|
+
}
|
|
632
|
+
else if (role === 'egress') {
|
|
633
|
+
who = 'Egress gateway';
|
|
634
|
+
}
|
|
635
|
+
const shown = (0, sanitize_1.loggedGatewayField)(status);
|
|
636
|
+
const normalized = shown.toUpperCase();
|
|
637
|
+
let remedy = 'Start the gateway and redeploy.';
|
|
638
|
+
if (normalized === 'DELETING' || normalized === 'DELETED') {
|
|
639
|
+
remedy = 'Choose a different gateway.';
|
|
640
|
+
}
|
|
641
|
+
else if (normalized === 'STARTING') {
|
|
642
|
+
remedy = 'Wait until the gateway is RUNNING, then redeploy.';
|
|
643
|
+
}
|
|
644
|
+
const message = `${who} '${(0, sanitize_1.loggedGatewayField)(gatewayName)}' is '${shown}' and cannot accept a deployment. ${remedy}`;
|
|
645
|
+
return new base_error_1.BaseError(code, message);
|
|
646
|
+
},
|
|
415
647
|
// Gateways setup errors
|
|
416
648
|
noDomainsFound(organizationId, environmentId, targetSpace, reason) {
|
|
417
649
|
const code = 4001;
|
|
@@ -423,12 +655,12 @@ exports.ErrorFactory = {
|
|
|
423
655
|
const message = `Error while trying to setup ${ingress}.`;
|
|
424
656
|
throw new base_error_1.BaseError(code, message, error);
|
|
425
657
|
},
|
|
426
|
-
setupIngressGatewayFail(ingress, status, responseData,
|
|
658
|
+
setupIngressGatewayFail(ingress, status, responseData, headers) {
|
|
427
659
|
const code = 4003;
|
|
428
660
|
const message = `Request was not successful while trying to setup ${ingress}. Status: ${status}.`;
|
|
429
661
|
const reason = {
|
|
430
662
|
responseData,
|
|
431
|
-
|
|
663
|
+
...correlationIds(headers),
|
|
432
664
|
};
|
|
433
665
|
throw new base_error_1.BaseError(code, message, reason);
|
|
434
666
|
},
|
|
@@ -437,12 +669,12 @@ exports.ErrorFactory = {
|
|
|
437
669
|
const message = setupErrorMsg(egress);
|
|
438
670
|
throw new base_error_1.BaseError(code, message, error);
|
|
439
671
|
},
|
|
440
|
-
setupEgressGatewayFail(egress, status, responseData,
|
|
672
|
+
setupEgressGatewayFail(egress, status, responseData, headers) {
|
|
441
673
|
const code = 4005;
|
|
442
674
|
const message = `Request was not successful while trying to setup ${egress}. Status: ${status}.`;
|
|
443
675
|
const reason = {
|
|
444
676
|
responseData,
|
|
445
|
-
|
|
677
|
+
...correlationIds(headers),
|
|
446
678
|
};
|
|
447
679
|
throw new base_error_1.BaseError(code, message, reason);
|
|
448
680
|
},
|
|
@@ -466,10 +698,10 @@ exports.ErrorFactory = {
|
|
|
466
698
|
const message = `Unable to retrieve gateways for organization ID '${organizationId}' and environmentId '${environmentId}'. Detail: ${status}`;
|
|
467
699
|
throw new base_error_1.BaseError(code, message);
|
|
468
700
|
},
|
|
469
|
-
unableToRetrieveGatewayVersions(status) {
|
|
701
|
+
unableToRetrieveGatewayVersions(status, cause) {
|
|
470
702
|
const code = 4010;
|
|
471
703
|
const message = `Unable to retrieve gateway versions. Detail: ${status}`;
|
|
472
|
-
throw new base_error_1.BaseError(code, message);
|
|
704
|
+
throw new base_error_1.BaseError(code, message, cause);
|
|
473
705
|
},
|
|
474
706
|
gatewayChannelNotFoundError(channelName, availableChannels) {
|
|
475
707
|
const code = 4011;
|
|
@@ -525,14 +757,17 @@ exports.ErrorFactory = {
|
|
|
525
757
|
selectedOrganizationMismatch(groupId, selectedOrgId, sourceLabel = 'groupId') {
|
|
526
758
|
const code = 5003;
|
|
527
759
|
const message = `${sourceLabel} '${groupId}' does not match the selected organization '${selectedOrgId}'. ` +
|
|
528
|
-
'
|
|
760
|
+
'Select the organization that owns these assets with the --organization flag (or the ANYPOINT_ORG environment variable).';
|
|
529
761
|
throw new base_error_1.BaseError(code, message);
|
|
530
762
|
},
|
|
531
763
|
// dependency-manager errors
|
|
532
|
-
downloadFileError(url, error) {
|
|
764
|
+
downloadFileError(url, error, detail) {
|
|
765
|
+
var _a, _b;
|
|
533
766
|
const code = 6001;
|
|
534
|
-
const
|
|
535
|
-
|
|
767
|
+
const status = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status;
|
|
768
|
+
const message = `HTTP request failed for ${(0, sanitize_1.redactUrlCredentials)(url)}${status ? ` (status ${status})` : ''}${detail ? `: ${detail}` : ''}`;
|
|
769
|
+
const cause = error ? { message: (0, sanitize_1.redactUrlCredentials)(String((_b = error.message) !== null && _b !== void 0 ? _b : error)) } : undefined;
|
|
770
|
+
throw new base_error_1.BaseError(code, message, cause);
|
|
536
771
|
},
|
|
537
772
|
couldNotFindVersion() {
|
|
538
773
|
const code = 6002;
|
|
@@ -559,6 +794,21 @@ exports.ErrorFactory = {
|
|
|
559
794
|
const message = `Dependency version '${version}' is invalid. Version should use the SemVer format. Examples: 0.0.0 or 2.1.3`;
|
|
560
795
|
throw new base_error_1.BaseError(code, message);
|
|
561
796
|
},
|
|
797
|
+
insecureRepositoryUrl(url) {
|
|
798
|
+
const code = 6007;
|
|
799
|
+
const message = `Repository URL '${(0, sanitize_1.redactUrlCredentials)(url)}' is not valid. It must be an https:// URL. Set --nexus-url or the ANYPOINT_AGENT_FABRIC_REPOSITORY_URL environment variable to an https:// repository.`;
|
|
800
|
+
throw new base_error_1.BaseError(code, message);
|
|
801
|
+
},
|
|
802
|
+
downloadedFileNotArchive(url, contentType) {
|
|
803
|
+
const code = 6008;
|
|
804
|
+
const message = `The file downloaded from ${(0, sanitize_1.redactUrlCredentials)(url)} is not a valid JAR${contentType ? ` (content-type '${(0, sanitize_1.sanitizeForLog)(contentType)}')` : ''}. A proxy, captive portal or mirror most likely returned an error page. Verify the repository URL and that your proxy certificate authority is trusted (for example with NODE_EXTRA_CA_CERTS).`;
|
|
805
|
+
throw new base_error_1.BaseError(code, message);
|
|
806
|
+
},
|
|
807
|
+
checksumMismatch(url, expected, actual) {
|
|
808
|
+
const code = 6009;
|
|
809
|
+
const message = `Checksum mismatch for the file downloaded from ${(0, sanitize_1.redactUrlCredentials)(url)}. Expected SHA-256 ${expected} but got ${actual}. The file was discarded; verify the repository serves the artifact version pinned by this plugin release.`;
|
|
810
|
+
throw new base_error_1.BaseError(code, message);
|
|
811
|
+
},
|
|
562
812
|
// Create command errors
|
|
563
813
|
projectAlreadyExists(projectDirectory, projectName) {
|
|
564
814
|
const code = 7001;
|
|
@@ -674,6 +924,12 @@ exports.ErrorFactory = {
|
|
|
674
924
|
const message = 'Project has not been built, please build your Agent Network project before publishing.';
|
|
675
925
|
return new base_error_1.BaseError(code, message);
|
|
676
926
|
},
|
|
927
|
+
registryPublishError(assetName, summary, causes, requestId) {
|
|
928
|
+
const code = 2016;
|
|
929
|
+
const message = `Error while trying to publish: ${assetName}. ${summary}${requestId ? ` (requestId: ${requestId})` : ''}`;
|
|
930
|
+
const error = new base_error_1.BaseError(code, message, causes);
|
|
931
|
+
return requestId ? error.withRequestId(requestId) : error;
|
|
932
|
+
},
|
|
677
933
|
invalidPolicy(groupId, policyId, minorVersion) {
|
|
678
934
|
const code = 3031;
|
|
679
935
|
const message = `Empty or invalid metadata response for ${groupId}:${policyId}:${minorVersion}`;
|
|
@@ -773,7 +1029,7 @@ exports.ErrorFactory = {
|
|
|
773
1029
|
agentGraphServiceNameCollision(trimmedId, firstAssetId, secondAssetId) {
|
|
774
1030
|
const code = 8515;
|
|
775
1031
|
return new base_error_1.BaseError(code, `Asset ids '${firstAssetId}' and '${secondAssetId}' both trim to the same Docker service name ` +
|
|
776
|
-
`'${trimmedId}' under the ${
|
|
1032
|
+
`'${trimmedId}' under the ${constants_2.DNS_LABEL_MAX_LENGTH}-character DNS label limit. ` +
|
|
777
1033
|
'Rename one of the assets to avoid a naming collision.');
|
|
778
1034
|
},
|
|
779
1035
|
localSecretRetrievalFailed(variableName) {
|
|
@@ -874,6 +1130,73 @@ exports.ErrorFactory = {
|
|
|
874
1130
|
const code = 8534;
|
|
875
1131
|
return new base_error_1.BaseError(code, stageMessage);
|
|
876
1132
|
},
|
|
1133
|
+
localRunUnsupportedProjectType(classifier) {
|
|
1134
|
+
const code = 8535;
|
|
1135
|
+
return new base_error_1.BaseError(code, `Local run only supports Agent Network projects with classifier '${constants_1.AgentNetworkClassifiers.AGENTIC_NETWORK}'. ` +
|
|
1136
|
+
`This project has classifier '${classifier}'.`);
|
|
1137
|
+
},
|
|
1138
|
+
localTlsVariableCollision(key) {
|
|
1139
|
+
const code = 8536;
|
|
1140
|
+
return new base_error_1.BaseError(code, `Declared variable '${key}' is in the tls.<connectionId>.* namespace that local run reserves for a connection tlsContext. Rename the declared variable.`);
|
|
1141
|
+
},
|
|
1142
|
+
localTlsUpstreamNotHttps(connectionId) {
|
|
1143
|
+
const code = 8537;
|
|
1144
|
+
return new base_error_1.BaseError(code, `Connection '${connectionId}' declares a tlsContext but its upstream URL is not https://. Use an https:// upstream or remove the tlsContext.`);
|
|
1145
|
+
},
|
|
1146
|
+
localTlsFileUnreadable(connectionId, field, reason, causeError) {
|
|
1147
|
+
const code = 8538;
|
|
1148
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': could not read the ${field} file (${reason}). Check tls.${connectionId}.${field}.`, causeError);
|
|
1149
|
+
},
|
|
1150
|
+
localTlsInvalidPem(connectionId, field, expected, causeError) {
|
|
1151
|
+
const code = 8539;
|
|
1152
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': the ${field} file is not a PEM ${expected}. Check tls.${connectionId}.${field}.`, causeError);
|
|
1153
|
+
},
|
|
1154
|
+
localTlsTraditionalEncryptedKey(connectionId) {
|
|
1155
|
+
const code = 8540;
|
|
1156
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': the keyFile is a traditional encrypted PEM (Proc-Type: 4,ENCRYPTED), which is not supported. Convert it to PKCS#8 with 'openssl pkcs8 -topk8 -in <key> -out <new-key>' and point tls.${connectionId}.keyFile at the new file.`);
|
|
1157
|
+
},
|
|
1158
|
+
localTlsKeyUnloadable(connectionId, causeError) {
|
|
1159
|
+
const code = 8541;
|
|
1160
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': the private key could not be loaded. Check that tls.${connectionId}.keyFile is a valid PEM private key and that tls.${connectionId}.keyPassphrase is correct.`, causeError);
|
|
1161
|
+
},
|
|
1162
|
+
localTlsIncompleteCertificate(connectionId, presentField, missingField) {
|
|
1163
|
+
const code = 8542;
|
|
1164
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': ${presentField} is set but ${missingField} is empty. A client certificate needs both; set tls.${connectionId}.${missingField} or clear tls.${connectionId}.${presentField}.`);
|
|
1165
|
+
},
|
|
1166
|
+
localTlsInvalidOption(connectionId, field, allowed, rejected) {
|
|
1167
|
+
const code = 8543;
|
|
1168
|
+
const rejectedValue = `'${rejected}'`;
|
|
1169
|
+
const subject = rejected === undefined ? `the value of ${field}` : `${rejectedValue} for ${field}`;
|
|
1170
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': ${subject} is not valid. Allowed values: ${allowed.join(', ')}.`);
|
|
1171
|
+
},
|
|
1172
|
+
localTlsVersionRange(connectionId, minVersion, maxVersion) {
|
|
1173
|
+
const code = 8544;
|
|
1174
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': minVersion ${minVersion} is greater than maxVersion ${maxVersion}.`);
|
|
1175
|
+
},
|
|
1176
|
+
localTlsSecureEnvMissing(envVarName) {
|
|
1177
|
+
const code = 8545;
|
|
1178
|
+
return new base_error_1.BaseError(code, `Local run TLS environment variable '${envVarName}' is empty. Flex Gateway would reject every egress route; re-run local run to re-read the TLS files.`);
|
|
1179
|
+
},
|
|
1180
|
+
localTlsCertificateKeyMismatch(connectionId) {
|
|
1181
|
+
const code = 8546;
|
|
1182
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': the private key in tls.${connectionId}.keyFile does not match any certificate in tls.${connectionId}.certificateFile.`);
|
|
1183
|
+
},
|
|
1184
|
+
localTlsAddedWhileWatching(connectionId) {
|
|
1185
|
+
const code = 8547;
|
|
1186
|
+
return new base_error_1.BaseError(code, `Connection '${connectionId}' now declares a tlsContext, but its TLS settings are only collected when run-local starts. Restart run-local to configure it.`);
|
|
1187
|
+
},
|
|
1188
|
+
localTlsBindingMissing(connectionId) {
|
|
1189
|
+
const code = 8548;
|
|
1190
|
+
return new base_error_1.BaseError(code, `Internal error: no resolved TLS configuration for connection '${connectionId}'. Re-run local run; if it persists, report this error.`);
|
|
1191
|
+
},
|
|
1192
|
+
localTlsNoCipherForMaxVersion(connectionId) {
|
|
1193
|
+
const code = 8549;
|
|
1194
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': maxVersion 1.2 cannot be combined with ciphers that are all TLS 1.3 suites. Add a TLS 1.2 cipher to tls.${connectionId}.ciphers or set tls.${connectionId}.maxVersion to 1.3.`);
|
|
1195
|
+
},
|
|
1196
|
+
localTlsLeafNotFirst(connectionId) {
|
|
1197
|
+
const code = 8550;
|
|
1198
|
+
return new base_error_1.BaseError(code, `TLS for connection '${connectionId}': the private key matches a later certificate in tls.${connectionId}.certificateFile, but the leaf certificate must be the first one. Reorder the file so the client certificate comes first, followed by its chain.`);
|
|
1199
|
+
},
|
|
877
1200
|
networkLockMissing(reason) {
|
|
878
1201
|
return new base_error_1.BaseError(3041, reason);
|
|
879
1202
|
},
|
|
@@ -1058,6 +1381,11 @@ exports.ErrorFactory = {
|
|
|
1058
1381
|
const message = `exchange.json at '${exchangeJsonPath}' has an invalid '${field}' field. Expected a string.`;
|
|
1059
1382
|
return new base_error_1.BaseError(code, message);
|
|
1060
1383
|
},
|
|
1384
|
+
unsupportedAuthenticationKind(kind) {
|
|
1385
|
+
const code = 1038;
|
|
1386
|
+
const message = `Unsupported authentication kind '${kind}'.`;
|
|
1387
|
+
throw new base_error_1.BaseError(code, message);
|
|
1388
|
+
},
|
|
1061
1389
|
// generic
|
|
1062
1390
|
describe(error) {
|
|
1063
1391
|
if (error instanceof base_error_1.BaseError) {
|