@aws-sdk/util-endpoints
Advanced tools
Comparing version 3.197.0 to 3.198.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [3.198.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.197.0...v3.198.0) (2022-10-27) | ||
### Features | ||
* **endpoint:** log endpoint decisions at debug level ([#4106](https://github.com/aws/aws-sdk-js-v3/issues/4106)) ([d600213](https://github.com/aws/aws-sdk-js-v3/commit/d600213292eb1bea870c43420367f78406db1c82)) | ||
# [3.197.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.196.0...v3.197.0) (2022-10-26) | ||
@@ -8,0 +19,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveEndpoint = void 0; | ||
const debug_1 = require("./debug"); | ||
const types_1 = require("./types"); | ||
const utils_1 = require("./utils"); | ||
const resolveEndpoint = (ruleSetObject, options) => { | ||
var _a, _b; | ||
var _a, _b, _c, _d, _e, _f; | ||
const { endpointParams, logger } = options; | ||
const { parameters, rules } = ruleSetObject; | ||
(_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `Initial EndpointParams: ${(0, debug_1.toDebugString)(endpointParams)}`); | ||
const paramsWithDefault = Object.entries(parameters) | ||
@@ -15,3 +17,3 @@ .filter(([, v]) => v.default != null) | ||
for (const [paramKey, paramDefaultValue] of paramsWithDefault) { | ||
endpointParams[paramKey] = (_a = endpointParams[paramKey]) !== null && _a !== void 0 ? _a : paramDefaultValue; | ||
endpointParams[paramKey] = (_c = endpointParams[paramKey]) !== null && _c !== void 0 ? _c : paramDefaultValue; | ||
} | ||
@@ -28,3 +30,3 @@ } | ||
const endpoint = (0, utils_1.evaluateRules)(rules, { endpointParams, logger, referenceRecord: {} }); | ||
if ((_b = options.endpointParams) === null || _b === void 0 ? void 0 : _b.Endpoint) { | ||
if ((_d = options.endpointParams) === null || _d === void 0 ? void 0 : _d.Endpoint) { | ||
try { | ||
@@ -39,4 +41,5 @@ const givenEndpoint = new URL(options.endpointParams.Endpoint); | ||
} | ||
(_f = (_e = options.logger) === null || _e === void 0 ? void 0 : _e.debug) === null || _f === void 0 ? void 0 : _f.call(_e, debug_1.debugId, `Resolved endpoint: ${(0, debug_1.toDebugString)(endpoint)}`); | ||
return endpoint; | ||
}; | ||
exports.resolveEndpoint = resolveEndpoint; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.evaluateCondition = void 0; | ||
const debug_1 = require("../debug"); | ||
const types_1 = require("../types"); | ||
const callFunction_1 = require("./callFunction"); | ||
const evaluateCondition = ({ assign, ...fnArgs }, options) => { | ||
var _a, _b; | ||
if (assign && assign in options.referenceRecord) { | ||
@@ -11,2 +13,3 @@ throw new types_1.EndpointError(`'${assign}' is already defined in Reference Record.`); | ||
const value = (0, callFunction_1.callFunction)(fnArgs, options); | ||
(_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `evaluateCondition: ${(0, debug_1.toDebugString)(fnArgs)} = ${(0, debug_1.toDebugString)(value)}`); | ||
return { | ||
@@ -13,0 +16,0 @@ result: value === "" ? true : !!value, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.evaluateConditions = void 0; | ||
const debug_1 = require("../debug"); | ||
const evaluateCondition_1 = require("./evaluateCondition"); | ||
const evaluateConditions = (conditions = [], options) => { | ||
var _a, _b; | ||
const conditionsReferenceRecord = {}; | ||
@@ -20,2 +22,3 @@ for (const condition of conditions) { | ||
conditionsReferenceRecord[toAssign.name] = toAssign.value; | ||
(_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `assign: ${toAssign.name} := ${(0, debug_1.toDebugString)(toAssign.value)}`); | ||
} | ||
@@ -22,0 +25,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.evaluateEndpointRule = void 0; | ||
const debug_1 = require("../debug"); | ||
const evaluateConditions_1 = require("./evaluateConditions"); | ||
@@ -9,2 +10,3 @@ const getEndpointHeaders_1 = require("./getEndpointHeaders"); | ||
const evaluateEndpointRule = (endpointRule, options) => { | ||
var _a, _b; | ||
const { conditions, endpoint } = endpointRule; | ||
@@ -20,2 +22,3 @@ const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); | ||
const { url, properties, headers } = endpoint; | ||
(_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `Resolving endpoint from template: ${(0, debug_1.toDebugString)(endpoint)}`); | ||
return { | ||
@@ -22,0 +25,0 @@ ...(headers != undefined && { |
@@ -0,1 +1,2 @@ | ||
import { debugId, toDebugString } from "./debug"; | ||
import { EndpointError } from "./types"; | ||
@@ -6,2 +7,3 @@ import { evaluateRules } from "./utils"; | ||
const { parameters, rules } = ruleSetObject; | ||
options.logger?.debug?.(debugId, `Initial EndpointParams: ${toDebugString(endpointParams)}`); | ||
const paramsWithDefault = Object.entries(parameters) | ||
@@ -34,3 +36,4 @@ .filter(([, v]) => v.default != null) | ||
} | ||
options.logger?.debug?.(debugId, `Resolved endpoint: ${toDebugString(endpoint)}`); | ||
return endpoint; | ||
}; |
@@ -0,1 +1,2 @@ | ||
import { debugId, toDebugString } from "../debug"; | ||
import { EndpointError } from "../types"; | ||
@@ -8,2 +9,3 @@ import { callFunction } from "./callFunction"; | ||
const value = callFunction(fnArgs, options); | ||
options.logger?.debug?.(debugId, `evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); | ||
return { | ||
@@ -10,0 +12,0 @@ result: value === "" ? true : !!value, |
@@ -0,1 +1,2 @@ | ||
import { debugId, toDebugString } from "../debug"; | ||
import { evaluateCondition } from "./evaluateCondition"; | ||
@@ -17,2 +18,3 @@ export const evaluateConditions = (conditions = [], options) => { | ||
conditionsReferenceRecord[toAssign.name] = toAssign.value; | ||
options.logger?.debug?.(debugId, `assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); | ||
} | ||
@@ -19,0 +21,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { debugId, toDebugString } from "../debug"; | ||
import { evaluateConditions } from "./evaluateConditions"; | ||
@@ -16,2 +17,3 @@ import { getEndpointHeaders } from "./getEndpointHeaders"; | ||
const { url, properties, headers } = endpoint; | ||
options.logger?.debug?.(debugId, `Resolving endpoint from template: ${toDebugString(endpoint)}`); | ||
return { | ||
@@ -18,0 +20,0 @@ ...(headers != undefined && { |
{ | ||
"name": "@aws-sdk/util-endpoints", | ||
"version": "3.197.0", | ||
"version": "3.198.0", | ||
"description": "Utilities to help with endpoint resolution", | ||
@@ -24,3 +24,3 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@aws-sdk/types": "3.197.0", | ||
"@aws-sdk/types": "3.198.0", | ||
"tslib": "^2.3.1" | ||
@@ -27,0 +27,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91761
178
1857
+ Added@aws-sdk/types@3.198.0(transitive)
- Removed@aws-sdk/types@3.197.0(transitive)
Updated@aws-sdk/types@3.198.0