@smithy/util-endpoints
Advanced tools
Comparing version 2.1.7 to 3.0.0
@@ -33,3 +33,3 @@ var __defProp = Object.defineProperty; | ||
// src/cache/EndpointCache.ts | ||
var _EndpointCache = class _EndpointCache { | ||
var EndpointCache = class { | ||
/** | ||
@@ -51,2 +51,5 @@ * @param [size] - desired average maximum capacity. A buffer of 10 additional keys will be allowed | ||
} | ||
static { | ||
__name(this, "EndpointCache"); | ||
} | ||
/** | ||
@@ -100,4 +103,2 @@ * @param endpointParams - query for endpoint. | ||
}; | ||
__name(_EndpointCache, "EndpointCache"); | ||
var EndpointCache = _EndpointCache; | ||
@@ -147,3 +148,6 @@ // src/lib/isIpAddress.ts | ||
// src/types/EndpointError.ts | ||
var _EndpointError = class _EndpointError extends Error { | ||
var EndpointError = class extends Error { | ||
static { | ||
__name(this, "EndpointError"); | ||
} | ||
constructor(message) { | ||
@@ -154,4 +158,2 @@ super(message); | ||
}; | ||
__name(_EndpointError, "EndpointError"); | ||
var EndpointError = _EndpointError; | ||
@@ -351,3 +353,2 @@ // src/lib/booleanEquals.ts | ||
var evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => { | ||
var _a, _b; | ||
if (assign && assign in options.referenceRecord) { | ||
@@ -357,3 +358,3 @@ throw new EndpointError(`'${assign}' is already defined in Reference Record.`); | ||
const value = callFunction(fnArgs, options); | ||
(_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); | ||
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); | ||
return { | ||
@@ -367,3 +368,2 @@ result: value === "" ? true : !!value, | ||
var evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => { | ||
var _a, _b; | ||
const conditionsReferenceRecord = {}; | ||
@@ -383,3 +383,3 @@ for (const condition of conditions) { | ||
conditionsReferenceRecord[toAssign.name] = toAssign.value; | ||
(_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); | ||
options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); | ||
} | ||
@@ -450,3 +450,2 @@ } | ||
var evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => { | ||
var _a, _b; | ||
const { conditions, endpoint } = endpointRule; | ||
@@ -462,3 +461,3 @@ const { result, referenceRecord } = evaluateConditions(conditions, options); | ||
const { url, properties, headers } = endpoint; | ||
(_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); | ||
options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); | ||
return { | ||
@@ -527,6 +526,5 @@ ...headers != void 0 && { | ||
var resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options) => { | ||
var _a, _b, _c, _d; | ||
const { endpointParams, logger } = options; | ||
const { parameters, rules } = ruleSetObject; | ||
(_b = (_a = options.logger) == null ? void 0 : _a.debug) == null ? void 0 : _b.call(_a, `${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); | ||
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); | ||
const paramsWithDefault = Object.entries(parameters).filter(([, v]) => v.default != null).map(([k, v]) => [k, v.default]); | ||
@@ -545,3 +543,3 @@ if (paramsWithDefault.length > 0) { | ||
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} }); | ||
(_d = (_c = options.logger) == null ? void 0 : _c.debug) == null ? void 0 : _d.call(_c, `${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); | ||
options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); | ||
return endpoint; | ||
@@ -548,0 +546,0 @@ }, "resolveEndpoint"); |
{ | ||
"name": "@smithy/util-endpoints", | ||
"version": "2.1.7", | ||
"version": "3.0.0", | ||
"description": "Utilities to help with endpoint resolution.", | ||
@@ -31,8 +31,8 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@smithy/node-config-provider": "^3.1.12", | ||
"@smithy/types": "^3.7.2", | ||
"@smithy/node-config-provider": "^4.0.0", | ||
"@smithy/types": "^4.0.0", | ||
"tslib": "^2.6.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^16.18.96", | ||
"@types/node": "^18.11.9", | ||
"concurrently": "7.0.0", | ||
@@ -45,3 +45,3 @@ "downlevel-dts": "0.10.1", | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "typesVersions": { |
76923
1504
+ Added@smithy/node-config-provider@4.0.1(transitive)
+ Added@smithy/property-provider@4.0.1(transitive)
+ Added@smithy/shared-ini-file-loader@4.0.1(transitive)
+ Added@smithy/types@4.1.0(transitive)
- Removed@smithy/node-config-provider@3.1.12(transitive)
- Removed@smithy/property-provider@3.1.11(transitive)
- Removed@smithy/shared-ini-file-loader@3.1.12(transitive)
- Removed@smithy/types@3.7.2(transitive)
Updated@smithy/types@^4.0.0