/*
* TagoIO (https://tago.io/)
* TagoIO Builder V3.1.3 (https://git.io/JJ8Si)
* -------------------
* Generated by :: vitorlima
* Generated at :: quinta-feira, 28 de novembro de 2024 às 17:20 Horário Universal Coordenado
* Machine :: Vitors-MacBook-Air.local <darwin> - Node.js v20.14.0
* Origin file :: analysis/analysis.ts <TypeScript>
* Destination file :: analysis/analysis.tago-io.js
* -------------------
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) =>
function __require() {
return (mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports);
};
var __export = (target, all) => {
for (var name in all) __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
__copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
)
);
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// node_modules/@smithy/types/dist-cjs/index.js
var require_dist_cjs = __commonJS({
"node_modules/@smithy/types/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
AlgorithmId: () => AlgorithmId,
EndpointURLScheme: () => EndpointURLScheme,
FieldPosition: () => FieldPosition,
HttpApiKeyAuthLocation: () => HttpApiKeyAuthLocation,
HttpAuthLocation: () => HttpAuthLocation,
IniSectionType: () => IniSectionType,
RequestHandlerProtocol: () => RequestHandlerProtocol,
SMITHY_CONTEXT_KEY: () => SMITHY_CONTEXT_KEY,
getDefaultClientConfiguration: () => getDefaultClientConfiguration,
resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig,
});
module2.exports = __toCommonJS2(src_exports);
var HttpAuthLocation = /* @__PURE__ */ ((HttpAuthLocation2) => {
HttpAuthLocation2["HEADER"] = "header";
HttpAuthLocation2["QUERY"] = "query";
return HttpAuthLocation2;
})(HttpAuthLocation || {});
var HttpApiKeyAuthLocation = /* @__PURE__ */ ((HttpApiKeyAuthLocation2) => {
HttpApiKeyAuthLocation2["HEADER"] = "header";
HttpApiKeyAuthLocation2["QUERY"] = "query";
return HttpApiKeyAuthLocation2;
})(HttpApiKeyAuthLocation || {});
var EndpointURLScheme = /* @__PURE__ */ ((EndpointURLScheme2) => {
EndpointURLScheme2["HTTP"] = "http";
EndpointURLScheme2["HTTPS"] = "https";
return EndpointURLScheme2;
})(EndpointURLScheme || {});
var AlgorithmId = /* @__PURE__ */ ((AlgorithmId2) => {
AlgorithmId2["MD5"] = "md5";
AlgorithmId2["CRC32"] = "crc32";
AlgorithmId2["CRC32C"] = "crc32c";
AlgorithmId2["SHA1"] = "sha1";
AlgorithmId2["SHA256"] = "sha256";
return AlgorithmId2;
})(AlgorithmId || {});
var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
const checksumAlgorithms = [];
if (runtimeConfig.sha256 !== void 0) {
checksumAlgorithms.push({
algorithmId: () => "sha256",
checksumConstructor: () => runtimeConfig.sha256,
});
}
if (runtimeConfig.md5 != void 0) {
checksumAlgorithms.push({
algorithmId: () => "md5",
checksumConstructor: () => runtimeConfig.md5,
});
}
return {
_checksumAlgorithms: checksumAlgorithms,
addChecksumAlgorithm(algo) {
this._checksumAlgorithms.push(algo);
},
checksumAlgorithms() {
return this._checksumAlgorithms;
},
};
}, "getChecksumConfiguration");
var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {
const runtimeConfig = {};
clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
});
return runtimeConfig;
}, "resolveChecksumRuntimeConfig");
var getDefaultClientConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
return {
...getChecksumConfiguration(runtimeConfig),
};
}, "getDefaultClientConfiguration");
var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {
return {
...resolveChecksumRuntimeConfig(config),
};
}, "resolveDefaultRuntimeConfig");
var FieldPosition = /* @__PURE__ */ ((FieldPosition2) => {
FieldPosition2[(FieldPosition2["HEADER"] = 0)] = "HEADER";
FieldPosition2[(FieldPosition2["TRAILER"] = 1)] = "TRAILER";
return FieldPosition2;
})(FieldPosition || {});
var SMITHY_CONTEXT_KEY = "__smithy_context";
var IniSectionType = /* @__PURE__ */ ((IniSectionType2) => {
IniSectionType2["PROFILE"] = "profile";
IniSectionType2["SSO_SESSION"] = "sso-session";
IniSectionType2["SERVICES"] = "services";
return IniSectionType2;
})(IniSectionType || {});
var RequestHandlerProtocol = /* @__PURE__ */ ((RequestHandlerProtocol2) => {
RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9";
RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0";
RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0";
return RequestHandlerProtocol2;
})(RequestHandlerProtocol || {});
},
});
// node_modules/@smithy/protocol-http/dist-cjs/index.js
var require_dist_cjs2 = __commonJS({
"node_modules/@smithy/protocol-http/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
Field: () => Field,
Fields: () => Fields,
HttpRequest: () => HttpRequest,
HttpResponse: () => HttpResponse,
getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration,
isValidHostname: () => isValidHostname,
resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig,
});
module2.exports = __toCommonJS2(src_exports);
var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
let httpHandler = runtimeConfig.httpHandler;
return {
setHttpHandler(handler) {
httpHandler = handler;
},
httpHandler() {
return httpHandler;
},
updateHttpClientConfig(key, value) {
httpHandler.updateHttpClientConfig(key, value);
},
httpHandlerConfigs() {
return httpHandler.httpHandlerConfigs();
},
};
}, "getHttpHandlerExtensionConfiguration");
var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => {
return {
httpHandler: httpHandlerExtensionConfiguration.httpHandler(),
};
}, "resolveHttpHandlerRuntimeConfig");
var import_types = require_dist_cjs();
var _Field = class _Field {
constructor({ name, kind = import_types.FieldPosition.HEADER, values = [] }) {
this.name = name;
this.kind = kind;
this.values = values;
}
add(value) {
this.values.push(value);
}
set(values) {
this.values = values;
}
remove(value) {
this.values = this.values.filter((v) => v !== value);
}
toString() {
return this.values.map((v) => (v.includes(",") || v.includes(" ") ? `"${v}"` : v)).join(", ");
}
get() {
return this.values;
}
};
__name(_Field, "Field");
var Field = _Field;
var _Fields = class _Fields {
constructor({ fields = [], encoding = "utf-8" }) {
this.entries = {};
fields.forEach(this.setField.bind(this));
this.encoding = encoding;
}
setField(field) {
this.entries[field.name.toLowerCase()] = field;
}
getField(name) {
return this.entries[name.toLowerCase()];
}
removeField(name) {
delete this.entries[name.toLowerCase()];
}
getByType(kind) {
return Object.values(this.entries).filter((field) => field.kind === kind);
}
};
__name(_Fields, "Fields");
var Fields = _Fields;
var _HttpRequest = class _HttpRequest2 {
constructor(options) {
this.method = options.method || "GET";
this.hostname = options.hostname || "localhost";
this.port = options.port;
this.query = options.query || {};
this.headers = options.headers || {};
this.body = options.body;
this.protocol = options.protocol
? options.protocol.slice(-1) !== ":"
? `${options.protocol}:`
: options.protocol
: "https:";
this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/";
this.username = options.username;
this.password = options.password;
this.fragment = options.fragment;
}
static isInstance(request) {
if (!request) return false;
const req = request;
return (
"method" in req &&
"protocol" in req &&
"hostname" in req &&
"path" in req &&
typeof req["query"] === "object" &&
typeof req["headers"] === "object"
);
}
clone() {
const cloned = new _HttpRequest2({
...this,
headers: { ...this.headers },
});
if (cloned.query) cloned.query = cloneQuery(cloned.query);
return cloned;
}
};
__name(_HttpRequest, "HttpRequest");
var HttpRequest = _HttpRequest;
function cloneQuery(query) {
return Object.keys(query).reduce((carry, paramName) => {
const param = query[paramName];
return {
...carry,
[paramName]: Array.isArray(param) ? [...param] : param,
};
}, {});
}
__name(cloneQuery, "cloneQuery");
var _HttpResponse = class _HttpResponse {
constructor(options) {
this.statusCode = options.statusCode;
this.reason = options.reason;
this.headers = options.headers || {};
this.body = options.body;
}
static isInstance(response) {
if (!response) return false;
const resp = response;
return typeof resp.statusCode === "number" && typeof resp.headers === "object";
}
};
__name(_HttpResponse, "HttpResponse");
var HttpResponse = _HttpResponse;
function isValidHostname(hostname) {
const hostPattern = /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/;
return hostPattern.test(hostname);
}
__name(isValidHostname, "isValidHostname");
},
});
// node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js
var require_dist_cjs3 = __commonJS({
"node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
getHostHeaderPlugin: () => getHostHeaderPlugin,
hostHeaderMiddleware: () => hostHeaderMiddleware,
hostHeaderMiddlewareOptions: () => hostHeaderMiddlewareOptions,
resolveHostHeaderConfig: () => resolveHostHeaderConfig,
});
module2.exports = __toCommonJS2(src_exports);
var import_protocol_http = require_dist_cjs2();
function resolveHostHeaderConfig(input) {
return input;
}
__name(resolveHostHeaderConfig, "resolveHostHeaderConfig");
var hostHeaderMiddleware = /* @__PURE__ */ __name(
(options) => (next) => async (args) => {
if (!import_protocol_http.HttpRequest.isInstance(args.request)) return next(args);
const { request } = args;
const { handlerProtocol = "" } = options.requestHandler.metadata || {};
if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
delete request.headers["host"];
request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
} else if (!request.headers["host"]) {
let host = request.hostname;
if (request.port != null) host += `:${request.port}`;
request.headers["host"] = host;
}
return next(args);
},
"hostHeaderMiddleware"
);
var hostHeaderMiddlewareOptions = {
name: "hostHeaderMiddleware",
step: "build",
priority: "low",
tags: ["HOST"],
override: true,
};
var getHostHeaderPlugin = /* @__PURE__ */ __name(
(options) => ({
applyToStack: (clientStack) => {
clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
},
}),
"getHostHeaderPlugin"
);
},
});
// node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js
var require_dist_cjs4 = __commonJS({
"node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
getLoggerPlugin: () => getLoggerPlugin,
loggerMiddleware: () => loggerMiddleware,
loggerMiddlewareOptions: () => loggerMiddlewareOptions,
});
module2.exports = __toCommonJS2(src_exports);
var loggerMiddleware = /* @__PURE__ */ __name(
() => (next, context) => async (args) => {
var _a, _b;
try {
const response = await next(args);
const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
const { $metadata, ...outputWithoutMetadata } = response.output;
(_a = logger == null ? void 0 : logger.info) == null
? void 0
: _a.call(logger, {
clientName,
commandName,
input: inputFilterSensitiveLog(args.input),
output: outputFilterSensitiveLog(outputWithoutMetadata),
metadata: $metadata,
});
return response;
} catch (error) {
const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
(_b = logger == null ? void 0 : logger.error) == null
? void 0
: _b.call(logger, {
clientName,
commandName,
input: inputFilterSensitiveLog(args.input),
error,
metadata: error.$metadata,
});
throw error;
}
},
"loggerMiddleware"
);
var loggerMiddlewareOptions = {
name: "loggerMiddleware",
tags: ["LOGGER"],
step: "initialize",
override: true,
};
var getLoggerPlugin = /* @__PURE__ */ __name(
(options) => ({
applyToStack: (clientStack) => {
clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
},
}),
"getLoggerPlugin"
);
},
});
// node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js
var require_dist_cjs5 = __commonJS({
"node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
addRecursionDetectionMiddlewareOptions: () => addRecursionDetectionMiddlewareOptions,
getRecursionDetectionPlugin: () => getRecursionDetectionPlugin,
recursionDetectionMiddleware: () => recursionDetectionMiddleware,
});
module2.exports = __toCommonJS2(src_exports);
var import_protocol_http = require_dist_cjs2();
var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
var recursionDetectionMiddleware = /* @__PURE__ */ __name(
(options) => (next) => async (args) => {
const { request } = args;
if (
!import_protocol_http.HttpRequest.isInstance(request) ||
options.runtime !== "node" ||
Object.hasOwn(request.headers, TRACE_ID_HEADER_NAME)
) {
return next(args);
}
const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
const traceId = process.env[ENV_TRACE_ID];
const nonEmptyString = /* @__PURE__ */ __name(
(str) => typeof str === "string" && str.length > 0,
"nonEmptyString"
);
if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
request.headers[TRACE_ID_HEADER_NAME] = traceId;
}
return next({
...args,
request,
});
},
"recursionDetectionMiddleware"
);
var addRecursionDetectionMiddlewareOptions = {
step: "build",
tags: ["RECURSION_DETECTION"],
name: "recursionDetectionMiddleware",
override: true,
priority: "low",
};
var getRecursionDetectionPlugin = /* @__PURE__ */ __name(
(options) => ({
applyToStack: (clientStack) => {
clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
},
}),
"getRecursionDetectionPlugin"
);
},
});
// node_modules/@smithy/util-endpoints/dist-cjs/index.js
var require_dist_cjs6 = __commonJS({
"node_modules/@smithy/util-endpoints/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
EndpointError: () => EndpointError2,
customEndpointFunctions: () => customEndpointFunctions,
isIpAddress: () => isIpAddress2,
isValidHostLabel: () => isValidHostLabel,
resolveEndpoint: () => resolveEndpoint2,
});
module2.exports = __toCommonJS2(src_exports);
var IP_V4_REGEX = /^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/;
var isIpAddress2 = /* @__PURE__ */ __name(
(value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]")),
"isIpAddress"
);
var VALID_HOST_LABEL_REGEX = /^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$/;
var isValidHostLabel = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
if (!allowSubDomains) {
return VALID_HOST_LABEL_REGEX.test(value);
}
const labels = value.split(".");
for (const label of labels) {
if (!isValidHostLabel(label)) {
return false;
}
}
return true;
}, "isValidHostLabel");
var customEndpointFunctions = {};
var debugId = "endpoints";
function toDebugString(input) {
if (typeof input !== "object" || input == null) {
return input;
}
if ("ref" in input) {
return `$${toDebugString(input.ref)}`;
}
if ("fn" in input) {
return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
}
return JSON.stringify(input, null, 2);
}
__name(toDebugString, "toDebugString");
var _EndpointError = class _EndpointError extends Error {
constructor(message) {
super(message);
this.name = "EndpointError";
}
};
__name(_EndpointError, "EndpointError");
var EndpointError2 = _EndpointError;
var booleanEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "booleanEquals");
var getAttrPathList = /* @__PURE__ */ __name((path) => {
const parts = path.split(".");
const pathList = [];
for (const part of parts) {
const squareBracketIndex = part.indexOf("[");
if (squareBracketIndex !== -1) {
if (part.indexOf("]") !== part.length - 1) {
throw new EndpointError2(`Path: '${path}' does not end with ']'`);
}
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
if (Number.isNaN(parseInt(arrayIndex))) {
throw new EndpointError2(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
}
if (squareBracketIndex !== 0) {
pathList.push(part.slice(0, squareBracketIndex));
}
pathList.push(arrayIndex);
} else {
pathList.push(part);
}
}
return pathList;
}, "getAttrPathList");
var getAttr = /* @__PURE__ */ __name(
(value, path) =>
getAttrPathList(path).reduce((acc, index) => {
if (typeof acc !== "object") {
throw new EndpointError2(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
} else if (Array.isArray(acc)) {
return acc[parseInt(index)];
}
return acc[index];
}, value),
"getAttr"
);
var isSet = /* @__PURE__ */ __name((value) => value != null, "isSet");
var not = /* @__PURE__ */ __name((value) => !value, "not");
var import_types3 = require_dist_cjs();
var DEFAULT_PORTS = {
[import_types3.EndpointURLScheme.HTTP]: 80,
[import_types3.EndpointURLScheme.HTTPS]: 443,
};
var parseURL = /* @__PURE__ */ __name((value) => {
const whatwgURL = (() => {
try {
if (value instanceof URL) {
return value;
}
if (typeof value === "object" && "hostname" in value) {
const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value;
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`);
url.search = Object.entries(query)
.map(([k, v]) => `${k}=${v}`)
.join("&");
return url;
}
return new URL(value);
} catch (error) {
return null;
}
})();
if (!whatwgURL) {
console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
return null;
}
const urlString = whatwgURL.href;
const { host, hostname, pathname, protocol, search } = whatwgURL;
if (search) {
return null;
}
const scheme = protocol.slice(0, -1);
if (!Object.values(import_types3.EndpointURLScheme).includes(scheme)) {
return null;
}
const isIp = isIpAddress2(hostname);
const inputContainsDefaultPort =
urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) ||
(typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`));
const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
return {
scheme,
authority,
path: pathname,
normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
isIp,
};
}, "parseURL");
var stringEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "stringEquals");
var substring = /* @__PURE__ */ __name((input, start, stop, reverse) => {
if (start >= stop || input.length < stop) {
return null;
}
if (!reverse) {
return input.substring(start, stop);
}
return input.substring(input.length - stop, input.length - start);
}, "substring");
var uriEncode = /* @__PURE__ */ __name(
(value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`),
"uriEncode"
);
var endpointFunctions = {
booleanEquals,
getAttr,
isSet,
isValidHostLabel,
not,
parseURL,
stringEquals,
substring,
uriEncode,
};
var evaluateTemplate = /* @__PURE__ */ __name((template, options) => {
const evaluatedTemplateArr = [];
const templateContext = {
...options.endpointParams,
...options.referenceRecord,
};
let currentIndex = 0;
while (currentIndex < template.length) {
const openingBraceIndex = template.indexOf("{", currentIndex);
if (openingBraceIndex === -1) {
evaluatedTemplateArr.push(template.slice(currentIndex));
break;
}
evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
const closingBraceIndex = template.indexOf("}", openingBraceIndex);
if (closingBraceIndex === -1) {
evaluatedTemplateArr.push(template.slice(openingBraceIndex));
break;
}
if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
currentIndex = closingBraceIndex + 2;
}
const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
if (parameterName.includes("#")) {
const [refName, attrName] = parameterName.split("#");
evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));
} else {
evaluatedTemplateArr.push(templateContext[parameterName]);
}
currentIndex = closingBraceIndex + 1;
}
return evaluatedTemplateArr.join("");
}, "evaluateTemplate");
var getReferenceValue = /* @__PURE__ */ __name(({ ref }, options) => {
const referenceRecord = {
...options.endpointParams,
...options.referenceRecord,
};
return referenceRecord[ref];
}, "getReferenceValue");
var evaluateExpression = /* @__PURE__ */ __name((obj, keyName, options) => {
if (typeof obj === "string") {
return evaluateTemplate(obj, options);
} else if (obj["fn"]) {
return callFunction(obj, options);
} else if (obj["ref"]) {
return getReferenceValue(obj, options);
}
throw new EndpointError2(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
}, "evaluateExpression");
var callFunction = /* @__PURE__ */ __name(({ fn, argv }, options) => {
const evaluatedArgs = argv.map((arg) =>
["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options)
);
const fnSegments = fn.split(".");
if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
}
return endpointFunctions[fn](...evaluatedArgs);
}, "callFunction");
var evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => {
var _a, _b;
if (assign && assign in options.referenceRecord) {
throw new EndpointError2(`'${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)}`);
return {
result: value === "" ? true : !!value,
...(assign != null && { toAssign: { name: assign, value } }),
};
}, "evaluateCondition");
var evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => {
var _a, _b;
const conditionsReferenceRecord = {};
for (const condition of conditions) {
const { result, toAssign } = evaluateCondition(condition, {
...options,
referenceRecord: {
...options.referenceRecord,
...conditionsReferenceRecord,
},
});
if (!result) {
return { result };
}
if (toAssign) {
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)}`);
}
}
return { result: true, referenceRecord: conditionsReferenceRecord };
}, "evaluateConditions");
var getEndpointHeaders = /* @__PURE__ */ __name(
(headers, options) =>
Object.entries(headers).reduce(
(acc, [headerKey, headerVal]) => ({
...acc,
[headerKey]: headerVal.map((headerValEntry) => {
const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
if (typeof processedExpr !== "string") {
throw new EndpointError2(`Header '${headerKey}' value '${processedExpr}' is not a string`);
}
return processedExpr;
}),
}),
{}
),
"getEndpointHeaders"
);
var getEndpointProperty = /* @__PURE__ */ __name((property, options) => {
if (Array.isArray(property)) {
return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
}
switch (typeof property) {
case "string":
return evaluateTemplate(property, options);
case "object":
if (property === null) {
throw new EndpointError2(`Unexpected endpoint property: ${property}`);
}
return getEndpointProperties(property, options);
case "boolean":
return property;
default:
throw new EndpointError2(`Unexpected endpoint property type: ${typeof property}`);
}
}, "getEndpointProperty");
var getEndpointProperties = /* @__PURE__ */ __name(
(properties, options) =>
Object.entries(properties).reduce(
(acc, [propertyKey, propertyVal]) => ({
...acc,
[propertyKey]: getEndpointProperty(propertyVal, options),
}),
{}
),
"getEndpointProperties"
);
var getEndpointUrl = /* @__PURE__ */ __name((endpointUrl, options) => {
const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
if (typeof expression === "string") {
try {
return new URL(expression);
} catch (error) {
console.error(`Failed to construct URL with ${expression}`, error);
throw error;
}
}
throw new EndpointError2(`Endpoint URL must be a string, got ${typeof expression}`);
}, "getEndpointUrl");
var evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => {
var _a, _b;
const { conditions, endpoint } = endpointRule;
const { result, referenceRecord } = evaluateConditions(conditions, options);
if (!result) {
return;
}
const endpointRuleOptions = {
...options,
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
};
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)}`);
return {
...(headers != void 0 && {
headers: getEndpointHeaders(headers, endpointRuleOptions),
}),
...(properties != void 0 && {
properties: getEndpointProperties(properties, endpointRuleOptions),
}),
url: getEndpointUrl(url, endpointRuleOptions),
};
}, "evaluateEndpointRule");
var evaluateErrorRule = /* @__PURE__ */ __name((errorRule, options) => {
const { conditions, error } = errorRule;
const { result, referenceRecord } = evaluateConditions(conditions, options);
if (!result) {
return;
}
throw new EndpointError2(
evaluateExpression(error, "Error", {
...options,
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
})
);
}, "evaluateErrorRule");
var evaluateTreeRule = /* @__PURE__ */ __name((treeRule, options) => {
const { conditions, rules } = treeRule;
const { result, referenceRecord } = evaluateConditions(conditions, options);
if (!result) {
return;
}
return evaluateRules(rules, {
...options,
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
});
}, "evaluateTreeRule");
var evaluateRules = /* @__PURE__ */ __name((rules, options) => {
for (const rule of rules) {
if (rule.type === "endpoint") {
const endpointOrUndefined = evaluateEndpointRule(rule, options);
if (endpointOrUndefined) {
return endpointOrUndefined;
}
} else if (rule.type === "error") {
evaluateErrorRule(rule, options);
} else if (rule.type === "tree") {
const endpointOrUndefined = evaluateTreeRule(rule, options);
if (endpointOrUndefined) {
return endpointOrUndefined;
}
} else {
throw new EndpointError2(`Unknown endpoint rule: ${rule}`);
}
}
throw new EndpointError2(`Rules evaluation failed`);
}, "evaluateRules");
var resolveEndpoint2 = /* @__PURE__ */ __name((ruleSetObject, options) => {
var _a, _b, _c, _d, _e;
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)}`);
const paramsWithDefault = Object.entries(parameters)
.filter(([, v]) => v.default != null)
.map(([k, v]) => [k, v.default]);
if (paramsWithDefault.length > 0) {
for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
}
}
const requiredParams = Object.entries(parameters)
.filter(([, v]) => v.required)
.map(([k]) => k);
for (const requiredParam of requiredParams) {
if (endpointParams[requiredParam] == null) {
throw new EndpointError2(`Missing required parameter: '${requiredParam}'`);
}
}
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
if ((_c = options.endpointParams) == null ? void 0 : _c.Endpoint) {
try {
const givenEndpoint = new URL(options.endpointParams.Endpoint);
const { protocol, port } = givenEndpoint;
endpoint.url.protocol = protocol;
endpoint.url.port = port;
} catch (e) {}
}
(_e = (_d = options.logger) == null ? void 0 : _d.debug) == null
? void 0
: _e.call(_d, `${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
return endpoint;
}, "resolveEndpoint");
},
});
// node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js
var require_dist_cjs7 = __commonJS({
"node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
ConditionObject: () => import_util_endpoints.ConditionObject,
DeprecatedObject: () => import_util_endpoints.DeprecatedObject,
EndpointError: () => import_util_endpoints.EndpointError,
EndpointObject: () => import_util_endpoints.EndpointObject,
EndpointObjectHeaders: () => import_util_endpoints.EndpointObjectHeaders,
EndpointObjectProperties: () => import_util_endpoints.EndpointObjectProperties,
EndpointParams: () => import_util_endpoints.EndpointParams,
EndpointResolverOptions: () => import_util_endpoints.EndpointResolverOptions,
EndpointRuleObject: () => import_util_endpoints.EndpointRuleObject,
ErrorRuleObject: () => import_util_endpoints.ErrorRuleObject,
EvaluateOptions: () => import_util_endpoints.EvaluateOptions,
Expression: () => import_util_endpoints.Expression,
FunctionArgv: () => import_util_endpoints.FunctionArgv,
FunctionObject: () => import_util_endpoints.FunctionObject,
FunctionReturn: () => import_util_endpoints.FunctionReturn,
ParameterObject: () => import_util_endpoints.ParameterObject,
ReferenceObject: () => import_util_endpoints.ReferenceObject,
ReferenceRecord: () => import_util_endpoints.ReferenceRecord,
RuleSetObject: () => import_util_endpoints.RuleSetObject,
RuleSetRules: () => import_util_endpoints.RuleSetRules,
TreeRuleObject: () => import_util_endpoints.TreeRuleObject,
awsEndpointFunctions: () => awsEndpointFunctions,
getUserAgentPrefix: () => getUserAgentPrefix,
isIpAddress: () => import_util_endpoints.isIpAddress,
partition: () => partition,
resolveEndpoint: () => import_util_endpoints.resolveEndpoint,
setPartitionInfo: () => setPartitionInfo,
useDefaultPartitionInfo: () => useDefaultPartitionInfo,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_endpoints = require_dist_cjs6();
var isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
if (allowSubDomains) {
for (const label of value.split(".")) {
if (!isVirtualHostableS3Bucket(label)) {
return false;
}
}
return true;
}
if (!(0, import_util_endpoints.isValidHostLabel)(value)) {
return false;
}
if (value.length < 3 || value.length > 63) {
return false;
}
if (value !== value.toLowerCase()) {
return false;
}
if ((0, import_util_endpoints.isIpAddress)(value)) {
return false;
}
return true;
}, "isVirtualHostableS3Bucket");
var parseArn = /* @__PURE__ */ __name((value) => {
const segments = value.split(":");
if (segments.length < 6) return null;
const [arn, partition2, service, region, accountId, ...resourceId] = segments;
if (arn !== "arn" || partition2 === "" || service === "" || resourceId[0] === "") return null;
return {
partition: partition2,
service,
region,
accountId,
resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId,
};
}, "parseArn");
var partitions_default = {
partitions: [
{
id: "aws",
outputs: {
dnsSuffix: "amazonaws.com",
dualStackDnsSuffix: "api.aws",
implicitGlobalRegion: "us-east-1",
name: "aws",
supportsDualStack: true,
supportsFIPS: true,
},
regionRegex: "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",
regions: {
"af-south-1": {
description: "Africa (Cape Town)",
},
"ap-east-1": {
description: "Asia Pacific (Hong Kong)",
},
"ap-northeast-1": {
description: "Asia Pacific (Tokyo)",
},
"ap-northeast-2": {
description: "Asia Pacific (Seoul)",
},
"ap-northeast-3": {
description: "Asia Pacific (Osaka)",
},
"ap-south-1": {
description: "Asia Pacific (Mumbai)",
},
"ap-south-2": {
description: "Asia Pacific (Hyderabad)",
},
"ap-southeast-1": {
description: "Asia Pacific (Singapore)",
},
"ap-southeast-2": {
description: "Asia Pacific (Sydney)",
},
"ap-southeast-3": {
description: "Asia Pacific (Jakarta)",
},
"ap-southeast-4": {
description: "Asia Pacific (Melbourne)",
},
"aws-global": {
description: "AWS Standard global region",
},
"ca-central-1": {
description: "Canada (Central)",
},
"ca-west-1": {
description: "Canada West (Calgary)",
},
"eu-central-1": {
description: "Europe (Frankfurt)",
},
"eu-central-2": {
description: "Europe (Zurich)",
},
"eu-north-1": {
description: "Europe (Stockholm)",
},
"eu-south-1": {
description: "Europe (Milan)",
},
"eu-south-2": {
description: "Europe (Spain)",
},
"eu-west-1": {
description: "Europe (Ireland)",
},
"eu-west-2": {
description: "Europe (London)",
},
"eu-west-3": {
description: "Europe (Paris)",
},
"il-central-1": {
description: "Israel (Tel Aviv)",
},
"me-central-1": {
description: "Middle East (UAE)",
},
"me-south-1": {
description: "Middle East (Bahrain)",
},
"sa-east-1": {
description: "South America (Sao Paulo)",
},
"us-east-1": {
description: "US East (N. Virginia)",
},
"us-east-2": {
description: "US East (Ohio)",
},
"us-west-1": {
description: "US West (N. California)",
},
"us-west-2": {
description: "US West (Oregon)",
},
},
},
{
id: "aws-cn",
outputs: {
dnsSuffix: "amazonaws.com.cn",
dualStackDnsSuffix: "api.amazonwebservices.com.cn",
implicitGlobalRegion: "cn-northwest-1",
name: "aws-cn",
supportsDualStack: true,
supportsFIPS: true,
},
regionRegex: "^cn\\-\\w+\\-\\d+$",
regions: {
"aws-cn-global": {
description: "AWS China global region",
},
"cn-north-1": {
description: "China (Beijing)",
},
"cn-northwest-1": {
description: "China (Ningxia)",
},
},
},
{
id: "aws-us-gov",
outputs: {
dnsSuffix: "amazonaws.com",
dualStackDnsSuffix: "api.aws",
implicitGlobalRegion: "us-gov-west-1",
name: "aws-us-gov",
supportsDualStack: true,
supportsFIPS: true,
},
regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
regions: {
"aws-us-gov-global": {
description: "AWS GovCloud (US) global region",
},
"us-gov-east-1": {
description: "AWS GovCloud (US-East)",
},
"us-gov-west-1": {
description: "AWS GovCloud (US-West)",
},
},
},
{
id: "aws-iso",
outputs: {
dnsSuffix: "c2s.ic.gov",
dualStackDnsSuffix: "c2s.ic.gov",
implicitGlobalRegion: "us-iso-east-1",
name: "aws-iso",
supportsDualStack: false,
supportsFIPS: true,
},
regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
regions: {
"aws-iso-global": {
description: "AWS ISO (US) global region",
},
"us-iso-east-1": {
description: "US ISO East",
},
"us-iso-west-1": {
description: "US ISO WEST",
},
},
},
{
id: "aws-iso-b",
outputs: {
dnsSuffix: "sc2s.sgov.gov",
dualStackDnsSuffix: "sc2s.sgov.gov",
implicitGlobalRegion: "us-isob-east-1",
name: "aws-iso-b",
supportsDualStack: false,
supportsFIPS: true,
},
regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
regions: {
"aws-iso-b-global": {
description: "AWS ISOB (US) global region",
},
"us-isob-east-1": {
description: "US ISOB East (Ohio)",
},
},
},
{
id: "aws-iso-e",
outputs: {
dnsSuffix: "cloud.adc-e.uk",
dualStackDnsSuffix: "cloud.adc-e.uk",
implicitGlobalRegion: "eu-isoe-west-1",
name: "aws-iso-e",
supportsDualStack: false,
supportsFIPS: true,
},
regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
regions: {
"eu-isoe-west-1": {
description: "EU ISOE West",
},
},
},
{
id: "aws-iso-f",
outputs: {
dnsSuffix: "csp.hci.ic.gov",
dualStackDnsSuffix: "csp.hci.ic.gov",
implicitGlobalRegion: "us-isof-south-1",
name: "aws-iso-f",
supportsDualStack: false,
supportsFIPS: true,
},
regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
regions: {},
},
],
version: "1.1",
};
var selectedPartitionsInfo = partitions_default;
var selectedUserAgentPrefix = "";
var partition = /* @__PURE__ */ __name((value) => {
const { partitions } = selectedPartitionsInfo;
for (const partition2 of partitions) {
const { regions, outputs } = partition2;
for (const [region, regionData] of Object.entries(regions)) {
if (region === value) {
return {
...outputs,
...regionData,
};
}
}
}
for (const partition2 of partitions) {
const { regionRegex, outputs } = partition2;
if (new RegExp(regionRegex).test(value)) {
return {
...outputs,
};
}
}
const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
if (!DEFAULT_PARTITION) {
throw new Error(
"Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."
);
}
return {
...DEFAULT_PARTITION.outputs,
};
}, "partition");
var setPartitionInfo = /* @__PURE__ */ __name((partitionsInfo, userAgentPrefix = "") => {
selectedPartitionsInfo = partitionsInfo;
selectedUserAgentPrefix = userAgentPrefix;
}, "setPartitionInfo");
var useDefaultPartitionInfo = /* @__PURE__ */ __name(() => {
setPartitionInfo(partitions_default, "");
}, "useDefaultPartitionInfo");
var getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix");
var awsEndpointFunctions = {
isVirtualHostableS3Bucket,
parseArn,
partition,
};
import_util_endpoints.customEndpointFunctions.aws = awsEndpointFunctions;
},
});
// node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js
var require_dist_cjs8 = __commonJS({
"node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
getUserAgentMiddlewareOptions: () => getUserAgentMiddlewareOptions,
getUserAgentPlugin: () => getUserAgentPlugin,
resolveUserAgentConfig: () => resolveUserAgentConfig,
userAgentMiddleware: () => userAgentMiddleware,
});
module2.exports = __toCommonJS2(src_exports);
function resolveUserAgentConfig(input) {
return {
...input,
customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent,
};
}
__name(resolveUserAgentConfig, "resolveUserAgentConfig");
var import_util_endpoints = require_dist_cjs7();
var import_protocol_http = require_dist_cjs2();
var USER_AGENT = "user-agent";
var X_AMZ_USER_AGENT = "x-amz-user-agent";
var SPACE = " ";
var UA_NAME_SEPARATOR = "/";
var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\d\w]/g;
var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\d\w#]/g;
var UA_ESCAPE_CHAR = "-";
var userAgentMiddleware = /* @__PURE__ */ __name(
(options) => (next, context) => async (args) => {
var _a, _b;
const { request } = args;
if (!import_protocol_http.HttpRequest.isInstance(request)) return next(args);
const { headers } = request;
const userAgent =
((_a = context == null ? void 0 : context.userAgent) == null ? void 0 : _a.map(escapeUserAgent)) || [];
const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
const customUserAgent =
((_b = options == null ? void 0 : options.customUserAgent) == null ? void 0 : _b.map(escapeUserAgent)) || [];
const prefix = (0, import_util_endpoints.getUserAgentPrefix)();
const sdkUserAgentValue = (prefix ? [prefix] : [])
.concat([...defaultUserAgent, ...userAgent, ...customUserAgent])
.join(SPACE);
const normalUAValue = [
...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
...customUserAgent,
].join(SPACE);
if (options.runtime !== "browser") {
if (normalUAValue) {
headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT]
? `${headers[USER_AGENT]} ${normalUAValue}`
: normalUAValue;
}
headers[USER_AGENT] = sdkUserAgentValue;
} else {
headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
}
return next({
...args,
request,
});
},
"userAgentMiddleware"
);
var escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => {
var _a;
const name = userAgentPair[0]
.split(UA_NAME_SEPARATOR)
.map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR))
.join(UA_NAME_SEPARATOR);
const version = (_a = userAgentPair[1]) == null ? void 0 : _a.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
const prefix = name.substring(0, prefixSeparatorIndex);
let uaName = name.substring(prefixSeparatorIndex + 1);
if (prefix === "api") {
uaName = uaName.toLowerCase();
}
return [prefix, uaName, version]
.filter((item) => item && item.length > 0)
.reduce((acc, item, index) => {
switch (index) {
case 0:
return item;
case 1:
return `${acc}/${item}`;
default:
return `${acc}#${item}`;
}
}, "");
}, "escapeUserAgent");
var getUserAgentMiddlewareOptions = {
name: "getUserAgentMiddleware",
step: "build",
priority: "low",
tags: ["SET_USER_AGENT", "USER_AGENT"],
override: true,
};
var getUserAgentPlugin = /* @__PURE__ */ __name(
(config) => ({
applyToStack: (clientStack) => {
clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
},
}),
"getUserAgentPlugin"
);
},
});
// node_modules/@smithy/util-config-provider/dist-cjs/index.js
var require_dist_cjs9 = __commonJS({
"node_modules/@smithy/util-config-provider/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
SelectorType: () => SelectorType,
booleanSelector: () => booleanSelector,
numberSelector: () => numberSelector,
});
module2.exports = __toCommonJS2(src_exports);
var booleanSelector = /* @__PURE__ */ __name((obj, key, type) => {
if (!(key in obj)) return void 0;
if (obj[key] === "true") return true;
if (obj[key] === "false") return false;
throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
}, "booleanSelector");
var numberSelector = /* @__PURE__ */ __name((obj, key, type) => {
if (!(key in obj)) return void 0;
const numberValue = parseInt(obj[key], 10);
if (Number.isNaN(numberValue)) {
throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`);
}
return numberValue;
}, "numberSelector");
var SelectorType = /* @__PURE__ */ ((SelectorType2) => {
SelectorType2["ENV"] = "env";
SelectorType2["CONFIG"] = "shared config entry";
return SelectorType2;
})(SelectorType || {});
},
});
// node_modules/@smithy/util-middleware/dist-cjs/index.js
var require_dist_cjs10 = __commonJS({
"node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
getSmithyContext: () => getSmithyContext2,
normalizeProvider: () => normalizeProvider,
});
module2.exports = __toCommonJS2(src_exports);
var import_types = require_dist_cjs();
var getSmithyContext2 = /* @__PURE__ */ __name(
(context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}),
"getSmithyContext"
);
var normalizeProvider = /* @__PURE__ */ __name((input) => {
if (typeof input === "function") return input;
const promisified = Promise.resolve(input);
return () => promisified;
}, "normalizeProvider");
},
});
// node_modules/@smithy/config-resolver/dist-cjs/index.js
var require_dist_cjs11 = __commonJS({
"node_modules/@smithy/config-resolver/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
CONFIG_USE_DUALSTACK_ENDPOINT: () => CONFIG_USE_DUALSTACK_ENDPOINT,
CONFIG_USE_FIPS_ENDPOINT: () => CONFIG_USE_FIPS_ENDPOINT,
DEFAULT_USE_DUALSTACK_ENDPOINT: () => DEFAULT_USE_DUALSTACK_ENDPOINT,
DEFAULT_USE_FIPS_ENDPOINT: () => DEFAULT_USE_FIPS_ENDPOINT,
ENV_USE_DUALSTACK_ENDPOINT: () => ENV_USE_DUALSTACK_ENDPOINT,
ENV_USE_FIPS_ENDPOINT: () => ENV_USE_FIPS_ENDPOINT,
NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS,
NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS,
NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: () => NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: () => NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
REGION_ENV_NAME: () => REGION_ENV_NAME,
REGION_INI_NAME: () => REGION_INI_NAME,
getRegionInfo: () => getRegionInfo,
resolveCustomEndpointsConfig: () => resolveCustomEndpointsConfig,
resolveEndpointsConfig: () => resolveEndpointsConfig,
resolveRegionConfig: () => resolveRegionConfig,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_config_provider = require_dist_cjs9();
var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
var DEFAULT_USE_DUALSTACK_ENDPOINT = false;
var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
environmentVariableSelector: (env) =>
(0, import_util_config_provider.booleanSelector)(
env,
ENV_USE_DUALSTACK_ENDPOINT,
import_util_config_provider.SelectorType.ENV
),
configFileSelector: (profile) =>
(0, import_util_config_provider.booleanSelector)(
profile,
CONFIG_USE_DUALSTACK_ENDPOINT,
import_util_config_provider.SelectorType.CONFIG
),
default: false,
};
var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
var DEFAULT_USE_FIPS_ENDPOINT = false;
var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
environmentVariableSelector: (env) =>
(0, import_util_config_provider.booleanSelector)(
env,
ENV_USE_FIPS_ENDPOINT,
import_util_config_provider.SelectorType.ENV
),
configFileSelector: (profile) =>
(0, import_util_config_provider.booleanSelector)(
profile,
CONFIG_USE_FIPS_ENDPOINT,
import_util_config_provider.SelectorType.CONFIG
),
default: false,
};
var import_util_middleware = require_dist_cjs10();
var resolveCustomEndpointsConfig = /* @__PURE__ */ __name((input) => {
const { endpoint, urlParser } = input;
return {
...input,
tls: input.tls ?? true,
endpoint: (0, import_util_middleware.normalizeProvider)(
typeof endpoint === "string" ? urlParser(endpoint) : endpoint
),
isCustomEndpoint: true,
useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false),
};
}, "resolveCustomEndpointsConfig");
var getEndpointFromRegion = /* @__PURE__ */ __name(async (input) => {
const { tls = true } = input;
const region = await input.region();
const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);
if (!dnsHostRegex.test(region)) {
throw new Error("Invalid region in client config");
}
const useDualstackEndpoint = await input.useDualstackEndpoint();
const useFipsEndpoint = await input.useFipsEndpoint();
const { hostname } = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint })) ?? {};
if (!hostname) {
throw new Error("Cannot resolve hostname from client config");
}
return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`);
}, "getEndpointFromRegion");
var resolveEndpointsConfig = /* @__PURE__ */ __name((input) => {
const useDualstackEndpoint = (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false);
const { endpoint, useFipsEndpoint, urlParser } = input;
return {
...input,
tls: input.tls ?? true,
endpoint: endpoint
? (0, import_util_middleware.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint)
: () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }),
isCustomEndpoint: !!endpoint,
useDualstackEndpoint,
};
}, "resolveEndpointsConfig");
var REGION_ENV_NAME = "AWS_REGION";
var REGION_INI_NAME = "region";
var NODE_REGION_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => env[REGION_ENV_NAME],
configFileSelector: (profile) => profile[REGION_INI_NAME],
default: () => {
throw new Error("Region is missing");
},
};
var NODE_REGION_CONFIG_FILE_OPTIONS = {
preferredFile: "credentials",
};
var isFipsRegion = /* @__PURE__ */ __name(
(region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")),
"isFipsRegion"
);
var getRealRegion = /* @__PURE__ */ __name(
(region) =>
isFipsRegion(region)
? ["fips-aws-global", "aws-fips"].includes(region)
? "us-east-1"
: region.replace(/fips-(dkr-|prod-)?|-fips/, "")
: region,
"getRealRegion"
);
var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
const { region, useFipsEndpoint } = input;
if (!region) {
throw new Error("Region is missing");
}
return {
...input,
region: async () => {
if (typeof region === "string") {
return getRealRegion(region);
}
const providedRegion = await region();
return getRealRegion(providedRegion);
},
useFipsEndpoint: async () => {
const providedRegion = typeof region === "string" ? region : await region();
if (isFipsRegion(providedRegion)) {
return true;
}
return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
},
};
}, "resolveRegionConfig");
var getHostnameFromVariants = /* @__PURE__ */ __name((variants = [], { useFipsEndpoint, useDualstackEndpoint }) => {
var _a;
return (_a = variants.find(
({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack")
)) == null
? void 0
: _a.hostname;
}, "getHostnameFromVariants");
var getResolvedHostname = /* @__PURE__ */ __name(
(resolvedRegion, { regionHostname, partitionHostname }) =>
regionHostname
? regionHostname
: partitionHostname
? partitionHostname.replace("{region}", resolvedRegion)
: void 0,
"getResolvedHostname"
);
var getResolvedPartition = /* @__PURE__ */ __name(
(region, { partitionHash }) =>
Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws",
"getResolvedPartition"
);
var getResolvedSigningRegion = /* @__PURE__ */ __name(
(hostname, { signingRegion, regionRegex, useFipsEndpoint }) => {
if (signingRegion) {
return signingRegion;
} else if (useFipsEndpoint) {
const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\.");
const regionRegexmatchArray = hostname.match(regionRegexJs);
if (regionRegexmatchArray) {
return regionRegexmatchArray[0].slice(1, -1);
}
}
},
"getResolvedSigningRegion"
);
var getRegionInfo = /* @__PURE__ */ __name(
(
region,
{ useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash }
) => {
var _a, _b, _c, _d, _e;
const partition = getResolvedPartition(region, { partitionHash });
const resolvedRegion =
region in regionHash ? region : (((_a = partitionHash[partition]) == null ? void 0 : _a.endpoint) ?? region);
const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint };
const regionHostname = getHostnameFromVariants(
(_b = regionHash[resolvedRegion]) == null ? void 0 : _b.variants,
hostnameOptions
);
const partitionHostname = getHostnameFromVariants(
(_c = partitionHash[partition]) == null ? void 0 : _c.variants,
hostnameOptions
);
const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname });
if (hostname === void 0) {
throw new Error(
`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`
);
}
const signingRegion = getResolvedSigningRegion(hostname, {
signingRegion: (_d = regionHash[resolvedRegion]) == null ? void 0 : _d.signingRegion,
regionRegex: partitionHash[partition].regionRegex,
useFipsEndpoint,
});
return {
partition,
signingService,
hostname,
...(signingRegion && { signingRegion }),
...(((_e = regionHash[resolvedRegion]) == null ? void 0 : _e.signingService) && {
signingService: regionHash[resolvedRegion].signingService,
}),
};
},
"getRegionInfo"
);
},
});
// node_modules/@smithy/property-provider/dist-cjs/index.js
var require_dist_cjs12 = __commonJS({
"node_modules/@smithy/property-provider/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
CredentialsProviderError: () => CredentialsProviderError,
ProviderError: () => ProviderError,
TokenProviderError: () => TokenProviderError,
chain: () => chain,
fromStatic: () => fromStatic,
memoize: () => memoize,
});
module2.exports = __toCommonJS2(src_exports);
var _ProviderError = class _ProviderError2 extends Error {
constructor(message, options = true) {
var _a;
let logger;
let tryNextLink = true;
if (typeof options === "boolean") {
logger = void 0;
tryNextLink = options;
} else if (options != null && typeof options === "object") {
logger = options.logger;
tryNextLink = options.tryNextLink ?? true;
}
super(message);
this.name = "ProviderError";
this.tryNextLink = tryNextLink;
Object.setPrototypeOf(this, _ProviderError2.prototype);
(_a = logger == null ? void 0 : logger.debug) == null
? void 0
: _a.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
}
static from(error, options = true) {
return Object.assign(new _ProviderError2(error.message, options), error);
}
};
__name(_ProviderError, "ProviderError");
var ProviderError = _ProviderError;
var _CredentialsProviderError = class _CredentialsProviderError2 extends ProviderError {
constructor(message, options = true) {
super(message, options);
this.name = "CredentialsProviderError";
Object.setPrototypeOf(this, _CredentialsProviderError2.prototype);
}
};
__name(_CredentialsProviderError, "CredentialsProviderError");
var CredentialsProviderError = _CredentialsProviderError;
var _TokenProviderError = class _TokenProviderError2 extends ProviderError {
constructor(message, options = true) {
super(message, options);
this.name = "TokenProviderError";
Object.setPrototypeOf(this, _TokenProviderError2.prototype);
}
};
__name(_TokenProviderError, "TokenProviderError");
var TokenProviderError = _TokenProviderError;
var chain = /* @__PURE__ */ __name(
(...providers) =>
async () => {
if (providers.length === 0) {
throw new ProviderError("No providers in chain");
}
let lastProviderError;
for (const provider of providers) {
try {
const credentials = await provider();
return credentials;
} catch (err) {
lastProviderError = err;
if (err == null ? void 0 : err.tryNextLink) {
continue;
}
throw err;
}
}
throw lastProviderError;
},
"chain"
);
var fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic");
var memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => {
let resolved;
let pending;
let hasResult;
let isConstant = false;
const coalesceProvider = /* @__PURE__ */ __name(async () => {
if (!pending) {
pending = provider();
}
try {
resolved = await pending;
hasResult = true;
isConstant = false;
} finally {
pending = void 0;
}
return resolved;
}, "coalesceProvider");
if (isExpired === void 0) {
return async (options) => {
if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
resolved = await coalesceProvider();
}
return resolved;
};
}
return async (options) => {
if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
resolved = await coalesceProvider();
}
if (isConstant) {
return resolved;
}
if (requiresRefresh && !requiresRefresh(resolved)) {
isConstant = true;
return resolved;
}
if (isExpired(resolved)) {
await coalesceProvider();
return resolved;
}
return resolved;
};
}, "memoize");
},
});
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js
var require_getHomeDir = __commonJS({
"node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHomeDir = void 0;
var os_1 = require("os");
var path_1 = require("path");
var homeDirCache = {};
var getHomeDirCacheKey = () => {
if (process && process.geteuid) {
return `${process.geteuid()}`;
}
return "DEFAULT";
};
var getHomeDir2 = () => {
const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env;
if (HOME) return HOME;
if (USERPROFILE) return USERPROFILE;
if (HOMEPATH) return `${HOMEDRIVE}${HOMEPATH}`;
const homeDirCacheKey = getHomeDirCacheKey();
if (!homeDirCache[homeDirCacheKey]) homeDirCache[homeDirCacheKey] = (0, os_1.homedir)();
return homeDirCache[homeDirCacheKey];
};
exports.getHomeDir = getHomeDir2;
},
});
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js
var require_getSSOTokenFilepath = __commonJS({
"node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSSOTokenFilepath = void 0;
var crypto_1 = require("crypto");
var path_1 = require("path");
var getHomeDir_1 = require_getHomeDir();
var getSSOTokenFilepath2 = (id) => {
const hasher = (0, crypto_1.createHash)("sha1");
const cacheName = hasher.update(id).digest("hex");
return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`);
};
exports.getSSOTokenFilepath = getSSOTokenFilepath2;
},
});
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js
var require_getSSOTokenFromFile = __commonJS({
"node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSSOTokenFromFile = void 0;
var fs_1 = require("fs");
var getSSOTokenFilepath_1 = require_getSSOTokenFilepath();
var { readFile } = fs_1.promises;
var getSSOTokenFromFile2 = async (id) => {
const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);
const ssoTokenText = await readFile(ssoTokenFilepath, "utf8");
return JSON.parse(ssoTokenText);
};
exports.getSSOTokenFromFile = getSSOTokenFromFile2;
},
});
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js
var require_slurpFile = __commonJS({
"node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.slurpFile = void 0;
var fs_1 = require("fs");
var { readFile } = fs_1.promises;
var filePromisesHash = {};
var slurpFile = (path, options) => {
if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) {
filePromisesHash[path] = readFile(path, "utf8");
}
return filePromisesHash[path];
};
exports.slurpFile = slurpFile;
},
});
// node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js
var require_dist_cjs13 = __commonJS({
"node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (
__copyProps2(target, mod, "default"),
secondTarget && __copyProps2(secondTarget, mod, "default")
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR,
DEFAULT_PROFILE: () => DEFAULT_PROFILE,
ENV_PROFILE: () => ENV_PROFILE,
getProfileName: () => getProfileName,
loadSharedConfigFiles: () => loadSharedConfigFiles,
loadSsoSessionData: () => loadSsoSessionData,
parseKnownFiles: () => parseKnownFiles,
});
module2.exports = __toCommonJS2(src_exports);
__reExport(src_exports, require_getHomeDir(), module2.exports);
var ENV_PROFILE = "AWS_PROFILE";
var DEFAULT_PROFILE = "default";
var getProfileName = /* @__PURE__ */ __name(
(init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE,
"getProfileName"
);
__reExport(src_exports, require_getSSOTokenFilepath(), module2.exports);
__reExport(src_exports, require_getSSOTokenFromFile(), module2.exports);
var import_types = require_dist_cjs();
var getConfigData = /* @__PURE__ */ __name(
(data) =>
Object.entries(data)
.filter(([key]) => {
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
if (indexOfSeparator === -1) {
return false;
}
return Object.values(import_types.IniSectionType).includes(key.substring(0, indexOfSeparator));
})
.reduce(
(acc, [key, value]) => {
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
const updatedKey =
key.substring(0, indexOfSeparator) === import_types.IniSectionType.PROFILE
? key.substring(indexOfSeparator + 1)
: key;
acc[updatedKey] = value;
return acc;
},
{
...(data.default && { default: data.default }),
}
),
"getConfigData"
);
var import_path = require("path");
var import_getHomeDir = require_getHomeDir();
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
var getConfigFilepath = /* @__PURE__ */ __name(
() =>
process.env[ENV_CONFIG_PATH] || (0, import_path.join)((0, import_getHomeDir.getHomeDir)(), ".aws", "config"),
"getConfigFilepath"
);
var import_getHomeDir2 = require_getHomeDir();
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
var getCredentialsFilepath = /* @__PURE__ */ __name(
() =>
process.env[ENV_CREDENTIALS_PATH] ||
(0, import_path.join)((0, import_getHomeDir2.getHomeDir)(), ".aws", "credentials"),
"getCredentialsFilepath"
);
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/;
var profileNameBlockList = ["__proto__", "profile __proto__"];
var parseIni = /* @__PURE__ */ __name((iniData) => {
const map = {};
let currentSection;
let currentSubSection;
for (const iniLine of iniData.split(/\r?\n/)) {
const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim();
const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]";
if (isSection) {
currentSection = void 0;
currentSubSection = void 0;
const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);
const matches = prefixKeyRegex.exec(sectionName);
if (matches) {
const [, prefix, , name] = matches;
if (Object.values(import_types.IniSectionType).includes(prefix)) {
currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);
}
} else {
currentSection = sectionName;
}
if (profileNameBlockList.includes(sectionName)) {
throw new Error(`Found invalid profile name "${sectionName}"`);
}
} else if (currentSection) {
const indexOfEqualsSign = trimmedLine.indexOf("=");
if (![0, -1].includes(indexOfEqualsSign)) {
const [name, value] = [
trimmedLine.substring(0, indexOfEqualsSign).trim(),
trimmedLine.substring(indexOfEqualsSign + 1).trim(),
];
if (value === "") {
currentSubSection = name;
} else {
if (currentSubSection && iniLine.trimStart() === iniLine) {
currentSubSection = void 0;
}
map[currentSection] = map[currentSection] || {};
const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;
map[currentSection][key] = value;
}
}
}
}
return map;
}, "parseIni");
var import_slurpFile = require_slurpFile();
var swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError");
var CONFIG_PREFIX_SEPARATOR = ".";
var loadSharedConfigFiles = /* @__PURE__ */ __name(async (init = {}) => {
const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;
const parsedFiles = await Promise.all([
(0, import_slurpFile.slurpFile)(configFilepath, {
ignoreCache: init.ignoreCache,
})
.then(parseIni)
.then(getConfigData)
.catch(swallowError),
(0, import_slurpFile.slurpFile)(filepath, {
ignoreCache: init.ignoreCache,
})
.then(parseIni)
.catch(swallowError),
]);
return {
configFile: parsedFiles[0],
credentialsFile: parsedFiles[1],
};
}, "loadSharedConfigFiles");
var getSsoSessionData = /* @__PURE__ */ __name(
(data) =>
Object.entries(data)
.filter(([key]) => key.startsWith(import_types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR))
.reduce(
(acc, [key, value]) => ({
...acc,
[key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value,
}),
{}
),
"getSsoSessionData"
);
var import_slurpFile2 = require_slurpFile();
var swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError");
var loadSsoSessionData = /* @__PURE__ */ __name(
async (init = {}) =>
(0, import_slurpFile2.slurpFile)(init.configFilepath ?? getConfigFilepath())
.then(parseIni)
.then(getSsoSessionData)
.catch(swallowError2),
"loadSsoSessionData"
);
var mergeConfigFiles = /* @__PURE__ */ __name((...files) => {
const merged = {};
for (const file of files) {
for (const [key, values] of Object.entries(file)) {
if (merged[key] !== void 0) {
Object.assign(merged[key], values);
} else {
merged[key] = values;
}
}
}
return merged;
}, "mergeConfigFiles");
var parseKnownFiles = /* @__PURE__ */ __name(async (init) => {
const parsedFiles = await loadSharedConfigFiles(init);
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
}, "parseKnownFiles");
},
});
// node_modules/@smithy/node-config-provider/dist-cjs/index.js
var require_dist_cjs14 = __commonJS({
"node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
loadConfig: () => loadConfig,
});
module2.exports = __toCommonJS2(src_exports);
var import_property_provider = require_dist_cjs12();
function getSelectorName(functionString) {
try {
const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));
constants.delete("CONFIG");
constants.delete("CONFIG_PREFIX_SEPARATOR");
constants.delete("ENV");
return [...constants].join(", ");
} catch (e) {
return functionString;
}
}
__name(getSelectorName, "getSelectorName");
var fromEnv = /* @__PURE__ */ __name(
(envVarSelector, logger) => async () => {
try {
const config = envVarSelector(process.env);
if (config === void 0) {
throw new Error();
}
return config;
} catch (e) {
throw new import_property_provider.CredentialsProviderError(
e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`,
{ logger }
);
}
},
"fromEnv"
);
var import_shared_ini_file_loader = require_dist_cjs13();
var fromSharedConfigFiles = /* @__PURE__ */ __name(
(configSelector, { preferredFile = "config", ...init } = {}) =>
async () => {
const profile = (0, import_shared_ini_file_loader.getProfileName)(init);
const { configFile, credentialsFile } = await (0, import_shared_ini_file_loader.loadSharedConfigFiles)(init);
const profileFromCredentials = credentialsFile[profile] || {};
const profileFromConfig = configFile[profile] || {};
const mergedProfile =
preferredFile === "config"
? { ...profileFromCredentials, ...profileFromConfig }
: { ...profileFromConfig, ...profileFromCredentials };
try {
const cfgFile = preferredFile === "config" ? configFile : credentialsFile;
const configValue = configSelector(mergedProfile, cfgFile);
if (configValue === void 0) {
throw new Error();
}
return configValue;
} catch (e) {
throw new import_property_provider.CredentialsProviderError(
e.message ||
`Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`,
{ logger: init.logger }
);
}
},
"fromSharedConfigFiles"
);
var isFunction = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction");
var fromStatic = /* @__PURE__ */ __name(
(defaultValue) =>
isFunction(defaultValue)
? async () => await defaultValue()
: (0, import_property_provider.fromStatic)(defaultValue),
"fromStatic"
);
var loadConfig = /* @__PURE__ */ __name(
({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) =>
(0, import_property_provider.memoize)(
(0, import_property_provider.chain)(
fromEnv(environmentVariableSelector),
fromSharedConfigFiles(configFileSelector, configuration),
fromStatic(defaultValue)
)
),
"loadConfig"
);
},
});
// node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js
var require_getEndpointUrlConfig = __commonJS({
"node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEndpointUrlConfig = void 0;
var shared_ini_file_loader_1 = require_dist_cjs13();
var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
var CONFIG_ENDPOINT_URL = "endpoint_url";
var getEndpointUrlConfig = (serviceId) => ({
environmentVariableSelector: (env) => {
const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase());
const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")];
if (serviceEndpointUrl) return serviceEndpointUrl;
const endpointUrl = env[ENV_ENDPOINT_URL];
if (endpointUrl) return endpointUrl;
return void 0;
},
configFileSelector: (profile, config) => {
if (config && profile.services) {
const servicesSection =
config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)];
if (servicesSection) {
const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
const endpointUrl2 =
servicesSection[
[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(
shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR
)
];
if (endpointUrl2) return endpointUrl2;
}
}
const endpointUrl = profile[CONFIG_ENDPOINT_URL];
if (endpointUrl) return endpointUrl;
return void 0;
},
default: void 0,
});
exports.getEndpointUrlConfig = getEndpointUrlConfig;
},
});
// node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js
var require_getEndpointFromConfig = __commonJS({
"node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEndpointFromConfig = void 0;
var node_config_provider_1 = require_dist_cjs14();
var getEndpointUrlConfig_1 = require_getEndpointUrlConfig();
var getEndpointFromConfig = async (serviceId) =>
(0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId))();
exports.getEndpointFromConfig = getEndpointFromConfig;
},
});
// node_modules/@smithy/querystring-parser/dist-cjs/index.js
var require_dist_cjs15 = __commonJS({
"node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
parseQueryString: () => parseQueryString,
});
module2.exports = __toCommonJS2(src_exports);
function parseQueryString(querystring) {
const query = {};
querystring = querystring.replace(/^\?/, "");
if (querystring) {
for (const pair of querystring.split("&")) {
let [key, value = null] = pair.split("=");
key = decodeURIComponent(key);
if (value) {
value = decodeURIComponent(value);
}
if (!(key in query)) {
query[key] = value;
} else if (Array.isArray(query[key])) {
query[key].push(value);
} else {
query[key] = [query[key], value];
}
}
}
return query;
}
__name(parseQueryString, "parseQueryString");
},
});
// node_modules/@smithy/url-parser/dist-cjs/index.js
var require_dist_cjs16 = __commonJS({
"node_modules/@smithy/url-parser/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
parseUrl: () => parseUrl,
});
module2.exports = __toCommonJS2(src_exports);
var import_querystring_parser = require_dist_cjs15();
var parseUrl = /* @__PURE__ */ __name((url) => {
if (typeof url === "string") {
return parseUrl(new URL(url));
}
const { hostname, pathname, port, protocol, search } = url;
let query;
if (search) {
query = (0, import_querystring_parser.parseQueryString)(search);
}
return {
hostname,
port: port ? parseInt(port) : void 0,
protocol,
path: pathname,
query,
};
}, "parseUrl");
},
});
// node_modules/@smithy/middleware-serde/dist-cjs/index.js
var require_dist_cjs17 = __commonJS({
"node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
deserializerMiddleware: () => deserializerMiddleware,
deserializerMiddlewareOption: () => deserializerMiddlewareOption,
getSerdePlugin: () => getSerdePlugin,
serializerMiddleware: () => serializerMiddleware,
serializerMiddlewareOption: () => serializerMiddlewareOption,
});
module2.exports = __toCommonJS2(src_exports);
var deserializerMiddleware = /* @__PURE__ */ __name(
(options, deserializer) => (next) => async (args) => {
const { response } = await next(args);
try {
const parsed = await deserializer(response, options);
return {
response,
output: parsed,
};
} catch (error) {
Object.defineProperty(error, "$response", {
value: response,
});
if (!("$metadata" in error)) {
const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
error.message += "\n " + hint;
if (typeof error.$responseBodyText !== "undefined") {
if (error.$response) {
error.$response.body = error.$responseBodyText;
}
}
}
throw error;
}
},
"deserializerMiddleware"
);
var serializerMiddleware = /* @__PURE__ */ __name(
(options, serializer) => (next, context) => async (args) => {
var _a;
const endpoint =
((_a = context.endpointV2) == null ? void 0 : _a.url) && options.urlParser
? async () => options.urlParser(context.endpointV2.url)
: options.endpoint;
if (!endpoint) {
throw new Error("No valid endpoint provider available.");
}
const request = await serializer(args.input, { ...options, endpoint });
return next({
...args,
request,
});
},
"serializerMiddleware"
);
var deserializerMiddlewareOption = {
name: "deserializerMiddleware",
step: "deserialize",
tags: ["DESERIALIZER"],
override: true,
};
var serializerMiddlewareOption = {
name: "serializerMiddleware",
step: "serialize",
tags: ["SERIALIZER"],
override: true,
};
function getSerdePlugin(config, serializer, deserializer) {
return {
applyToStack: (commandStack) => {
commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);
commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);
},
};
}
__name(getSerdePlugin, "getSerdePlugin");
},
});
// node_modules/@smithy/middleware-endpoint/dist-cjs/index.js
var require_dist_cjs18 = __commonJS({
"node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
endpointMiddleware: () => endpointMiddleware,
endpointMiddlewareOptions: () => endpointMiddlewareOptions,
getEndpointFromInstructions: () => getEndpointFromInstructions,
getEndpointPlugin: () => getEndpointPlugin,
resolveEndpointConfig: () => resolveEndpointConfig,
resolveParams: () => resolveParams,
toEndpointV1: () => toEndpointV1,
});
module2.exports = __toCommonJS2(src_exports);
var resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => {
const bucket = (endpointParams == null ? void 0 : endpointParams.Bucket) || "";
if (typeof endpointParams.Bucket === "string") {
endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
}
if (isArnBucketName(bucket)) {
if (endpointParams.ForcePathStyle === true) {
throw new Error("Path-style addressing cannot be used with ARN buckets");
}
} else if (
!isDnsCompatibleBucketName(bucket) ||
(bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:")) ||
bucket.toLowerCase() !== bucket ||
bucket.length < 3
) {
endpointParams.ForcePathStyle = true;
}
if (endpointParams.DisableMultiRegionAccessPoints) {
endpointParams.disableMultiRegionAccessPoints = true;
endpointParams.DisableMRAP = true;
}
return endpointParams;
}, "resolveParamsForS3");
var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/;
var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
var DOTS_PATTERN = /\.\./;
var isDnsCompatibleBucketName = /* @__PURE__ */ __name(
(bucketName) =>
DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName),
"isDnsCompatibleBucketName"
);
var isArnBucketName = /* @__PURE__ */ __name((bucketName) => {
const [arn, partition, service, , , bucket] = bucketName.split(":");
const isArn = arn === "arn" && bucketName.split(":").length >= 6;
const isValidArn = Boolean(isArn && partition && service && bucket);
if (isArn && !isValidArn) {
throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
}
return isValidArn;
}, "isArnBucketName");
var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => {
const configProvider = /* @__PURE__ */ __name(async () => {
const configValue = config[configKey] ?? config[canonicalEndpointParamKey];
if (typeof configValue === "function") {
return configValue();
}
return configValue;
}, "configProvider");
if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
return async () => {
const credentials =
typeof config.credentials === "function" ? await config.credentials() : config.credentials;
const configValue =
(credentials == null ? void 0 : credentials.credentialScope) ??
(credentials == null ? void 0 : credentials.CredentialScope);
return configValue;
};
}
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
return async () => {
const endpoint = await configProvider();
if (endpoint && typeof endpoint === "object") {
if ("url" in endpoint) {
return endpoint.url.href;
}
if ("hostname" in endpoint) {
const { protocol, hostname, port, path } = endpoint;
return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
}
}
return endpoint;
};
}
return configProvider;
}, "createConfigValueProvider");
var import_getEndpointFromConfig = require_getEndpointFromConfig();
var import_url_parser = require_dist_cjs16();
var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => {
if (typeof endpoint === "object") {
if ("url" in endpoint) {
return (0, import_url_parser.parseUrl)(endpoint.url);
}
return endpoint;
}
return (0, import_url_parser.parseUrl)(endpoint);
}, "toEndpointV1");
var getEndpointFromInstructions = /* @__PURE__ */ __name(
async (commandInput, instructionsSupplier, clientConfig, context) => {
if (!clientConfig.endpoint) {
const endpointFromConfig = await (0, import_getEndpointFromConfig.getEndpointFromConfig)(
clientConfig.serviceId || ""
);
if (endpointFromConfig) {
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
}
}
const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
if (typeof clientConfig.endpointProvider !== "function") {
throw new Error("config.endpointProvider is not set.");
}
const endpoint = clientConfig.endpointProvider(endpointParams, context);
return endpoint;
},
"getEndpointFromInstructions"
);
var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => {
var _a;
const endpointParams = {};
const instructions =
((_a = instructionsSupplier == null ? void 0 : instructionsSupplier.getEndpointParameterInstructions) == null
? void 0
: _a.call(instructionsSupplier)) || {};
for (const [name, instruction] of Object.entries(instructions)) {
switch (instruction.type) {
case "staticContextParams":
endpointParams[name] = instruction.value;
break;
case "contextParams":
endpointParams[name] = commandInput[instruction.name];
break;
case "clientContextParams":
case "builtInParams":
endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)();
break;
default:
throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
}
}
if (Object.keys(instructions).length === 0) {
Object.assign(endpointParams, clientConfig);
}
if (String(clientConfig.serviceId).toLowerCase() === "s3") {
await resolveParamsForS3(endpointParams);
}
return endpointParams;
}, "resolveParams");
var import_util_middleware = require_dist_cjs10();
var endpointMiddleware = /* @__PURE__ */ __name(({ config, instructions }) => {
return (next, context) => async (args) => {
var _a, _b, _c;
const endpoint = await getEndpointFromInstructions(
args.input,
{
getEndpointParameterInstructions() {
return instructions;
},
},
{ ...config },
context
);
context.endpointV2 = endpoint;
context.authSchemes = (_a = endpoint.properties) == null ? void 0 : _a.authSchemes;
const authScheme = (_b = context.authSchemes) == null ? void 0 : _b[0];
if (authScheme) {
context["signing_region"] = authScheme.signingRegion;
context["signing_service"] = authScheme.signingName;
const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
const httpAuthOption =
(_c = smithyContext == null ? void 0 : smithyContext.selectedHttpAuthScheme) == null
? void 0
: _c.httpAuthOption;
if (httpAuthOption) {
httpAuthOption.signingProperties = Object.assign(
httpAuthOption.signingProperties || {},
{
signing_region: authScheme.signingRegion,
signingRegion: authScheme.signingRegion,
signing_service: authScheme.signingName,
signingName: authScheme.signingName,
signingRegionSet: authScheme.signingRegionSet,
},
authScheme.properties
);
}
}
return next({
...args,
});
};
}, "endpointMiddleware");
var import_middleware_serde = require_dist_cjs17();
var endpointMiddlewareOptions = {
step: "serialize",
tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
name: "endpointV2Middleware",
override: true,
relation: "before",
toMiddleware: import_middleware_serde.serializerMiddlewareOption.name,
};
var getEndpointPlugin = /* @__PURE__ */ __name(
(config, instructions) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(
endpointMiddleware({
config,
instructions,
}),
endpointMiddlewareOptions
);
},
}),
"getEndpointPlugin"
);
var resolveEndpointConfig = /* @__PURE__ */ __name((input) => {
const tls = input.tls ?? true;
const { endpoint } = input;
const customEndpointProvider =
endpoint != null
? async () => toEndpointV1(await (0, import_util_middleware.normalizeProvider)(endpoint)())
: void 0;
const isCustomEndpoint = !!endpoint;
return {
...input,
endpoint: customEndpointProvider,
tls,
isCustomEndpoint,
useDualstackEndpoint: (0, import_util_middleware.normalizeProvider)(input.useDualstackEndpoint ?? false),
useFipsEndpoint: (0, import_util_middleware.normalizeProvider)(input.useFipsEndpoint ?? false),
};
}, "resolveEndpointConfig");
},
});
// node_modules/uuid/dist/rng.js
var require_rng = __commonJS({
"node_modules/uuid/dist/rng.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = rng;
var _crypto = _interopRequireDefault(require("crypto"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var rnds8Pool = new Uint8Array(256);
var poolPtr = rnds8Pool.length;
function rng() {
if (poolPtr > rnds8Pool.length - 16) {
_crypto.default.randomFillSync(rnds8Pool);
poolPtr = 0;
}
return rnds8Pool.slice(poolPtr, (poolPtr += 16));
}
},
});
// node_modules/uuid/dist/regex.js
var require_regex = __commonJS({
"node_modules/uuid/dist/regex.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _default =
/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
exports.default = _default;
},
});
// node_modules/uuid/dist/validate.js
var require_validate = __commonJS({
"node_modules/uuid/dist/validate.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _regex = _interopRequireDefault(require_regex());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function validate(uuid) {
return typeof uuid === "string" && _regex.default.test(uuid);
}
var _default = validate;
exports.default = _default;
},
});
// node_modules/uuid/dist/stringify.js
var require_stringify = __commonJS({
"node_modules/uuid/dist/stringify.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
exports.unsafeStringify = unsafeStringify;
var _validate = _interopRequireDefault(require_validate());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var byteToHex = [];
for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 256).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
return (
byteToHex[arr[offset + 0]] +
byteToHex[arr[offset + 1]] +
byteToHex[arr[offset + 2]] +
byteToHex[arr[offset + 3]] +
"-" +
byteToHex[arr[offset + 4]] +
byteToHex[arr[offset + 5]] +
"-" +
byteToHex[arr[offset + 6]] +
byteToHex[arr[offset + 7]] +
"-" +
byteToHex[arr[offset + 8]] +
byteToHex[arr[offset + 9]] +
"-" +
byteToHex[arr[offset + 10]] +
byteToHex[arr[offset + 11]] +
byteToHex[arr[offset + 12]] +
byteToHex[arr[offset + 13]] +
byteToHex[arr[offset + 14]] +
byteToHex[arr[offset + 15]]
);
}
function stringify(arr, offset = 0) {
const uuid = unsafeStringify(arr, offset);
if (!(0, _validate.default)(uuid)) {
throw TypeError("Stringified UUID is invalid");
}
return uuid;
}
var _default = stringify;
exports.default = _default;
},
});
// node_modules/uuid/dist/v1.js
var require_v1 = __commonJS({
"node_modules/uuid/dist/v1.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _rng = _interopRequireDefault(require_rng());
var _stringify = require_stringify();
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var _nodeId;
var _clockseq;
var _lastMSecs = 0;
var _lastNSecs = 0;
function v1(options, buf, offset) {
let i = (buf && offset) || 0;
const b = buf || new Array(16);
options = options || {};
let node = options.node || _nodeId;
let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
if (node == null || clockseq == null) {
const seedBytes = options.random || (options.rng || _rng.default)();
if (node == null) {
node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
}
if (clockseq == null) {
clockseq = _clockseq = ((seedBytes[6] << 8) | seedBytes[7]) & 16383;
}
}
let msecs = options.msecs !== void 0 ? options.msecs : Date.now();
let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1;
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
if (dt < 0 && options.clockseq === void 0) {
clockseq = (clockseq + 1) & 16383;
}
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) {
nsecs = 0;
}
if (nsecs >= 1e4) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq;
msecs += 122192928e5;
const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
b[i++] = (tl >>> 24) & 255;
b[i++] = (tl >>> 16) & 255;
b[i++] = (tl >>> 8) & 255;
b[i++] = tl & 255;
const tmh = ((msecs / 4294967296) * 1e4) & 268435455;
b[i++] = (tmh >>> 8) & 255;
b[i++] = tmh & 255;
b[i++] = ((tmh >>> 24) & 15) | 16;
b[i++] = (tmh >>> 16) & 255;
b[i++] = (clockseq >>> 8) | 128;
b[i++] = clockseq & 255;
for (let n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || (0, _stringify.unsafeStringify)(b);
}
var _default = v1;
exports.default = _default;
},
});
// node_modules/uuid/dist/parse.js
var require_parse = __commonJS({
"node_modules/uuid/dist/parse.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _validate = _interopRequireDefault(require_validate());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function parse(uuid) {
if (!(0, _validate.default)(uuid)) {
throw TypeError("Invalid UUID");
}
let v;
const arr = new Uint8Array(16);
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
arr[1] = (v >>> 16) & 255;
arr[2] = (v >>> 8) & 255;
arr[3] = v & 255;
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
arr[5] = v & 255;
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
arr[7] = v & 255;
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
arr[9] = v & 255;
arr[10] = ((v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776) & 255;
arr[11] = (v / 4294967296) & 255;
arr[12] = (v >>> 24) & 255;
arr[13] = (v >>> 16) & 255;
arr[14] = (v >>> 8) & 255;
arr[15] = v & 255;
return arr;
}
var _default = parse;
exports.default = _default;
},
});
// node_modules/uuid/dist/v35.js
var require_v35 = __commonJS({
"node_modules/uuid/dist/v35.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.URL = exports.DNS = void 0;
exports.default = v35;
var _stringify = require_stringify();
var _parse = _interopRequireDefault(require_parse());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function stringToBytes(str) {
str = unescape(encodeURIComponent(str));
const bytes = [];
for (let i = 0; i < str.length; ++i) {
bytes.push(str.charCodeAt(i));
}
return bytes;
}
var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
exports.DNS = DNS;
var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
exports.URL = URL2;
function v35(name, version, hashfunc) {
function generateUUID(value, namespace, buf, offset) {
var _namespace;
if (typeof value === "string") {
value = stringToBytes(value);
}
if (typeof namespace === "string") {
namespace = (0, _parse.default)(namespace);
}
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
}
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = (bytes[6] & 15) | version;
bytes[8] = (bytes[8] & 63) | 128;
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = bytes[i];
}
return buf;
}
return (0, _stringify.unsafeStringify)(bytes);
}
try {
generateUUID.name = name;
} catch (err) {}
generateUUID.DNS = DNS;
generateUUID.URL = URL2;
return generateUUID;
}
},
});
// node_modules/uuid/dist/md5.js
var require_md5 = __commonJS({
"node_modules/uuid/dist/md5.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _crypto = _interopRequireDefault(require("crypto"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function md5(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === "string") {
bytes = Buffer.from(bytes, "utf8");
}
return _crypto.default.createHash("md5").update(bytes).digest();
}
var _default = md5;
exports.default = _default;
},
});
// node_modules/uuid/dist/v3.js
var require_v3 = __commonJS({
"node_modules/uuid/dist/v3.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _v = _interopRequireDefault(require_v35());
var _md = _interopRequireDefault(require_md5());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var v3 = (0, _v.default)("v3", 48, _md.default);
var _default = v3;
exports.default = _default;
},
});
// node_modules/uuid/dist/native.js
var require_native = __commonJS({
"node_modules/uuid/dist/native.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _crypto = _interopRequireDefault(require("crypto"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var _default = {
randomUUID: _crypto.default.randomUUID,
};
exports.default = _default;
},
});
// node_modules/uuid/dist/v4.js
var require_v4 = __commonJS({
"node_modules/uuid/dist/v4.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _native = _interopRequireDefault(require_native());
var _rng = _interopRequireDefault(require_rng());
var _stringify = require_stringify();
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function v4(options, buf, offset) {
if (_native.default.randomUUID && !buf && !options) {
return _native.default.randomUUID();
}
options = options || {};
const rnds = options.random || (options.rng || _rng.default)();
rnds[6] = (rnds[6] & 15) | 64;
rnds[8] = (rnds[8] & 63) | 128;
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return (0, _stringify.unsafeStringify)(rnds);
}
var _default = v4;
exports.default = _default;
},
});
// node_modules/uuid/dist/sha1.js
var require_sha1 = __commonJS({
"node_modules/uuid/dist/sha1.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _crypto = _interopRequireDefault(require("crypto"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function sha1(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === "string") {
bytes = Buffer.from(bytes, "utf8");
}
return _crypto.default.createHash("sha1").update(bytes).digest();
}
var _default = sha1;
exports.default = _default;
},
});
// node_modules/uuid/dist/v5.js
var require_v5 = __commonJS({
"node_modules/uuid/dist/v5.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _v = _interopRequireDefault(require_v35());
var _sha = _interopRequireDefault(require_sha1());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var v5 = (0, _v.default)("v5", 80, _sha.default);
var _default = v5;
exports.default = _default;
},
});
// node_modules/uuid/dist/nil.js
var require_nil = __commonJS({
"node_modules/uuid/dist/nil.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _default = "00000000-0000-0000-0000-000000000000";
exports.default = _default;
},
});
// node_modules/uuid/dist/version.js
var require_version = __commonJS({
"node_modules/uuid/dist/version.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = void 0;
var _validate = _interopRequireDefault(require_validate());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function version(uuid) {
if (!(0, _validate.default)(uuid)) {
throw TypeError("Invalid UUID");
}
return parseInt(uuid.slice(14, 15), 16);
}
var _default = version;
exports.default = _default;
},
});
// node_modules/uuid/dist/index.js
var require_dist = __commonJS({
"node_modules/uuid/dist/index.js"(exports) {
Object.defineProperty(exports, "__esModule", {
value: true,
});
Object.defineProperty(exports, "NIL", {
enumerable: true,
get: () => _nil.default,
});
Object.defineProperty(exports, "parse", {
enumerable: true,
get: () => _parse.default,
});
Object.defineProperty(exports, "stringify", {
enumerable: true,
get: () => _stringify.default,
});
Object.defineProperty(exports, "v1", {
enumerable: true,
get: () => _v.default,
});
Object.defineProperty(exports, "v3", {
enumerable: true,
get: () => _v2.default,
});
Object.defineProperty(exports, "v4", {
enumerable: true,
get: () => _v3.default,
});
Object.defineProperty(exports, "v5", {
enumerable: true,
get: () => _v4.default,
});
Object.defineProperty(exports, "validate", {
enumerable: true,
get: () => _validate.default,
});
Object.defineProperty(exports, "version", {
enumerable: true,
get: () => _version.default,
});
var _v = _interopRequireDefault(require_v1());
var _v2 = _interopRequireDefault(require_v3());
var _v3 = _interopRequireDefault(require_v4());
var _v4 = _interopRequireDefault(require_v5());
var _nil = _interopRequireDefault(require_nil());
var _version = _interopRequireDefault(require_version());
var _validate = _interopRequireDefault(require_validate());
var _stringify = _interopRequireDefault(require_stringify());
var _parse = _interopRequireDefault(require_parse());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
},
});
// node_modules/@smithy/service-error-classification/dist-cjs/index.js
var require_dist_cjs19 = __commonJS({
"node_modules/@smithy/service-error-classification/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
isClockSkewCorrectedError: () => isClockSkewCorrectedError,
isClockSkewError: () => isClockSkewError,
isRetryableByTrait: () => isRetryableByTrait,
isServerError: () => isServerError,
isThrottlingError: () => isThrottlingError,
isTransientError: () => isTransientError,
});
module2.exports = __toCommonJS2(src_exports);
var CLOCK_SKEW_ERROR_CODES = [
"AuthFailure",
"InvalidSignatureException",
"RequestExpired",
"RequestInTheFuture",
"RequestTimeTooSkewed",
"SignatureDoesNotMatch",
];
var THROTTLING_ERROR_CODES = [
"BandwidthLimitExceeded",
"EC2ThrottledException",
"LimitExceededException",
"PriorRequestNotComplete",
"ProvisionedThroughputExceededException",
"RequestLimitExceeded",
"RequestThrottled",
"RequestThrottledException",
"SlowDown",
"ThrottledException",
"Throttling",
"ThrottlingException",
"TooManyRequestsException",
"TransactionInProgressException",
];
var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
var isRetryableByTrait = /* @__PURE__ */ __name((error) => error.$retryable !== void 0, "isRetryableByTrait");
var isClockSkewError = /* @__PURE__ */ __name(
(error) => CLOCK_SKEW_ERROR_CODES.includes(error.name),
"isClockSkewError"
);
var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => {
var _a;
return (_a = error.$metadata) == null ? void 0 : _a.clockSkewCorrected;
}, "isClockSkewCorrectedError");
var isThrottlingError = /* @__PURE__ */ __name((error) => {
var _a, _b;
return (
((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) === 429 ||
THROTTLING_ERROR_CODES.includes(error.name) ||
((_b = error.$retryable) == null ? void 0 : _b.throttling) == true
);
}, "isThrottlingError");
var isTransientError = /* @__PURE__ */ __name((error) => {
var _a;
return (
isClockSkewCorrectedError(error) ||
TRANSIENT_ERROR_CODES.includes(error.name) ||
NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") ||
TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0)
);
}, "isTransientError");
var isServerError = /* @__PURE__ */ __name((error) => {
var _a;
if (((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) !== void 0) {
const statusCode = error.$metadata.httpStatusCode;
if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
return true;
}
return false;
}
return false;
}, "isServerError");
},
});
// node_modules/@smithy/util-retry/dist-cjs/index.js
var require_dist_cjs20 = __commonJS({
"node_modules/@smithy/util-retry/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
AdaptiveRetryStrategy: () => AdaptiveRetryStrategy,
ConfiguredRetryStrategy: () => ConfiguredRetryStrategy,
DEFAULT_MAX_ATTEMPTS: () => DEFAULT_MAX_ATTEMPTS,
DEFAULT_RETRY_DELAY_BASE: () => DEFAULT_RETRY_DELAY_BASE,
DEFAULT_RETRY_MODE: () => DEFAULT_RETRY_MODE,
DefaultRateLimiter: () => DefaultRateLimiter,
INITIAL_RETRY_TOKENS: () => INITIAL_RETRY_TOKENS,
INVOCATION_ID_HEADER: () => INVOCATION_ID_HEADER,
MAXIMUM_RETRY_DELAY: () => MAXIMUM_RETRY_DELAY,
NO_RETRY_INCREMENT: () => NO_RETRY_INCREMENT,
REQUEST_HEADER: () => REQUEST_HEADER,
RETRY_COST: () => RETRY_COST,
RETRY_MODES: () => RETRY_MODES,
StandardRetryStrategy: () => StandardRetryStrategy,
THROTTLING_RETRY_DELAY_BASE: () => THROTTLING_RETRY_DELAY_BASE,
TIMEOUT_RETRY_COST: () => TIMEOUT_RETRY_COST,
});
module2.exports = __toCommonJS2(src_exports);
var RETRY_MODES = /* @__PURE__ */ ((RETRY_MODES2) => {
RETRY_MODES2["STANDARD"] = "standard";
RETRY_MODES2["ADAPTIVE"] = "adaptive";
return RETRY_MODES2;
})(RETRY_MODES || {});
var DEFAULT_MAX_ATTEMPTS = 3;
var DEFAULT_RETRY_MODE = "standard";
var import_service_error_classification = require_dist_cjs19();
var _DefaultRateLimiter = class _DefaultRateLimiter {
constructor(options) {
this.currentCapacity = 0;
this.enabled = false;
this.lastMaxRate = 0;
this.measuredTxRate = 0;
this.requestCount = 0;
this.lastTimestamp = 0;
this.timeWindow = 0;
this.beta = (options == null ? void 0 : options.beta) ?? 0.7;
this.minCapacity = (options == null ? void 0 : options.minCapacity) ?? 1;
this.minFillRate = (options == null ? void 0 : options.minFillRate) ?? 0.5;
this.scaleConstant = (options == null ? void 0 : options.scaleConstant) ?? 0.4;
this.smooth = (options == null ? void 0 : options.smooth) ?? 0.8;
const currentTimeInSeconds = this.getCurrentTimeInSeconds();
this.lastThrottleTime = currentTimeInSeconds;
this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
this.fillRate = this.minFillRate;
this.maxCapacity = this.minCapacity;
}
getCurrentTimeInSeconds() {
return Date.now() / 1e3;
}
async getSendToken() {
return this.acquireTokenBucket(1);
}
async acquireTokenBucket(amount) {
if (!this.enabled) {
return;
}
this.refillTokenBucket();
if (amount > this.currentCapacity) {
const delay = ((amount - this.currentCapacity) / this.fillRate) * 1e3;
await new Promise((resolve) => setTimeout(resolve, delay));
}
this.currentCapacity = this.currentCapacity - amount;
}
refillTokenBucket() {
const timestamp = this.getCurrentTimeInSeconds();
if (!this.lastTimestamp) {
this.lastTimestamp = timestamp;
return;
}
const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);
this.lastTimestamp = timestamp;
}
updateClientSendingRate(response) {
let calculatedRate;
this.updateMeasuredRate();
if ((0, import_service_error_classification.isThrottlingError)(response)) {
const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
this.lastMaxRate = rateToUse;
this.calculateTimeWindow();
this.lastThrottleTime = this.getCurrentTimeInSeconds();
calculatedRate = this.cubicThrottle(rateToUse);
this.enableTokenBucket();
} else {
this.calculateTimeWindow();
calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
}
const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
this.updateTokenBucketRate(newRate);
}
calculateTimeWindow() {
this.timeWindow = this.getPrecise(((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant) ** (1 / 3));
}
cubicThrottle(rateToUse) {
return this.getPrecise(rateToUse * this.beta);
}
cubicSuccess(timestamp) {
return this.getPrecise(
this.scaleConstant * (timestamp - this.lastThrottleTime - this.timeWindow) ** 3 + this.lastMaxRate
);
}
enableTokenBucket() {
this.enabled = true;
}
updateTokenBucketRate(newRate) {
this.refillTokenBucket();
this.fillRate = Math.max(newRate, this.minFillRate);
this.maxCapacity = Math.max(newRate, this.minCapacity);
this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
}
updateMeasuredRate() {
const t = this.getCurrentTimeInSeconds();
const timeBucket = Math.floor(t * 2) / 2;
this.requestCount++;
if (timeBucket > this.lastTxRateBucket) {
const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
this.requestCount = 0;
this.lastTxRateBucket = timeBucket;
}
}
getPrecise(num) {
return parseFloat(num.toFixed(8));
}
};
__name(_DefaultRateLimiter, "DefaultRateLimiter");
var DefaultRateLimiter = _DefaultRateLimiter;
var DEFAULT_RETRY_DELAY_BASE = 100;
var MAXIMUM_RETRY_DELAY = 20 * 1e3;
var THROTTLING_RETRY_DELAY_BASE = 500;
var INITIAL_RETRY_TOKENS = 500;
var RETRY_COST = 5;
var TIMEOUT_RETRY_COST = 10;
var NO_RETRY_INCREMENT = 1;
var INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
var REQUEST_HEADER = "amz-sdk-request";
var getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => {
let delayBase = DEFAULT_RETRY_DELAY_BASE;
const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => {
return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));
}, "computeNextBackoffDelay");
const setDelayBase = /* @__PURE__ */ __name((delay) => {
delayBase = delay;
}, "setDelayBase");
return {
computeNextBackoffDelay,
setDelayBase,
};
}, "getDefaultRetryBackoffStrategy");
var createDefaultRetryToken = /* @__PURE__ */ __name(({ retryDelay, retryCount, retryCost }) => {
const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount");
const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay");
const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost");
return {
getRetryCount,
getRetryDelay,
getRetryCost,
};
}, "createDefaultRetryToken");
var _StandardRetryStrategy = class _StandardRetryStrategy {
constructor(maxAttempts) {
this.maxAttempts = maxAttempts;
this.mode = "standard";
this.capacity = INITIAL_RETRY_TOKENS;
this.retryBackoffStrategy = getDefaultRetryBackoffStrategy();
this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
}
async acquireInitialRetryToken(retryTokenScope) {
return createDefaultRetryToken({
retryDelay: DEFAULT_RETRY_DELAY_BASE,
retryCount: 0,
});
}
async refreshRetryTokenForRetry(token, errorInfo) {
const maxAttempts = await this.getMaxAttempts();
if (this.shouldRetry(token, errorInfo, maxAttempts)) {
const errorType = errorInfo.errorType;
this.retryBackoffStrategy.setDelayBase(
errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE
);
const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
const retryDelay = errorInfo.retryAfterHint
? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType)
: delayFromErrorType;
const capacityCost = this.getCapacityCost(errorType);
this.capacity -= capacityCost;
return createDefaultRetryToken({
retryDelay,
retryCount: token.getRetryCount() + 1,
retryCost: capacityCost,
});
}
throw new Error("No retry token available");
}
recordSuccess(token) {
this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
}
getCapacity() {
return this.capacity;
}
async getMaxAttempts() {
try {
return await this.maxAttemptsProvider();
} catch (error) {
console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
return DEFAULT_MAX_ATTEMPTS;
}
}
shouldRetry(tokenToRenew, errorInfo, maxAttempts) {
const attempts = tokenToRenew.getRetryCount() + 1;
return (
attempts < maxAttempts &&
this.capacity >= this.getCapacityCost(errorInfo.errorType) &&
this.isRetryableError(errorInfo.errorType)
);
}
getCapacityCost(errorType) {
return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST;
}
isRetryableError(errorType) {
return errorType === "THROTTLING" || errorType === "TRANSIENT";
}
};
__name(_StandardRetryStrategy, "StandardRetryStrategy");
var StandardRetryStrategy = _StandardRetryStrategy;
var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy {
constructor(maxAttemptsProvider, options) {
this.maxAttemptsProvider = maxAttemptsProvider;
this.mode = "adaptive";
const { rateLimiter } = options ?? {};
this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
}
async acquireInitialRetryToken(retryTokenScope) {
await this.rateLimiter.getSendToken();
return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
}
async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
this.rateLimiter.updateClientSendingRate(errorInfo);
return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
}
recordSuccess(token) {
this.rateLimiter.updateClientSendingRate({});
this.standardRetryStrategy.recordSuccess(token);
}
};
__name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy");
var AdaptiveRetryStrategy = _AdaptiveRetryStrategy;
var _ConfiguredRetryStrategy = class _ConfiguredRetryStrategy extends StandardRetryStrategy {
constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) {
super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts);
if (typeof computeNextBackoffDelay === "number") {
this.computeNextBackoffDelay = () => computeNextBackoffDelay;
} else {
this.computeNextBackoffDelay = computeNextBackoffDelay;
}
}
async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount());
return token;
}
};
__name(_ConfiguredRetryStrategy, "ConfiguredRetryStrategy");
var ConfiguredRetryStrategy = _ConfiguredRetryStrategy;
},
});
// node_modules/@smithy/middleware-stack/dist-cjs/index.js
var require_dist_cjs21 = __commonJS({
"node_modules/@smithy/middleware-stack/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
constructStack: () => constructStack,
});
module2.exports = __toCommonJS2(src_exports);
var getAllAliases = /* @__PURE__ */ __name((name, aliases) => {
const _aliases = [];
if (name) {
_aliases.push(name);
}
if (aliases) {
for (const alias of aliases) {
_aliases.push(alias);
}
}
return _aliases;
}, "getAllAliases");
var getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => {
return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
}, "getMiddlewareNameWithAliases");
var constructStack = /* @__PURE__ */ __name(() => {
let absoluteEntries = [];
let relativeEntries = [];
let identifyOnResolve = false;
const entriesNameSet = /* @__PURE__ */ new Set();
const sort = /* @__PURE__ */ __name(
(entries) =>
entries.sort(
(a, b) =>
stepWeights[b.step] - stepWeights[a.step] ||
priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]
),
"sort"
);
const removeByName = /* @__PURE__ */ __name((toRemove) => {
let isRemoved = false;
const filterCb = /* @__PURE__ */ __name((entry) => {
const aliases = getAllAliases(entry.name, entry.aliases);
if (aliases.includes(toRemove)) {
isRemoved = true;
for (const alias of aliases) {
entriesNameSet.delete(alias);
}
return false;
}
return true;
}, "filterCb");
absoluteEntries = absoluteEntries.filter(filterCb);
relativeEntries = relativeEntries.filter(filterCb);
return isRemoved;
}, "removeByName");
const removeByReference = /* @__PURE__ */ __name((toRemove) => {
let isRemoved = false;
const filterCb = /* @__PURE__ */ __name((entry) => {
if (entry.middleware === toRemove) {
isRemoved = true;
for (const alias of getAllAliases(entry.name, entry.aliases)) {
entriesNameSet.delete(alias);
}
return false;
}
return true;
}, "filterCb");
absoluteEntries = absoluteEntries.filter(filterCb);
relativeEntries = relativeEntries.filter(filterCb);
return isRemoved;
}, "removeByReference");
const cloneTo = /* @__PURE__ */ __name((toStack) => {
var _a;
absoluteEntries.forEach((entry) => {
toStack.add(entry.middleware, { ...entry });
});
relativeEntries.forEach((entry) => {
toStack.addRelativeTo(entry.middleware, { ...entry });
});
(_a = toStack.identifyOnResolve) == null ? void 0 : _a.call(toStack, stack.identifyOnResolve());
return toStack;
}, "cloneTo");
const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => {
const expandedMiddlewareList = [];
from.before.forEach((entry) => {
if (entry.before.length === 0 && entry.after.length === 0) {
expandedMiddlewareList.push(entry);
} else {
expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
}
});
expandedMiddlewareList.push(from);
from.after.reverse().forEach((entry) => {
if (entry.before.length === 0 && entry.after.length === 0) {
expandedMiddlewareList.push(entry);
} else {
expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
}
});
return expandedMiddlewareList;
}, "expandRelativeMiddlewareList");
const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => {
const normalizedAbsoluteEntries = [];
const normalizedRelativeEntries = [];
const normalizedEntriesNameMap = {};
absoluteEntries.forEach((entry) => {
const normalizedEntry = {
...entry,
before: [],
after: [],
};
for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
normalizedEntriesNameMap[alias] = normalizedEntry;
}
normalizedAbsoluteEntries.push(normalizedEntry);
});
relativeEntries.forEach((entry) => {
const normalizedEntry = {
...entry,
before: [],
after: [],
};
for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
normalizedEntriesNameMap[alias] = normalizedEntry;
}
normalizedRelativeEntries.push(normalizedEntry);
});
normalizedRelativeEntries.forEach((entry) => {
if (entry.toMiddleware) {
const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
if (toMiddleware === void 0) {
if (debug) {
return;
}
throw new Error(
`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`
);
}
if (entry.relation === "after") {
toMiddleware.after.push(entry);
}
if (entry.relation === "before") {
toMiddleware.before.push(entry);
}
}
});
const mainChain = sort(normalizedAbsoluteEntries)
.map(expandRelativeMiddlewareList)
.reduce((wholeList, expandedMiddlewareList) => {
wholeList.push(...expandedMiddlewareList);
return wholeList;
}, []);
return mainChain;
}, "getMiddlewareList");
const stack = {
add: (middleware, options = {}) => {
const { name, override, aliases: _aliases } = options;
const entry = {
step: "initialize",
priority: "normal",
middleware,
...options,
};
const aliases = getAllAliases(name, _aliases);
if (aliases.length > 0) {
if (aliases.some((alias) => entriesNameSet.has(alias))) {
if (!override)
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
for (const alias of aliases) {
const toOverrideIndex = absoluteEntries.findIndex((entry2) => {
var _a;
return (
entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias))
);
});
if (toOverrideIndex === -1) {
continue;
}
const toOverride = absoluteEntries[toOverrideIndex];
if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
throw new Error(
`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`
);
}
absoluteEntries.splice(toOverrideIndex, 1);
}
}
for (const alias of aliases) {
entriesNameSet.add(alias);
}
}
absoluteEntries.push(entry);
},
addRelativeTo: (middleware, options) => {
const { name, override, aliases: _aliases } = options;
const entry = {
middleware,
...options,
};
const aliases = getAllAliases(name, _aliases);
if (aliases.length > 0) {
if (aliases.some((alias) => entriesNameSet.has(alias))) {
if (!override)
throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
for (const alias of aliases) {
const toOverrideIndex = relativeEntries.findIndex((entry2) => {
var _a;
return (
entry2.name === alias || ((_a = entry2.aliases) == null ? void 0 : _a.some((a) => a === alias))
);
});
if (toOverrideIndex === -1) {
continue;
}
const toOverride = relativeEntries[toOverrideIndex];
if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
throw new Error(
`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`
);
}
relativeEntries.splice(toOverrideIndex, 1);
}
}
for (const alias of aliases) {
entriesNameSet.add(alias);
}
}
relativeEntries.push(entry);
},
clone: () => cloneTo(constructStack()),
use: (plugin) => {
plugin.applyToStack(stack);
},
remove: (toRemove) => {
if (typeof toRemove === "string") return removeByName(toRemove);
else return removeByReference(toRemove);
},
removeByTag: (toRemove) => {
let isRemoved = false;
const filterCb = /* @__PURE__ */ __name((entry) => {
const { tags, name, aliases: _aliases } = entry;
if (tags && tags.includes(toRemove)) {
const aliases = getAllAliases(name, _aliases);
for (const alias of aliases) {
entriesNameSet.delete(alias);
}
isRemoved = true;
return false;
}
return true;
}, "filterCb");
absoluteEntries = absoluteEntries.filter(filterCb);
relativeEntries = relativeEntries.filter(filterCb);
return isRemoved;
},
concat: (from) => {
var _a;
const cloned = cloneTo(constructStack());
cloned.use(from);
cloned.identifyOnResolve(
identifyOnResolve ||
cloned.identifyOnResolve() ||
(((_a = from.identifyOnResolve) == null ? void 0 : _a.call(from)) ?? false)
);
return cloned;
},
applyToStack: cloneTo,
identify: () => {
return getMiddlewareList(true).map((mw) => {
const step = mw.step ?? mw.relation + " " + mw.toMiddleware;
return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
});
},
identifyOnResolve(toggle) {
if (typeof toggle === "boolean") identifyOnResolve = toggle;
return identifyOnResolve;
},
resolve: (handler, context) => {
for (const middleware of getMiddlewareList()
.map((entry) => entry.middleware)
.reverse()) {
handler = middleware(handler, context);
}
if (identifyOnResolve) {
console.log(stack.identify());
}
return handler;
},
};
return stack;
}, "constructStack");
var stepWeights = {
initialize: 5,
serialize: 4,
build: 3,
finalizeRequest: 2,
deserialize: 1,
};
var priorityWeights = {
high: 3,
normal: 2,
low: 1,
};
},
});
// node_modules/@smithy/is-array-buffer/dist-cjs/index.js
var require_dist_cjs22 = __commonJS({
"node_modules/@smithy/is-array-buffer/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
isArrayBuffer: () => isArrayBuffer,
});
module2.exports = __toCommonJS2(src_exports);
var isArrayBuffer = /* @__PURE__ */ __name(
(arg) =>
(typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) ||
Object.prototype.toString.call(arg) === "[object ArrayBuffer]",
"isArrayBuffer"
);
},
});
// node_modules/@smithy/util-buffer-from/dist-cjs/index.js
var require_dist_cjs23 = __commonJS({
"node_modules/@smithy/util-buffer-from/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
fromArrayBuffer: () => fromArrayBuffer,
fromString: () => fromString,
});
module2.exports = __toCommonJS2(src_exports);
var import_is_array_buffer = require_dist_cjs22();
var import_buffer = require("buffer");
var fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => {
if (!(0, import_is_array_buffer.isArrayBuffer)(input)) {
throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
}
return import_buffer.Buffer.from(input, offset, length);
}, "fromArrayBuffer");
var fromString = /* @__PURE__ */ __name((input, encoding) => {
if (typeof input !== "string") {
throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
}
return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input);
}, "fromString");
},
});
// node_modules/@smithy/util-base64/dist-cjs/fromBase64.js
var require_fromBase64 = __commonJS({
"node_modules/@smithy/util-base64/dist-cjs/fromBase64.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromBase64 = void 0;
var util_buffer_from_1 = require_dist_cjs23();
var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
var fromBase642 = (input) => {
if ((input.length * 3) % 4 !== 0) {
throw new TypeError(`Incorrect padding on base64 string.`);
}
if (!BASE64_REGEX.exec(input)) {
throw new TypeError(`Invalid base64 string.`);
}
const buffer = (0, util_buffer_from_1.fromString)(input, "base64");
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
};
exports.fromBase64 = fromBase642;
},
});
// node_modules/@smithy/util-utf8/dist-cjs/index.js
var require_dist_cjs24 = __commonJS({
"node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
fromUtf8: () => fromUtf8,
toUint8Array: () => toUint8Array,
toUtf8: () => toUtf8,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_buffer_from = require_dist_cjs23();
var fromUtf8 = /* @__PURE__ */ __name((input) => {
const buf = (0, import_util_buffer_from.fromString)(input, "utf8");
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
}, "fromUtf8");
var toUint8Array = /* @__PURE__ */ __name((data) => {
if (typeof data === "string") {
return fromUtf8(data);
}
if (ArrayBuffer.isView(data)) {
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
}
return new Uint8Array(data);
}, "toUint8Array");
var toUtf8 = /* @__PURE__ */ __name((input) => {
if (typeof input === "string") {
return input;
}
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
}
return (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString(
"utf8"
);
}, "toUtf8");
},
});
// node_modules/@smithy/util-base64/dist-cjs/toBase64.js
var require_toBase64 = __commonJS({
"node_modules/@smithy/util-base64/dist-cjs/toBase64.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBase64 = void 0;
var util_buffer_from_1 = require_dist_cjs23();
var util_utf8_1 = require_dist_cjs24();
var toBase642 = (_input) => {
let input;
if (typeof _input === "string") {
input = (0, util_utf8_1.fromUtf8)(_input);
} else {
input = _input;
}
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
}
return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString(
"base64"
);
};
exports.toBase64 = toBase642;
},
});
// node_modules/@smithy/util-base64/dist-cjs/index.js
var require_dist_cjs25 = __commonJS({
"node_modules/@smithy/util-base64/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (
__copyProps2(target, mod, "default"),
secondTarget && __copyProps2(secondTarget, mod, "default")
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
module2.exports = __toCommonJS2(src_exports);
__reExport(src_exports, require_fromBase64(), module2.exports);
__reExport(src_exports, require_toBase64(), module2.exports);
},
});
// node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js
var require_getAwsChunkedEncodingStream = __commonJS({
"node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAwsChunkedEncodingStream = void 0;
var stream_1 = require("stream");
var getAwsChunkedEncodingStream2 = (readableStream, options) => {
const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
const checksumRequired =
base64Encoder !== void 0 &&
checksumAlgorithmFn !== void 0 &&
checksumLocationName !== void 0 &&
streamHasher !== void 0;
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0;
const awsChunkedEncodingStream = new stream_1.Readable({ read: () => {} });
readableStream.on("data", (data) => {
const length = bodyLengthChecker(data) || 0;
awsChunkedEncodingStream.push(`${length.toString(16)}\r
`);
awsChunkedEncodingStream.push(data);
awsChunkedEncodingStream.push("\r\n");
});
readableStream.on("end", async () => {
awsChunkedEncodingStream.push(`0\r
`);
if (checksumRequired) {
const checksum = base64Encoder(await digest);
awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r
`);
awsChunkedEncodingStream.push(`\r
`);
}
awsChunkedEncodingStream.push(null);
});
return awsChunkedEncodingStream;
};
exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream2;
},
});
// node_modules/@smithy/util-uri-escape/dist-cjs/index.js
var require_dist_cjs26 = __commonJS({
"node_modules/@smithy/util-uri-escape/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
escapeUri: () => escapeUri,
escapeUriPath: () => escapeUriPath,
});
module2.exports = __toCommonJS2(src_exports);
var escapeUri = /* @__PURE__ */ __name(
(uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode),
"escapeUri"
);
var hexEncode = /* @__PURE__ */ __name((c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode");
var escapeUriPath = /* @__PURE__ */ __name((uri) => uri.split("/").map(escapeUri).join("/"), "escapeUriPath");
},
});
// node_modules/@smithy/querystring-builder/dist-cjs/index.js
var require_dist_cjs27 = __commonJS({
"node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
buildQueryString: () => buildQueryString,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_uri_escape = require_dist_cjs26();
function buildQueryString(query) {
const parts = [];
for (let key of Object.keys(query).sort()) {
const value = query[key];
key = (0, import_util_uri_escape.escapeUri)(key);
if (Array.isArray(value)) {
for (let i = 0, iLen = value.length; i < iLen; i++) {
parts.push(`${key}=${(0, import_util_uri_escape.escapeUri)(value[i])}`);
}
} else {
let qsEntry = key;
if (value || typeof value === "string") {
qsEntry += `=${(0, import_util_uri_escape.escapeUri)(value)}`;
}
parts.push(qsEntry);
}
}
return parts.join("&");
}
__name(buildQueryString, "buildQueryString");
},
});
// node_modules/@smithy/node-http-handler/dist-cjs/index.js
var require_dist_cjs28 = __commonJS({
"node_modules/@smithy/node-http-handler/dist-cjs/index.js"(exports, module2) {
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (
(target = mod != null ? __create2(__getProtoOf2(mod)) : {}),
__copyProps2(
isNodeMode || !mod || !mod.__esModule
? __defProp2(target, "default", { value: mod, enumerable: true })
: target,
mod
)
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
DEFAULT_REQUEST_TIMEOUT: () => DEFAULT_REQUEST_TIMEOUT,
NodeHttp2Handler: () => NodeHttp2Handler,
NodeHttpHandler: () => NodeHttpHandler,
streamCollector: () => streamCollector,
});
module2.exports = __toCommonJS2(src_exports);
var import_protocol_http = require_dist_cjs2();
var import_querystring_builder = require_dist_cjs27();
var import_http = require("http");
var import_https = require("https");
var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
var getTransformedHeaders = /* @__PURE__ */ __name((headers) => {
const transformedHeaders = {};
for (const name of Object.keys(headers)) {
const headerValues = headers[name];
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
}
return transformedHeaders;
}, "getTransformedHeaders");
var setConnectionTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => {
if (!timeoutInMs) {
return;
}
const timeoutId = setTimeout(() => {
request.destroy();
reject(
Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), {
name: "TimeoutError",
})
);
}, timeoutInMs);
request.on("socket", (socket) => {
if (socket.connecting) {
socket.on("connect", () => {
clearTimeout(timeoutId);
});
} else {
clearTimeout(timeoutId);
}
});
}, "setConnectionTimeout");
var setSocketKeepAlive = /* @__PURE__ */ __name((request, { keepAlive, keepAliveMsecs }) => {
if (keepAlive !== true) {
return;
}
request.on("socket", (socket) => {
socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
});
}, "setSocketKeepAlive");
var setSocketTimeout = /* @__PURE__ */ __name((request, reject, timeoutInMs = 0) => {
request.setTimeout(timeoutInMs, () => {
request.destroy();
reject(
Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), {
name: "TimeoutError",
})
);
});
}, "setSocketTimeout");
var import_stream = require("stream");
var MIN_WAIT_TIME = 1e3;
async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) {
const headers = request.headers ?? {};
const expect = headers["Expect"] || headers["expect"];
let timeoutId = -1;
let hasError = false;
if (expect === "100-continue") {
await Promise.race([
new Promise((resolve) => {
timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
}),
new Promise((resolve) => {
httpRequest.on("continue", () => {
clearTimeout(timeoutId);
resolve();
});
httpRequest.on("error", () => {
hasError = true;
clearTimeout(timeoutId);
resolve();
});
}),
]);
}
if (!hasError) {
writeBody(httpRequest, request.body);
}
}
__name(writeRequestBody, "writeRequestBody");
function writeBody(httpRequest, body) {
if (body instanceof import_stream.Readable) {
body.pipe(httpRequest);
return;
}
if (body) {
if (Buffer.isBuffer(body) || typeof body === "string") {
httpRequest.end(body);
return;
}
const uint8 = body;
if (
typeof uint8 === "object" &&
uint8.buffer &&
typeof uint8.byteOffset === "number" &&
typeof uint8.byteLength === "number"
) {
httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
return;
}
httpRequest.end(Buffer.from(body));
return;
}
httpRequest.end();
}
__name(writeBody, "writeBody");
var DEFAULT_REQUEST_TIMEOUT = 0;
var _NodeHttpHandler = class _NodeHttpHandler2 {
constructor(options) {
this.socketWarningTimestamp = 0;
this.metadata = { handlerProtocol: "http/1.1" };
this.configProvider = new Promise((resolve, reject) => {
if (typeof options === "function") {
options()
.then((_options) => {
resolve(this.resolveDefaultConfig(_options));
})
.catch(reject);
} else {
resolve(this.resolveDefaultConfig(options));
}
});
}
static create(instanceOrOptions) {
if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") {
return instanceOrOptions;
}
return new _NodeHttpHandler2(instanceOrOptions);
}
static checkSocketUsage(agent, socketWarningTimestamp, logger = console) {
var _a, _b, _c;
const { sockets, requests, maxSockets } = agent;
if (typeof maxSockets !== "number" || maxSockets === Infinity) {
return socketWarningTimestamp;
}
const interval = 15e3;
if (Date.now() - interval < socketWarningTimestamp) {
return socketWarningTimestamp;
}
if (sockets && requests) {
for (const origin in sockets) {
const socketsInUse = ((_a = sockets[origin]) == null ? void 0 : _a.length) ?? 0;
const requestsEnqueued = ((_b = requests[origin]) == null ? void 0 : _b.length) ?? 0;
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
(_c = logger == null ? void 0 : logger.warn) == null
? void 0
: _c.call(
logger,
`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`
);
return Date.now();
}
}
}
return socketWarningTimestamp;
}
resolveDefaultConfig(options) {
const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {};
const keepAlive = true;
const maxSockets = 50;
return {
connectionTimeout,
requestTimeout: requestTimeout ?? socketTimeout,
httpAgent: (() => {
if (
httpAgent instanceof import_http.Agent ||
typeof (httpAgent == null ? void 0 : httpAgent.destroy) === "function"
) {
return httpAgent;
}
return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent });
})(),
httpsAgent: (() => {
if (
httpsAgent instanceof import_https.Agent ||
typeof (httpsAgent == null ? void 0 : httpsAgent.destroy) === "function"
) {
return httpsAgent;
}
return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent });
})(),
logger: console,
};
}
destroy() {
var _a, _b, _c, _d;
(_b = (_a = this.config) == null ? void 0 : _a.httpAgent) == null ? void 0 : _b.destroy();
(_d = (_c = this.config) == null ? void 0 : _c.httpsAgent) == null ? void 0 : _d.destroy();
}
async handle(request, { abortSignal } = {}) {
if (!this.config) {
this.config = await this.configProvider;
}
let socketCheckTimeoutId;
return new Promise((_resolve, _reject) => {
let writeRequestBodyPromise = void 0;
const resolve = /* @__PURE__ */ __name(async (arg) => {
await writeRequestBodyPromise;
clearTimeout(socketCheckTimeoutId);
_resolve(arg);
}, "resolve");
const reject = /* @__PURE__ */ __name(async (arg) => {
await writeRequestBodyPromise;
clearTimeout(socketCheckTimeoutId);
_reject(arg);
}, "reject");
if (!this.config) {
throw new Error("Node HTTP request handler config is not resolved");
}
if (abortSignal == null ? void 0 : abortSignal.aborted) {
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
reject(abortError);
return;
}
const isSSL = request.protocol === "https:";
const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent;
socketCheckTimeoutId = setTimeout(
() => {
this.socketWarningTimestamp = _NodeHttpHandler2.checkSocketUsage(
agent,
this.socketWarningTimestamp,
this.config.logger
);
},
this.config.socketAcquisitionWarningTimeout ??
(this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3)
);
const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {});
let auth = void 0;
if (request.username != null || request.password != null) {
const username = request.username ?? "";
const password = request.password ?? "";
auth = `${username}:${password}`;
}
let path = request.path;
if (queryString) {
path += `?${queryString}`;
}
if (request.fragment) {
path += `#${request.fragment}`;
}
const nodeHttpsOptions = {
headers: request.headers,
host: request.hostname,
method: request.method,
path,
port: request.port,
agent,
auth,
};
const requestFunc = isSSL ? import_https.request : import_http.request;
const req = requestFunc(nodeHttpsOptions, (res) => {
const httpResponse = new import_protocol_http.HttpResponse({
statusCode: res.statusCode || -1,
reason: res.statusMessage,
headers: getTransformedHeaders(res.headers),
body: res,
});
resolve({ response: httpResponse });
});
req.on("error", (err) => {
if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
reject(Object.assign(err, { name: "TimeoutError" }));
} else {
reject(err);
}
});
setConnectionTimeout(req, reject, this.config.connectionTimeout);
setSocketTimeout(req, reject, this.config.requestTimeout);
if (abortSignal) {
const onAbort = /* @__PURE__ */ __name(() => {
req.destroy();
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
reject(abortError);
}, "onAbort");
if (typeof abortSignal.addEventListener === "function") {
abortSignal.addEventListener("abort", onAbort);
} else {
abortSignal.onabort = onAbort;
}
}
const httpAgent = nodeHttpsOptions.agent;
if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
setSocketKeepAlive(req, {
keepAlive: httpAgent.keepAlive,
keepAliveMsecs: httpAgent.keepAliveMsecs,
});
}
writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch((e) => {
clearTimeout(socketCheckTimeoutId);
return _reject(e);
});
});
}
updateHttpClientConfig(key, value) {
this.config = void 0;
this.configProvider = this.configProvider.then((config) => {
return {
...config,
[key]: value,
};
});
}
httpHandlerConfigs() {
return this.config ?? {};
}
};
__name(_NodeHttpHandler, "NodeHttpHandler");
var NodeHttpHandler = _NodeHttpHandler;
var import_http22 = require("http2");
var import_http2 = __toESM2(require("http2"));
var _NodeHttp2ConnectionPool = class _NodeHttp2ConnectionPool {
constructor(sessions) {
this.sessions = [];
this.sessions = sessions ?? [];
}
poll() {
if (this.sessions.length > 0) {
return this.sessions.shift();
}
}
offerLast(session) {
this.sessions.push(session);
}
contains(session) {
return this.sessions.includes(session);
}
remove(session) {
this.sessions = this.sessions.filter((s) => s !== session);
}
[Symbol.iterator]() {
return this.sessions[Symbol.iterator]();
}
destroy(connection) {
for (const session of this.sessions) {
if (session === connection) {
if (!session.destroyed) {
session.destroy();
}
}
}
}
};
__name(_NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool");
var NodeHttp2ConnectionPool = _NodeHttp2ConnectionPool;
var _NodeHttp2ConnectionManager = class _NodeHttp2ConnectionManager {
constructor(config) {
this.sessionCache = /* @__PURE__ */ new Map();
this.config = config;
if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) {
throw new RangeError("maxConcurrency must be greater than zero.");
}
}
lease(requestContext, connectionConfiguration) {
const url = this.getUrlString(requestContext);
const existingPool = this.sessionCache.get(url);
if (existingPool) {
const existingSession = existingPool.poll();
if (existingSession && !this.config.disableConcurrency) {
return existingSession;
}
}
const session = import_http2.default.connect(url);
if (this.config.maxConcurrency) {
session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => {
if (err) {
throw new Error(
"Fail to set maxConcurrentStreams to " +
this.config.maxConcurrency +
"when creating new session for " +
requestContext.destination.toString()
);
}
});
}
session.unref();
const destroySessionCb = /* @__PURE__ */ __name(() => {
session.destroy();
this.deleteSession(url, session);
}, "destroySessionCb");
session.on("goaway", destroySessionCb);
session.on("error", destroySessionCb);
session.on("frameError", destroySessionCb);
session.on("close", () => this.deleteSession(url, session));
if (connectionConfiguration.requestTimeout) {
session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb);
}
const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool();
connectionPool.offerLast(session);
this.sessionCache.set(url, connectionPool);
return session;
}
deleteSession(authority, session) {
const existingConnectionPool = this.sessionCache.get(authority);
if (!existingConnectionPool) {
return;
}
if (!existingConnectionPool.contains(session)) {
return;
}
existingConnectionPool.remove(session);
this.sessionCache.set(authority, existingConnectionPool);
}
release(requestContext, session) {
var _a;
const cacheKey = this.getUrlString(requestContext);
(_a = this.sessionCache.get(cacheKey)) == null ? void 0 : _a.offerLast(session);
}
destroy() {
for (const [key, connectionPool] of this.sessionCache) {
for (const session of connectionPool) {
if (!session.destroyed) {
session.destroy();
}
connectionPool.remove(session);
}
this.sessionCache.delete(key);
}
}
setMaxConcurrentStreams(maxConcurrentStreams) {
if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) {
throw new RangeError("maxConcurrentStreams must be greater than zero.");
}
this.config.maxConcurrency = maxConcurrentStreams;
}
setDisableConcurrentStreams(disableConcurrentStreams) {
this.config.disableConcurrency = disableConcurrentStreams;
}
getUrlString(request) {
return request.destination.toString();
}
};
__name(_NodeHttp2ConnectionManager, "NodeHttp2ConnectionManager");
var NodeHttp2ConnectionManager = _NodeHttp2ConnectionManager;
var _NodeHttp2Handler = class _NodeHttp2Handler2 {
constructor(options) {
this.metadata = { handlerProtocol: "h2" };
this.connectionManager = new NodeHttp2ConnectionManager({});
this.configProvider = new Promise((resolve, reject) => {
if (typeof options === "function") {
options()
.then((opts) => {
resolve(opts || {});
})
.catch(reject);
} else {
resolve(options || {});
}
});
}
static create(instanceOrOptions) {
if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") {
return instanceOrOptions;
}
return new _NodeHttp2Handler2(instanceOrOptions);
}
destroy() {
this.connectionManager.destroy();
}
async handle(request, { abortSignal } = {}) {
if (!this.config) {
this.config = await this.configProvider;
this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false);
if (this.config.maxConcurrentStreams) {
this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams);
}
}
const { requestTimeout, disableConcurrentStreams } = this.config;
return new Promise((_resolve, _reject) => {
var _a;
let fulfilled = false;
let writeRequestBodyPromise = void 0;
const resolve = /* @__PURE__ */ __name(async (arg) => {
await writeRequestBodyPromise;
_resolve(arg);
}, "resolve");
const reject = /* @__PURE__ */ __name(async (arg) => {
await writeRequestBodyPromise;
_reject(arg);
}, "reject");
if (abortSignal == null ? void 0 : abortSignal.aborted) {
fulfilled = true;
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
reject(abortError);
return;
}
const { hostname, method, port, protocol, query } = request;
let auth = "";
if (request.username != null || request.password != null) {
const username = request.username ?? "";
const password = request.password ?? "";
auth = `${username}:${password}@`;
}
const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`;
const requestContext = { destination: new URL(authority) };
const session = this.connectionManager.lease(requestContext, {
requestTimeout: (_a = this.config) == null ? void 0 : _a.sessionTimeout,
disableConcurrentStreams: disableConcurrentStreams || false,
});
const rejectWithDestroy = /* @__PURE__ */ __name((err) => {
if (disableConcurrentStreams) {
this.destroySession(session);
}
fulfilled = true;
reject(err);
}, "rejectWithDestroy");
const queryString = (0, import_querystring_builder.buildQueryString)(query || {});
let path = request.path;
if (queryString) {
path += `?${queryString}`;
}
if (request.fragment) {
path += `#${request.fragment}`;
}
const req = session.request({
...request.headers,
[import_http22.constants.HTTP2_HEADER_PATH]: path,
[import_http22.constants.HTTP2_HEADER_METHOD]: method,
});
session.ref();
req.on("response", (headers) => {
const httpResponse = new import_protocol_http.HttpResponse({
statusCode: headers[":status"] || -1,
headers: getTransformedHeaders(headers),
body: req,
});
fulfilled = true;
resolve({ response: httpResponse });
if (disableConcurrentStreams) {
session.close();
this.connectionManager.deleteSession(authority, session);
}
});
if (requestTimeout) {
req.setTimeout(requestTimeout, () => {
req.close();
const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`);
timeoutError.name = "TimeoutError";
rejectWithDestroy(timeoutError);
});
}
if (abortSignal) {
const onAbort = /* @__PURE__ */ __name(() => {
req.close();
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
rejectWithDestroy(abortError);
}, "onAbort");
if (typeof abortSignal.addEventListener === "function") {
abortSignal.addEventListener("abort", onAbort);
} else {
abortSignal.onabort = onAbort;
}
}
req.on("frameError", (type, code, id) => {
rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`));
});
req.on("error", rejectWithDestroy);
req.on("aborted", () => {
rejectWithDestroy(
new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)
);
});
req.on("close", () => {
session.unref();
if (disableConcurrentStreams) {
session.destroy();
}
if (!fulfilled) {
rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response"));
}
});
writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout);
});
}
updateHttpClientConfig(key, value) {
this.config = void 0;
this.configProvider = this.configProvider.then((config) => {
return {
...config,
[key]: value,
};
});
}
httpHandlerConfigs() {
return this.config ?? {};
}
destroySession(session) {
if (!session.destroyed) {
session.destroy();
}
}
};
__name(_NodeHttp2Handler, "NodeHttp2Handler");
var NodeHttp2Handler = _NodeHttp2Handler;
var _Collector = class _Collector extends import_stream.Writable {
constructor() {
super(...arguments);
this.bufferedBytes = [];
}
_write(chunk, encoding, callback) {
this.bufferedBytes.push(chunk);
callback();
}
};
__name(_Collector, "Collector");
var Collector = _Collector;
var streamCollector = /* @__PURE__ */ __name((stream) => {
if (isReadableStreamInstance(stream)) {
return collectReadableStream(stream);
}
return new Promise((resolve, reject) => {
const collector = new Collector();
stream.pipe(collector);
stream.on("error", (err) => {
collector.end();
reject(err);
});
collector.on("error", reject);
collector.on("finish", function () {
const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
resolve(bytes);
});
});
}, "streamCollector");
var isReadableStreamInstance = /* @__PURE__ */ __name(
(stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream,
"isReadableStreamInstance"
);
async function collectReadableStream(stream) {
const chunks = [];
const reader = stream.getReader();
let isDone = false;
let length = 0;
while (!isDone) {
const { done, value } = await reader.read();
if (value) {
chunks.push(value);
length += value.length;
}
isDone = done;
}
const collected = new Uint8Array(length);
let offset = 0;
for (const chunk of chunks) {
collected.set(chunk, offset);
offset += chunk.length;
}
return collected;
}
__name(collectReadableStream, "collectReadableStream");
},
});
// node_modules/@smithy/fetch-http-handler/dist-cjs/index.js
var require_dist_cjs29 = __commonJS({
"node_modules/@smithy/fetch-http-handler/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
FetchHttpHandler: () => FetchHttpHandler,
keepAliveSupport: () => keepAliveSupport,
streamCollector: () => streamCollector,
});
module2.exports = __toCommonJS2(src_exports);
var import_protocol_http = require_dist_cjs2();
var import_querystring_builder = require_dist_cjs27();
function requestTimeout(timeoutInMs = 0) {
return new Promise((resolve, reject) => {
if (timeoutInMs) {
setTimeout(() => {
const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
timeoutError.name = "TimeoutError";
reject(timeoutError);
}, timeoutInMs);
}
});
}
__name(requestTimeout, "requestTimeout");
var keepAliveSupport = {
supported: void 0,
};
var _FetchHttpHandler = class _FetchHttpHandler2 {
static create(instanceOrOptions) {
if (typeof (instanceOrOptions == null ? void 0 : instanceOrOptions.handle) === "function") {
return instanceOrOptions;
}
return new _FetchHttpHandler2(instanceOrOptions);
}
constructor(options) {
if (typeof options === "function") {
this.configProvider = options().then((opts) => opts || {});
} else {
this.config = options ?? {};
this.configProvider = Promise.resolve(this.config);
}
if (keepAliveSupport.supported === void 0) {
keepAliveSupport.supported = Boolean(
typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]")
);
}
}
destroy() {}
async handle(request, { abortSignal } = {}) {
if (!this.config) {
this.config = await this.configProvider;
}
const requestTimeoutInMs = this.config.requestTimeout;
const keepAlive = this.config.keepAlive === true;
if (abortSignal == null ? void 0 : abortSignal.aborted) {
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
return Promise.reject(abortError);
}
let path = request.path;
const queryString = (0, import_querystring_builder.buildQueryString)(request.query || {});
if (queryString) {
path += `?${queryString}`;
}
if (request.fragment) {
path += `#${request.fragment}`;
}
let auth = "";
if (request.username != null || request.password != null) {
const username = request.username ?? "";
const password = request.password ?? "";
auth = `${username}:${password}@`;
}
const { port, method } = request;
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
const requestOptions = {
body,
headers: new Headers(request.headers),
method,
};
if (body) {
requestOptions.duplex = "half";
}
if (typeof AbortController !== "undefined") {
requestOptions.signal = abortSignal;
}
if (keepAliveSupport.supported) {
requestOptions.keepalive = keepAlive;
}
const fetchRequest = new Request(url, requestOptions);
const raceOfPromises = [
fetch(fetchRequest).then((response) => {
const fetchHeaders = response.headers;
const transformedHeaders = {};
for (const pair of fetchHeaders.entries()) {
transformedHeaders[pair[0]] = pair[1];
}
const hasReadableStream = response.body != void 0;
if (!hasReadableStream) {
return response.blob().then((body2) => ({
response: new import_protocol_http.HttpResponse({
headers: transformedHeaders,
reason: response.statusText,
statusCode: response.status,
body: body2,
}),
}));
}
return {
response: new import_protocol_http.HttpResponse({
headers: transformedHeaders,
reason: response.statusText,
statusCode: response.status,
body: response.body,
}),
};
}),
requestTimeout(requestTimeoutInMs),
];
if (abortSignal) {
raceOfPromises.push(
new Promise((resolve, reject) => {
const onAbort = /* @__PURE__ */ __name(() => {
const abortError = new Error("Request aborted");
abortError.name = "AbortError";
reject(abortError);
}, "onAbort");
if (typeof abortSignal.addEventListener === "function") {
abortSignal.addEventListener("abort", onAbort);
} else {
abortSignal.onabort = onAbort;
}
})
);
}
return Promise.race(raceOfPromises);
}
updateHttpClientConfig(key, value) {
this.config = void 0;
this.configProvider = this.configProvider.then((config) => {
config[key] = value;
return config;
});
}
httpHandlerConfigs() {
return this.config ?? {};
}
};
__name(_FetchHttpHandler, "FetchHttpHandler");
var FetchHttpHandler = _FetchHttpHandler;
var import_util_base64 = require_dist_cjs25();
var streamCollector = /* @__PURE__ */ __name((stream) => {
if (typeof Blob === "function" && stream instanceof Blob) {
return collectBlob(stream);
}
return collectStream(stream);
}, "streamCollector");
async function collectBlob(blob) {
const base64 = await readToBase64(blob);
const arrayBuffer = (0, import_util_base64.fromBase64)(base64);
return new Uint8Array(arrayBuffer);
}
__name(collectBlob, "collectBlob");
async function collectStream(stream) {
const chunks = [];
const reader = stream.getReader();
let isDone = false;
let length = 0;
while (!isDone) {
const { done, value } = await reader.read();
if (value) {
chunks.push(value);
length += value.length;
}
isDone = done;
}
const collected = new Uint8Array(length);
let offset = 0;
for (const chunk of chunks) {
collected.set(chunk, offset);
offset += chunk.length;
}
return collected;
}
__name(collectStream, "collectStream");
function readToBase64(blob) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onloadend = () => {
if (reader.readyState !== 2) {
return reject(new Error("Reader aborted too early"));
}
const result = reader.result ?? "";
const commaIndex = result.indexOf(",");
const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
resolve(result.substring(dataOffset));
};
reader.onabort = () => reject(new Error("Read aborted"));
reader.onerror = () => reject(reader.error);
reader.readAsDataURL(blob);
});
}
__name(readToBase64, "readToBase64");
},
});
// node_modules/@smithy/util-hex-encoding/dist-cjs/index.js
var require_dist_cjs30 = __commonJS({
"node_modules/@smithy/util-hex-encoding/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
fromHex: () => fromHex,
toHex: () => toHex,
});
module2.exports = __toCommonJS2(src_exports);
var SHORT_TO_HEX = {};
var HEX_TO_SHORT = {};
for (let i = 0; i < 256; i++) {
let encodedByte = i.toString(16).toLowerCase();
if (encodedByte.length === 1) {
encodedByte = `0${encodedByte}`;
}
SHORT_TO_HEX[i] = encodedByte;
HEX_TO_SHORT[encodedByte] = i;
}
function fromHex(encoded) {
if (encoded.length % 2 !== 0) {
throw new Error("Hex encoded strings must have an even number length");
}
const out = new Uint8Array(encoded.length / 2);
for (let i = 0; i < encoded.length; i += 2) {
const encodedByte = encoded.slice(i, i + 2).toLowerCase();
if (encodedByte in HEX_TO_SHORT) {
out[i / 2] = HEX_TO_SHORT[encodedByte];
} else {
throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
}
}
return out;
}
__name(fromHex, "fromHex");
function toHex(bytes) {
let out = "";
for (let i = 0; i < bytes.byteLength; i++) {
out += SHORT_TO_HEX[bytes[i]];
}
return out;
}
__name(toHex, "toHex");
},
});
// node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js
var require_sdk_stream_mixin_browser = __commonJS({
"node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.sdkStreamMixin = void 0;
var fetch_http_handler_1 = require_dist_cjs29();
var util_base64_1 = require_dist_cjs25();
var util_hex_encoding_1 = require_dist_cjs30();
var util_utf8_1 = require_dist_cjs24();
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
var sdkStreamMixin2 = (stream) => {
var _a, _b;
if (!isBlobInstance(stream) && !isReadableStreamInstance(stream)) {
const name =
((_b =
(_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0
? void 0
: _a.constructor) === null || _b === void 0
? void 0
: _b.name) || stream;
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
}
let transformed = false;
const transformToByteArray = async () => {
if (transformed) {
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
}
transformed = true;
return await (0, fetch_http_handler_1.streamCollector)(stream);
};
const blobToWebStream = (blob) => {
if (typeof blob.stream !== "function") {
throw new Error(
"Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body"
);
}
return blob.stream();
};
return Object.assign(stream, {
transformToByteArray,
transformToString: async (encoding) => {
const buf = await transformToByteArray();
if (encoding === "base64") {
return (0, util_base64_1.toBase64)(buf);
} else if (encoding === "hex") {
return (0, util_hex_encoding_1.toHex)(buf);
} else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") {
return (0, util_utf8_1.toUtf8)(buf);
} else if (typeof TextDecoder === "function") {
return new TextDecoder(encoding).decode(buf);
} else {
throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
}
},
transformToWebStream: () => {
if (transformed) {
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
}
transformed = true;
if (isBlobInstance(stream)) {
return blobToWebStream(stream);
} else if (isReadableStreamInstance(stream)) {
return stream;
} else {
throw new Error(`Cannot transform payload to web stream, got ${stream}`);
}
},
});
};
exports.sdkStreamMixin = sdkStreamMixin2;
var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
var isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
},
});
// node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js
var require_sdk_stream_mixin = __commonJS({
"node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.sdkStreamMixin = void 0;
var node_http_handler_1 = require_dist_cjs28();
var util_buffer_from_1 = require_dist_cjs23();
var stream_1 = require("stream");
var util_1 = require("util");
var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser();
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
var sdkStreamMixin2 = (stream) => {
var _a, _b;
if (!(stream instanceof stream_1.Readable)) {
try {
return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream);
} catch (e) {
const name =
((_b =
(_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0
? void 0
: _a.constructor) === null || _b === void 0
? void 0
: _b.name) || stream;
throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
}
}
let transformed = false;
const transformToByteArray = async () => {
if (transformed) {
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
}
transformed = true;
return await (0, node_http_handler_1.streamCollector)(stream);
};
return Object.assign(stream, {
transformToByteArray,
transformToString: async (encoding) => {
const buf = await transformToByteArray();
if (encoding === void 0 || Buffer.isEncoding(encoding)) {
return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(
encoding
);
} else {
const decoder = new util_1.TextDecoder(encoding);
return decoder.decode(buf);
}
},
transformToWebStream: () => {
if (transformed) {
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
}
if (stream.readableFlowing !== null) {
throw new Error("The stream has been consumed by other callbacks.");
}
if (typeof stream_1.Readable.toWeb !== "function") {
throw new Error(
"Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."
);
}
transformed = true;
return stream_1.Readable.toWeb(stream);
},
});
};
exports.sdkStreamMixin = sdkStreamMixin2;
},
});
// node_modules/@smithy/util-stream/dist-cjs/index.js
var require_dist_cjs31 = __commonJS({
"node_modules/@smithy/util-stream/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (
__copyProps2(target, mod, "default"),
secondTarget && __copyProps2(secondTarget, mod, "default")
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_base64 = require_dist_cjs25();
var import_util_utf8 = require_dist_cjs24();
function transformToString(payload, encoding = "utf-8") {
if (encoding === "base64") {
return (0, import_util_base64.toBase64)(payload);
}
return (0, import_util_utf8.toUtf8)(payload);
}
__name(transformToString, "transformToString");
function transformFromString(str, encoding) {
if (encoding === "base64") {
return Uint8ArrayBlobAdapter.mutate((0, import_util_base64.fromBase64)(str));
}
return Uint8ArrayBlobAdapter.mutate((0, import_util_utf8.fromUtf8)(str));
}
__name(transformFromString, "transformFromString");
var _Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter2 extends Uint8Array {
static fromString(source, encoding = "utf-8") {
switch (typeof source) {
case "string":
return transformFromString(source, encoding);
default:
throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
}
}
static mutate(source) {
Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter2.prototype);
return source;
}
transformToString(encoding = "utf-8") {
return transformToString(this, encoding);
}
};
__name(_Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter");
var Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter;
__reExport(src_exports, require_getAwsChunkedEncodingStream(), module2.exports);
__reExport(src_exports, require_sdk_stream_mixin(), module2.exports);
},
});
// node_modules/@smithy/smithy-client/dist-cjs/index.js
var require_dist_cjs32 = __commonJS({
"node_modules/@smithy/smithy-client/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
Client: () => Client,
Command: () => Command,
LazyJsonString: () => LazyJsonString,
NoOpLogger: () => NoOpLogger,
SENSITIVE_STRING: () => SENSITIVE_STRING,
ServiceException: () => ServiceException,
StringWrapper: () => StringWrapper,
_json: () => _json,
collectBody: () => collectBody,
convertMap: () => convertMap,
createAggregatedClient: () => createAggregatedClient,
dateToUtcString: () => dateToUtcString,
decorateServiceException: () => decorateServiceException,
emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion,
expectBoolean: () => expectBoolean,
expectByte: () => expectByte,
expectFloat32: () => expectFloat32,
expectInt: () => expectInt,
expectInt32: () => expectInt32,
expectLong: () => expectLong,
expectNonNull: () => expectNonNull,
expectNumber: () => expectNumber,
expectObject: () => expectObject,
expectShort: () => expectShort,
expectString: () => expectString,
expectUnion: () => expectUnion,
extendedEncodeURIComponent: () => extendedEncodeURIComponent,
getArrayIfSingleItem: () => getArrayIfSingleItem,
getDefaultClientConfiguration: () => getDefaultClientConfiguration,
getDefaultExtensionConfiguration: () => getDefaultExtensionConfiguration,
getValueFromTextNode: () => getValueFromTextNode,
handleFloat: () => handleFloat,
limitedParseDouble: () => limitedParseDouble,
limitedParseFloat: () => limitedParseFloat,
limitedParseFloat32: () => limitedParseFloat32,
loadConfigsForDefaultMode: () => loadConfigsForDefaultMode,
logger: () => logger,
map: () => map,
parseBoolean: () => parseBoolean,
parseEpochTimestamp: () => parseEpochTimestamp,
parseRfc3339DateTime: () => parseRfc3339DateTime,
parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset,
parseRfc7231DateTime: () => parseRfc7231DateTime,
resolveDefaultRuntimeConfig: () => resolveDefaultRuntimeConfig,
resolvedPath: () => resolvedPath,
serializeDateTime: () => serializeDateTime,
serializeFloat: () => serializeFloat,
splitEvery: () => splitEvery,
strictParseByte: () => strictParseByte,
strictParseDouble: () => strictParseDouble,
strictParseFloat: () => strictParseFloat,
strictParseFloat32: () => strictParseFloat32,
strictParseInt: () => strictParseInt,
strictParseInt32: () => strictParseInt32,
strictParseLong: () => strictParseLong,
strictParseShort: () => strictParseShort,
take: () => take,
throwDefaultError: () => throwDefaultError,
withBaseException: () => withBaseException,
});
module2.exports = __toCommonJS2(src_exports);
var _NoOpLogger = class _NoOpLogger {
trace() {}
debug() {}
info() {}
warn() {}
error() {}
};
__name(_NoOpLogger, "NoOpLogger");
var NoOpLogger = _NoOpLogger;
var import_middleware_stack = require_dist_cjs21();
var _Client = class _Client {
constructor(config) {
this.middlewareStack = (0, import_middleware_stack.constructStack)();
this.config = config;
}
send(command, optionsOrCb, cb) {
const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
const handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
if (callback) {
handler(command)
.then(
(result) => callback(null, result.output),
(err) => callback(err)
)
.catch(() => {});
} else {
return handler(command).then((result) => result.output);
}
}
destroy() {
if (this.config.requestHandler.destroy) this.config.requestHandler.destroy();
}
};
__name(_Client, "Client");
var Client = _Client;
var import_util_stream = require_dist_cjs31();
var collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context) => {
if (streamBody instanceof Uint8Array) {
return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody);
}
if (!streamBody) {
return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array());
}
const fromContext = context.streamCollector(streamBody);
return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext);
}, "collectBody");
var import_types = require_dist_cjs();
var _Command = class _Command {
constructor() {
this.middlewareStack = (0, import_middleware_stack.constructStack)();
}
static classBuilder() {
return new ClassBuilder();
}
resolveMiddlewareWithContext(
clientStack,
configuration,
options,
{
middlewareFn,
clientName,
commandName,
inputFilterSensitiveLog,
outputFilterSensitiveLog,
smithyContext,
additionalContext,
CommandCtor,
}
) {
for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
this.middlewareStack.use(mw);
}
const stack = clientStack.concat(this.middlewareStack);
const { logger: logger2 } = configuration;
const handlerExecutionContext = {
logger: logger2,
clientName,
commandName,
inputFilterSensitiveLog,
outputFilterSensitiveLog,
[import_types.SMITHY_CONTEXT_KEY]: {
...smithyContext,
},
...additionalContext,
};
const { requestHandler } = configuration;
return stack.resolve(
(request) => requestHandler.handle(request.request, options || {}),
handlerExecutionContext
);
}
};
__name(_Command, "Command");
var Command = _Command;
var _ClassBuilder = class _ClassBuilder {
constructor() {
this._init = () => {};
this._ep = {};
this._middlewareFn = () => [];
this._commandName = "";
this._clientName = "";
this._additionalContext = {};
this._smithyContext = {};
this._inputFilterSensitiveLog = (_) => _;
this._outputFilterSensitiveLog = (_) => _;
this._serializer = null;
this._deserializer = null;
}
init(cb) {
this._init = cb;
}
ep(endpointParameterInstructions) {
this._ep = endpointParameterInstructions;
return this;
}
m(middlewareSupplier) {
this._middlewareFn = middlewareSupplier;
return this;
}
s(service, operation, smithyContext = {}) {
this._smithyContext = {
service,
operation,
...smithyContext,
};
return this;
}
c(additionalContext = {}) {
this._additionalContext = additionalContext;
return this;
}
n(clientName, commandName) {
this._clientName = clientName;
this._commandName = commandName;
return this;
}
f(inputFilter = (_) => _, outputFilter = (_) => _) {
this._inputFilterSensitiveLog = inputFilter;
this._outputFilterSensitiveLog = outputFilter;
return this;
}
ser(serializer) {
this._serializer = serializer;
return this;
}
de(deserializer) {
this._deserializer = deserializer;
return this;
}
build() {
var _a;
const closure = this;
let CommandRef;
return (CommandRef =
((_a = class extends Command {
constructor(...[input]) {
super();
this.serialize = closure._serializer;
this.deserialize = closure._deserializer;
this.input = input ?? {};
closure._init(this);
}
static getEndpointParameterInstructions() {
return closure._ep;
}
resolveMiddleware(stack, configuration, options) {
return this.resolveMiddlewareWithContext(stack, configuration, options, {
CommandCtor: CommandRef,
middlewareFn: closure._middlewareFn,
clientName: closure._clientName,
commandName: closure._commandName,
inputFilterSensitiveLog: closure._inputFilterSensitiveLog,
outputFilterSensitiveLog: closure._outputFilterSensitiveLog,
smithyContext: closure._smithyContext,
additionalContext: closure._additionalContext,
});
}
}),
__name(_a, "CommandRef"),
_a));
}
};
__name(_ClassBuilder, "ClassBuilder");
var ClassBuilder = _ClassBuilder;
var SENSITIVE_STRING = "***SensitiveInformation***";
var createAggregatedClient = /* @__PURE__ */ __name((commands, Client2) => {
for (const command of Object.keys(commands)) {
const CommandCtor = commands[command];
const methodImpl = /* @__PURE__ */ __name(async function (args, optionsOrCb, cb) {
const command2 = new CommandCtor(args);
if (typeof optionsOrCb === "function") {
this.send(command2, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expected http options but got ${typeof optionsOrCb}`);
this.send(command2, optionsOrCb || {}, cb);
} else {
return this.send(command2, optionsOrCb);
}
}, "methodImpl");
const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, "");
Client2.prototype[methodName] = methodImpl;
}
}, "createAggregatedClient");
var parseBoolean = /* @__PURE__ */ __name((value) => {
switch (value) {
case "true":
return true;
case "false":
return false;
default:
throw new Error(`Unable to parse boolean value "${value}"`);
}
}, "parseBoolean");
var expectBoolean = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (typeof value === "number") {
if (value === 0 || value === 1) {
logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
}
if (value === 0) {
return false;
}
if (value === 1) {
return true;
}
}
if (typeof value === "string") {
const lower = value.toLowerCase();
if (lower === "false" || lower === "true") {
logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
}
if (lower === "false") {
return false;
}
if (lower === "true") {
return true;
}
}
if (typeof value === "boolean") {
return value;
}
throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);
}, "expectBoolean");
var expectNumber = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (typeof value === "string") {
const parsed = parseFloat(value);
if (!Number.isNaN(parsed)) {
if (String(parsed) !== String(value)) {
logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
}
return parsed;
}
}
if (typeof value === "number") {
return value;
}
throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
}, "expectNumber");
var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
var expectFloat32 = /* @__PURE__ */ __name((value) => {
const expected = expectNumber(value);
if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
if (Math.abs(expected) > MAX_FLOAT) {
throw new TypeError(`Expected 32-bit float, got ${value}`);
}
}
return expected;
}, "expectFloat32");
var expectLong = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (Number.isInteger(value) && !Number.isNaN(value)) {
return value;
}
throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
}, "expectLong");
var expectInt = expectLong;
var expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), "expectInt32");
var expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort");
var expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte");
var expectSizedInt = /* @__PURE__ */ __name((value, size) => {
const expected = expectLong(value);
if (expected !== void 0 && castInt(expected, size) !== expected) {
throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
}
return expected;
}, "expectSizedInt");
var castInt = /* @__PURE__ */ __name((value, size) => {
switch (size) {
case 32:
return Int32Array.of(value)[0];
case 16:
return Int16Array.of(value)[0];
case 8:
return Int8Array.of(value)[0];
}
}, "castInt");
var expectNonNull = /* @__PURE__ */ __name((value, location) => {
if (value === null || value === void 0) {
if (location) {
throw new TypeError(`Expected a non-null value for ${location}`);
}
throw new TypeError("Expected a non-null value");
}
return value;
}, "expectNonNull");
var expectObject = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (typeof value === "object" && !Array.isArray(value)) {
return value;
}
const receivedType = Array.isArray(value) ? "array" : typeof value;
throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
}, "expectObject");
var expectString = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (typeof value === "string") {
return value;
}
if (["boolean", "number", "bigint"].includes(typeof value)) {
logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
return String(value);
}
throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
}, "expectString");
var expectUnion = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
const asObject = expectObject(value);
const setKeys = Object.entries(asObject)
.filter(([, v]) => v != null)
.map(([k]) => k);
if (setKeys.length === 0) {
throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
}
if (setKeys.length > 1) {
throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);
}
return asObject;
}, "expectUnion");
var strictParseDouble = /* @__PURE__ */ __name((value) => {
if (typeof value == "string") {
return expectNumber(parseNumber(value));
}
return expectNumber(value);
}, "strictParseDouble");
var strictParseFloat = strictParseDouble;
var strictParseFloat32 = /* @__PURE__ */ __name((value) => {
if (typeof value == "string") {
return expectFloat32(parseNumber(value));
}
return expectFloat32(value);
}, "strictParseFloat32");
var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
var parseNumber = /* @__PURE__ */ __name((value) => {
const matches = value.match(NUMBER_REGEX);
if (matches === null || matches[0].length !== value.length) {
throw new TypeError(`Expected real number, got implicit NaN`);
}
return parseFloat(value);
}, "parseNumber");
var limitedParseDouble = /* @__PURE__ */ __name((value) => {
if (typeof value == "string") {
return parseFloatString(value);
}
return expectNumber(value);
}, "limitedParseDouble");
var handleFloat = limitedParseDouble;
var limitedParseFloat = limitedParseDouble;
var limitedParseFloat32 = /* @__PURE__ */ __name((value) => {
if (typeof value == "string") {
return parseFloatString(value);
}
return expectFloat32(value);
}, "limitedParseFloat32");
var parseFloatString = /* @__PURE__ */ __name((value) => {
switch (value) {
case "NaN":
return NaN;
case "Infinity":
return Infinity;
case "-Infinity":
return -Infinity;
default:
throw new Error(`Unable to parse float value: ${value}`);
}
}, "parseFloatString");
var strictParseLong = /* @__PURE__ */ __name((value) => {
if (typeof value === "string") {
return expectLong(parseNumber(value));
}
return expectLong(value);
}, "strictParseLong");
var strictParseInt = strictParseLong;
var strictParseInt32 = /* @__PURE__ */ __name((value) => {
if (typeof value === "string") {
return expectInt32(parseNumber(value));
}
return expectInt32(value);
}, "strictParseInt32");
var strictParseShort = /* @__PURE__ */ __name((value) => {
if (typeof value === "string") {
return expectShort(parseNumber(value));
}
return expectShort(value);
}, "strictParseShort");
var strictParseByte = /* @__PURE__ */ __name((value) => {
if (typeof value === "string") {
return expectByte(parseNumber(value));
}
return expectByte(value);
}, "strictParseByte");
var stackTraceWarning = /* @__PURE__ */ __name((message) => {
return String(new TypeError(message).stack || message)
.split("\n")
.slice(0, 5)
.filter((s) => !s.includes("stackTraceWarning"))
.join("\n");
}, "stackTraceWarning");
var logger = {
warn: console.warn,
};
var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
function dateToUtcString(date) {
const year = date.getUTCFullYear();
const month = date.getUTCMonth();
const dayOfWeek = date.getUTCDay();
const dayOfMonthInt = date.getUTCDate();
const hoursInt = date.getUTCHours();
const minutesInt = date.getUTCMinutes();
const secondsInt = date.getUTCSeconds();
const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;
}
__name(dateToUtcString, "dateToUtcString");
var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
var parseRfc3339DateTime = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (typeof value !== "string") {
throw new TypeError("RFC-3339 date-times must be expressed as strings");
}
const match = RFC3339.exec(value);
if (!match) {
throw new TypeError("Invalid RFC-3339 date-time value");
}
const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
const year = strictParseShort(stripLeadingZeroes(yearStr));
const month = parseDateValue(monthStr, "month", 1, 12);
const day = parseDateValue(dayStr, "day", 1, 31);
return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
}, "parseRfc3339DateTime");
var RFC3339_WITH_OFFSET = new RegExp(
/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/
);
var parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (typeof value !== "string") {
throw new TypeError("RFC-3339 date-times must be expressed as strings");
}
const match = RFC3339_WITH_OFFSET.exec(value);
if (!match) {
throw new TypeError("Invalid RFC-3339 date-time value");
}
const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
const year = strictParseShort(stripLeadingZeroes(yearStr));
const month = parseDateValue(monthStr, "month", 1, 12);
const day = parseDateValue(dayStr, "day", 1, 31);
const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
if (offsetStr.toUpperCase() != "Z") {
date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));
}
return date;
}, "parseRfc3339DateTimeWithOffset");
var IMF_FIXDATE = new RegExp(
/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/
);
var RFC_850_DATE = new RegExp(
/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/
);
var ASC_TIME = new RegExp(
/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/
);
var parseRfc7231DateTime = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
if (typeof value !== "string") {
throw new TypeError("RFC-7231 date-times must be expressed as strings");
}
let match = IMF_FIXDATE.exec(value);
if (match) {
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
return buildDate(
strictParseShort(stripLeadingZeroes(yearStr)),
parseMonthByShortName(monthStr),
parseDateValue(dayStr, "day", 1, 31),
{ hours, minutes, seconds, fractionalMilliseconds }
);
}
match = RFC_850_DATE.exec(value);
if (match) {
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
return adjustRfc850Year(
buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
hours,
minutes,
seconds,
fractionalMilliseconds,
})
);
}
match = ASC_TIME.exec(value);
if (match) {
const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
return buildDate(
strictParseShort(stripLeadingZeroes(yearStr)),
parseMonthByShortName(monthStr),
parseDateValue(dayStr.trimLeft(), "day", 1, 31),
{ hours, minutes, seconds, fractionalMilliseconds }
);
}
throw new TypeError("Invalid RFC-7231 date-time value");
}, "parseRfc7231DateTime");
var parseEpochTimestamp = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return void 0;
}
let valueAsDouble;
if (typeof value === "number") {
valueAsDouble = value;
} else if (typeof value === "string") {
valueAsDouble = strictParseDouble(value);
} else {
throw new TypeError(
"Epoch timestamps must be expressed as floating point numbers or their string representation"
);
}
if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {
throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");
}
return new Date(Math.round(valueAsDouble * 1e3));
}, "parseEpochTimestamp");
var buildDate = /* @__PURE__ */ __name((year, month, day, time) => {
const adjustedMonth = month - 1;
validateDayOfMonth(year, adjustedMonth, day);
return new Date(
Date.UTC(
year,
adjustedMonth,
day,
parseDateValue(time.hours, "hour", 0, 23),
parseDateValue(time.minutes, "minute", 0, 59),
parseDateValue(time.seconds, "seconds", 0, 60),
parseMilliseconds(time.fractionalMilliseconds)
)
);
}, "buildDate");
var parseTwoDigitYear = /* @__PURE__ */ __name((value) => {
const thisYear = /* @__PURE__ */ new Date().getUTCFullYear();
const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
if (valueInThisCentury < thisYear) {
return valueInThisCentury + 100;
}
return valueInThisCentury;
}, "parseTwoDigitYear");
var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3;
var adjustRfc850Year = /* @__PURE__ */ __name((input) => {
if (input.getTime() - /* @__PURE__ */ new Date().getTime() > FIFTY_YEARS_IN_MILLIS) {
return new Date(
Date.UTC(
input.getUTCFullYear() - 100,
input.getUTCMonth(),
input.getUTCDate(),
input.getUTCHours(),
input.getUTCMinutes(),
input.getUTCSeconds(),
input.getUTCMilliseconds()
)
);
}
return input;
}, "adjustRfc850Year");
var parseMonthByShortName = /* @__PURE__ */ __name((value) => {
const monthIdx = MONTHS.indexOf(value);
if (monthIdx < 0) {
throw new TypeError(`Invalid month: ${value}`);
}
return monthIdx + 1;
}, "parseMonthByShortName");
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var validateDayOfMonth = /* @__PURE__ */ __name((year, month, day) => {
let maxDays = DAYS_IN_MONTH[month];
if (month === 1 && isLeapYear(year)) {
maxDays = 29;
}
if (day > maxDays) {
throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
}
}, "validateDayOfMonth");
var isLeapYear = /* @__PURE__ */ __name((year) => {
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}, "isLeapYear");
var parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => {
const dateVal = strictParseByte(stripLeadingZeroes(value));
if (dateVal < lower || dateVal > upper) {
throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
}
return dateVal;
}, "parseDateValue");
var parseMilliseconds = /* @__PURE__ */ __name((value) => {
if (value === null || value === void 0) {
return 0;
}
return strictParseFloat32("0." + value) * 1e3;
}, "parseMilliseconds");
var parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => {
const directionStr = value[0];
let direction = 1;
if (directionStr == "+") {
direction = 1;
} else if (directionStr == "-") {
direction = -1;
} else {
throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
}
const hour = Number(value.substring(1, 3));
const minute = Number(value.substring(4, 6));
return direction * (hour * 60 + minute) * 60 * 1e3;
}, "parseOffsetToMilliseconds");
var stripLeadingZeroes = /* @__PURE__ */ __name((value) => {
let idx = 0;
while (idx < value.length - 1 && value.charAt(idx) === "0") {
idx++;
}
if (idx === 0) {
return value;
}
return value.slice(idx);
}, "stripLeadingZeroes");
var _ServiceException = class _ServiceException2 extends Error {
constructor(options) {
super(options.message);
Object.setPrototypeOf(this, _ServiceException2.prototype);
this.name = options.name;
this.$fault = options.$fault;
this.$metadata = options.$metadata;
}
};
__name(_ServiceException, "ServiceException");
var ServiceException = _ServiceException;
var decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => {
Object.entries(additions)
.filter(([, v]) => v !== void 0)
.forEach(([k, v]) => {
if (exception[k] == void 0 || exception[k] === "") {
exception[k] = v;
}
});
const message = exception.message || exception.Message || "UnknownError";
exception.message = message;
delete exception.Message;
return exception;
}, "decorateServiceException");
var throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => {
const $metadata = deserializeMetadata(output);
const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0;
const response = new exceptionCtor({
name:
(parsedBody == null ? void 0 : parsedBody.code) ||
(parsedBody == null ? void 0 : parsedBody.Code) ||
errorCode ||
statusCode ||
"UnknownError",
$fault: "client",
$metadata,
});
throw decorateServiceException(response, parsedBody);
}, "throwDefaultError");
var withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => {
return ({ output, parsedBody, errorCode }) => {
throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });
};
}, "withBaseException");
var deserializeMetadata = /* @__PURE__ */ __name(
(output) => ({
httpStatusCode: output.statusCode,
requestId:
output.headers["x-amzn-requestid"] ??
output.headers["x-amzn-request-id"] ??
output.headers["x-amz-request-id"],
extendedRequestId: output.headers["x-amz-id-2"],
cfId: output.headers["x-amz-cf-id"],
}),
"deserializeMetadata"
);
var loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => {
switch (mode) {
case "standard":
return {
retryMode: "standard",
connectionTimeout: 3100,
};
case "in-region":
return {
retryMode: "standard",
connectionTimeout: 1100,
};
case "cross-region":
return {
retryMode: "standard",
connectionTimeout: 3100,
};
case "mobile":
return {
retryMode: "standard",
connectionTimeout: 3e4,
};
default:
return {};
}
}, "loadConfigsForDefaultMode");
var warningEmitted = false;
var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => {
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
warningEmitted = true;
}
}, "emitWarningIfUnsupportedVersion");
var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
const checksumAlgorithms = [];
for (const id in import_types.AlgorithmId) {
const algorithmId = import_types.AlgorithmId[id];
if (runtimeConfig[algorithmId] === void 0) {
continue;
}
checksumAlgorithms.push({
algorithmId: () => algorithmId,
checksumConstructor: () => runtimeConfig[algorithmId],
});
}
return {
_checksumAlgorithms: checksumAlgorithms,
addChecksumAlgorithm(algo) {
this._checksumAlgorithms.push(algo);
},
checksumAlgorithms() {
return this._checksumAlgorithms;
},
};
}, "getChecksumConfiguration");
var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {
const runtimeConfig = {};
clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
});
return runtimeConfig;
}, "resolveChecksumRuntimeConfig");
var getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
let _retryStrategy = runtimeConfig.retryStrategy;
return {
setRetryStrategy(retryStrategy) {
_retryStrategy = retryStrategy;
},
retryStrategy() {
return _retryStrategy;
},
};
}, "getRetryConfiguration");
var resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => {
const runtimeConfig = {};
runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
return runtimeConfig;
}, "resolveRetryRuntimeConfig");
var getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
return {
...getChecksumConfiguration(runtimeConfig),
...getRetryConfiguration(runtimeConfig),
};
}, "getDefaultExtensionConfiguration");
var getDefaultClientConfiguration = getDefaultExtensionConfiguration;
var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {
return {
...resolveChecksumRuntimeConfig(config),
...resolveRetryRuntimeConfig(config),
};
}, "resolveDefaultRuntimeConfig");
function extendedEncodeURIComponent(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, (c) => "%" + c.charCodeAt(0).toString(16).toUpperCase());
}
__name(extendedEncodeURIComponent, "extendedEncodeURIComponent");
var getArrayIfSingleItem = /* @__PURE__ */ __name(
(mayBeArray) => (Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]),
"getArrayIfSingleItem"
);
var getValueFromTextNode = /* @__PURE__ */ __name((obj) => {
const textNodeName = "#text";
for (const key in obj) {
if (Object.hasOwn(obj, key) && obj[key][textNodeName] !== void 0) {
obj[key] = obj[key][textNodeName];
} else if (typeof obj[key] === "object" && obj[key] !== null) {
obj[key] = getValueFromTextNode(obj[key]);
}
}
return obj;
}, "getValueFromTextNode");
var StringWrapper = /* @__PURE__ */ __name(function () {
const Class = Object.getPrototypeOf(this).constructor;
const Constructor = Function.bind.apply(String, [null, ...arguments]);
const instance = new Constructor();
Object.setPrototypeOf(instance, Class.prototype);
return instance;
}, "StringWrapper");
StringWrapper.prototype = Object.create(String.prototype, {
constructor: {
value: StringWrapper,
enumerable: false,
writable: true,
configurable: true,
},
});
Object.setPrototypeOf(StringWrapper, String);
var _LazyJsonString = class _LazyJsonString2 extends StringWrapper {
deserializeJSON() {
return JSON.parse(super.toString());
}
toJSON() {
return super.toString();
}
static fromObject(object) {
if (object instanceof _LazyJsonString2) {
return object;
} else if (object instanceof String || typeof object === "string") {
return new _LazyJsonString2(object);
}
return new _LazyJsonString2(JSON.stringify(object));
}
};
__name(_LazyJsonString, "LazyJsonString");
var LazyJsonString = _LazyJsonString;
function map(arg0, arg1, arg2) {
let target;
let filter;
let instructions;
if (typeof arg1 === "undefined" && typeof arg2 === "undefined") {
target = {};
instructions = arg0;
} else {
target = arg0;
if (typeof arg1 === "function") {
filter = arg1;
instructions = arg2;
return mapWithFilter(target, filter, instructions);
} else {
instructions = arg1;
}
}
for (const key of Object.keys(instructions)) {
if (!Array.isArray(instructions[key])) {
target[key] = instructions[key];
continue;
}
applyInstruction(target, null, instructions, key);
}
return target;
}
__name(map, "map");
var convertMap = /* @__PURE__ */ __name((target) => {
const output = {};
for (const [k, v] of Object.entries(target || {})) {
output[k] = [, v];
}
return output;
}, "convertMap");
var take = /* @__PURE__ */ __name((source, instructions) => {
const out = {};
for (const key in instructions) {
applyInstruction(out, source, instructions, key);
}
return out;
}, "take");
var mapWithFilter = /* @__PURE__ */ __name((target, filter, instructions) => {
return map(
target,
Object.entries(instructions).reduce((_instructions, [key, value]) => {
if (Array.isArray(value)) {
_instructions[key] = value;
} else {
if (typeof value === "function") {
_instructions[key] = [filter, value()];
} else {
_instructions[key] = [filter, value];
}
}
return _instructions;
}, {})
);
}, "mapWithFilter");
var applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => {
if (source !== null) {
let instruction = instructions[targetKey];
if (typeof instruction === "function") {
instruction = [, instruction];
}
const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction;
if (
(typeof filter2 === "function" && filter2(source[sourceKey])) ||
(typeof filter2 !== "function" && !!filter2)
) {
target[targetKey] = valueFn(source[sourceKey]);
}
return;
}
const [filter, value] = instructions[targetKey];
if (typeof value === "function") {
let _value;
const defaultFilterPassed = filter === void 0 && (_value = value()) != null;
const customFilterPassed =
(typeof filter === "function" && !!filter(void 0)) || (typeof filter !== "function" && !!filter);
if (defaultFilterPassed) {
target[targetKey] = _value;
} else if (customFilterPassed) {
target[targetKey] = value();
}
} else {
const defaultFilterPassed = filter === void 0 && value != null;
const customFilterPassed =
(typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter);
if (defaultFilterPassed || customFilterPassed) {
target[targetKey] = value;
}
}
}, "applyInstruction");
var nonNullish = /* @__PURE__ */ __name((_) => _ != null, "nonNullish");
var pass = /* @__PURE__ */ __name((_) => _, "pass");
var resolvedPath = /* @__PURE__ */ __name(
(resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
if (input != null && input[memberName] !== void 0) {
const labelValue = labelValueProvider();
if (labelValue.length <= 0) {
throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
}
resolvedPath2 = resolvedPath2.replace(
uriLabel,
isGreedyLabel
? labelValue
.split("/")
.map((segment) => extendedEncodeURIComponent(segment))
.join("/")
: extendedEncodeURIComponent(labelValue)
);
} else {
throw new Error("No value provided for input HTTP label: " + memberName + ".");
}
return resolvedPath2;
},
"resolvedPath"
);
var serializeFloat = /* @__PURE__ */ __name((value) => {
if (value !== value) {
return "NaN";
}
switch (value) {
case Infinity:
return "Infinity";
case -Infinity:
return "-Infinity";
default:
return value;
}
}, "serializeFloat");
var serializeDateTime = /* @__PURE__ */ __name(
(date) => date.toISOString().replace(".000Z", "Z"),
"serializeDateTime"
);
var _json = /* @__PURE__ */ __name((obj) => {
if (obj == null) {
return {};
}
if (Array.isArray(obj)) {
return obj.filter((_) => _ != null).map(_json);
}
if (typeof obj === "object") {
const target = {};
for (const key of Object.keys(obj)) {
if (obj[key] == null) {
continue;
}
target[key] = _json(obj[key]);
}
return target;
}
return obj;
}, "_json");
function splitEvery(value, delimiter, numDelimiters) {
if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {
throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
}
const segments = value.split(delimiter);
if (numDelimiters === 1) {
return segments;
}
const compoundSegments = [];
let currentSegment = "";
for (let i = 0; i < segments.length; i++) {
if (currentSegment === "") {
currentSegment = segments[i];
} else {
currentSegment += delimiter + segments[i];
}
if ((i + 1) % numDelimiters === 0) {
compoundSegments.push(currentSegment);
currentSegment = "";
}
}
if (currentSegment !== "") {
compoundSegments.push(currentSegment);
}
return compoundSegments;
}
__name(splitEvery, "splitEvery");
},
});
// node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js
var require_isStreamingPayload = __commonJS({
"node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStreamingPayload = void 0;
var stream_1 = require("stream");
var isStreamingPayload = (request) =>
(request === null || request === void 0 ? void 0 : request.body) instanceof stream_1.Readable ||
(typeof ReadableStream !== "undefined" &&
(request === null || request === void 0 ? void 0 : request.body) instanceof ReadableStream);
exports.isStreamingPayload = isStreamingPayload;
},
});
// node_modules/@smithy/middleware-retry/dist-cjs/index.js
var require_dist_cjs33 = __commonJS({
"node_modules/@smithy/middleware-retry/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
AdaptiveRetryStrategy: () => AdaptiveRetryStrategy,
CONFIG_MAX_ATTEMPTS: () => CONFIG_MAX_ATTEMPTS,
CONFIG_RETRY_MODE: () => CONFIG_RETRY_MODE,
ENV_MAX_ATTEMPTS: () => ENV_MAX_ATTEMPTS,
ENV_RETRY_MODE: () => ENV_RETRY_MODE,
NODE_MAX_ATTEMPT_CONFIG_OPTIONS: () => NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
NODE_RETRY_MODE_CONFIG_OPTIONS: () => NODE_RETRY_MODE_CONFIG_OPTIONS,
StandardRetryStrategy: () => StandardRetryStrategy,
defaultDelayDecider: () => defaultDelayDecider,
defaultRetryDecider: () => defaultRetryDecider,
getOmitRetryHeadersPlugin: () => getOmitRetryHeadersPlugin,
getRetryAfterHint: () => getRetryAfterHint,
getRetryPlugin: () => getRetryPlugin,
omitRetryHeadersMiddleware: () => omitRetryHeadersMiddleware,
omitRetryHeadersMiddlewareOptions: () => omitRetryHeadersMiddlewareOptions,
resolveRetryConfig: () => resolveRetryConfig,
retryMiddleware: () => retryMiddleware,
retryMiddlewareOptions: () => retryMiddlewareOptions,
});
module2.exports = __toCommonJS2(src_exports);
var import_protocol_http = require_dist_cjs2();
var import_uuid = require_dist();
var import_util_retry = require_dist_cjs20();
var getDefaultRetryQuota = /* @__PURE__ */ __name((initialRetryTokens, options) => {
const MAX_CAPACITY = initialRetryTokens;
const noRetryIncrement =
(options == null ? void 0 : options.noRetryIncrement) ?? import_util_retry.NO_RETRY_INCREMENT;
const retryCost = (options == null ? void 0 : options.retryCost) ?? import_util_retry.RETRY_COST;
const timeoutRetryCost =
(options == null ? void 0 : options.timeoutRetryCost) ?? import_util_retry.TIMEOUT_RETRY_COST;
let availableCapacity = initialRetryTokens;
const getCapacityAmount = /* @__PURE__ */ __name(
(error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost),
"getCapacityAmount"
);
const hasRetryTokens = /* @__PURE__ */ __name(
(error) => getCapacityAmount(error) <= availableCapacity,
"hasRetryTokens"
);
const retrieveRetryTokens = /* @__PURE__ */ __name((error) => {
if (!hasRetryTokens(error)) {
throw new Error("No retry token available");
}
const capacityAmount = getCapacityAmount(error);
availableCapacity -= capacityAmount;
return capacityAmount;
}, "retrieveRetryTokens");
const releaseRetryTokens = /* @__PURE__ */ __name((capacityReleaseAmount) => {
availableCapacity += capacityReleaseAmount ?? noRetryIncrement;
availableCapacity = Math.min(availableCapacity, MAX_CAPACITY);
}, "releaseRetryTokens");
return Object.freeze({
hasRetryTokens,
retrieveRetryTokens,
releaseRetryTokens,
});
}, "getDefaultRetryQuota");
var defaultDelayDecider = /* @__PURE__ */ __name(
(delayBase, attempts) =>
Math.floor(Math.min(import_util_retry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)),
"defaultDelayDecider"
);
var import_service_error_classification = require_dist_cjs19();
var defaultRetryDecider = /* @__PURE__ */ __name((error) => {
if (!error) {
return false;
}
return (
(0, import_service_error_classification.isRetryableByTrait)(error) ||
(0, import_service_error_classification.isClockSkewError)(error) ||
(0, import_service_error_classification.isThrottlingError)(error) ||
(0, import_service_error_classification.isTransientError)(error)
);
}, "defaultRetryDecider");
var asSdkError = /* @__PURE__ */ __name((error) => {
if (error instanceof Error) return error;
if (error instanceof Object) return Object.assign(new Error(), error);
if (typeof error === "string") return new Error(error);
return new Error(`AWS SDK error wrapper for ${error}`);
}, "asSdkError");
var _StandardRetryStrategy = class _StandardRetryStrategy {
constructor(maxAttemptsProvider, options) {
this.maxAttemptsProvider = maxAttemptsProvider;
this.mode = import_util_retry.RETRY_MODES.STANDARD;
this.retryDecider = (options == null ? void 0 : options.retryDecider) ?? defaultRetryDecider;
this.delayDecider = (options == null ? void 0 : options.delayDecider) ?? defaultDelayDecider;
this.retryQuota =
(options == null ? void 0 : options.retryQuota) ??
getDefaultRetryQuota(import_util_retry.INITIAL_RETRY_TOKENS);
}
shouldRetry(error, attempts, maxAttempts) {
return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error);
}
async getMaxAttempts() {
let maxAttempts;
try {
maxAttempts = await this.maxAttemptsProvider();
} catch (error) {
maxAttempts = import_util_retry.DEFAULT_MAX_ATTEMPTS;
}
return maxAttempts;
}
async retry(next, args, options) {
let retryTokenAmount;
let attempts = 0;
let totalDelay = 0;
const maxAttempts = await this.getMaxAttempts();
const { request } = args;
if (import_protocol_http.HttpRequest.isInstance(request)) {
request.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)();
}
while (true) {
try {
if (import_protocol_http.HttpRequest.isInstance(request)) {
request.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
}
if (options == null ? void 0 : options.beforeRequest) {
await options.beforeRequest();
}
const { response, output } = await next(args);
if (options == null ? void 0 : options.afterRequest) {
options.afterRequest(response);
}
this.retryQuota.releaseRetryTokens(retryTokenAmount);
output.$metadata.attempts = attempts + 1;
output.$metadata.totalRetryDelay = totalDelay;
return { response, output };
} catch (e) {
const err = asSdkError(e);
attempts++;
if (this.shouldRetry(err, attempts, maxAttempts)) {
retryTokenAmount = this.retryQuota.retrieveRetryTokens(err);
const delayFromDecider = this.delayDecider(
(0, import_service_error_classification.isThrottlingError)(err)
? import_util_retry.THROTTLING_RETRY_DELAY_BASE
: import_util_retry.DEFAULT_RETRY_DELAY_BASE,
attempts
);
const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);
const delay = Math.max(delayFromResponse || 0, delayFromDecider);
totalDelay += delay;
await new Promise((resolve) => setTimeout(resolve, delay));
continue;
}
if (!err.$metadata) {
err.$metadata = {};
}
err.$metadata.attempts = attempts;
err.$metadata.totalRetryDelay = totalDelay;
throw err;
}
}
}
};
__name(_StandardRetryStrategy, "StandardRetryStrategy");
var StandardRetryStrategy = _StandardRetryStrategy;
var getDelayFromRetryAfterHeader = /* @__PURE__ */ __name((response) => {
if (!import_protocol_http.HttpResponse.isInstance(response)) return;
const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
if (!retryAfterHeaderName) return;
const retryAfter = response.headers[retryAfterHeaderName];
const retryAfterSeconds = Number(retryAfter);
if (!Number.isNaN(retryAfterSeconds)) return retryAfterSeconds * 1e3;
const retryAfterDate = new Date(retryAfter);
return retryAfterDate.getTime() - Date.now();
}, "getDelayFromRetryAfterHeader");
var _AdaptiveRetryStrategy = class _AdaptiveRetryStrategy extends StandardRetryStrategy {
constructor(maxAttemptsProvider, options) {
const { rateLimiter, ...superOptions } = options ?? {};
super(maxAttemptsProvider, superOptions);
this.rateLimiter = rateLimiter ?? new import_util_retry.DefaultRateLimiter();
this.mode = import_util_retry.RETRY_MODES.ADAPTIVE;
}
async retry(next, args) {
return super.retry(next, args, {
beforeRequest: async () => {
return this.rateLimiter.getSendToken();
},
afterRequest: (response) => {
this.rateLimiter.updateClientSendingRate(response);
},
});
}
};
__name(_AdaptiveRetryStrategy, "AdaptiveRetryStrategy");
var AdaptiveRetryStrategy = _AdaptiveRetryStrategy;
var import_util_middleware = require_dist_cjs10();
var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
var CONFIG_MAX_ATTEMPTS = "max_attempts";
var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => {
const value = env[ENV_MAX_ATTEMPTS];
if (!value) return void 0;
const maxAttempt = parseInt(value);
if (Number.isNaN(maxAttempt)) {
throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
}
return maxAttempt;
},
configFileSelector: (profile) => {
const value = profile[CONFIG_MAX_ATTEMPTS];
if (!value) return void 0;
const maxAttempt = parseInt(value);
if (Number.isNaN(maxAttempt)) {
throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
}
return maxAttempt;
},
default: import_util_retry.DEFAULT_MAX_ATTEMPTS,
};
var resolveRetryConfig = /* @__PURE__ */ __name((input) => {
const { retryStrategy } = input;
const maxAttempts = (0, import_util_middleware.normalizeProvider)(
input.maxAttempts ?? import_util_retry.DEFAULT_MAX_ATTEMPTS
);
return {
...input,
maxAttempts,
retryStrategy: async () => {
if (retryStrategy) {
return retryStrategy;
}
const retryMode = await (0, import_util_middleware.normalizeProvider)(input.retryMode)();
if (retryMode === import_util_retry.RETRY_MODES.ADAPTIVE) {
return new import_util_retry.AdaptiveRetryStrategy(maxAttempts);
}
return new import_util_retry.StandardRetryStrategy(maxAttempts);
},
};
}, "resolveRetryConfig");
var ENV_RETRY_MODE = "AWS_RETRY_MODE";
var CONFIG_RETRY_MODE = "retry_mode";
var NODE_RETRY_MODE_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => env[ENV_RETRY_MODE],
configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
default: import_util_retry.DEFAULT_RETRY_MODE,
};
var omitRetryHeadersMiddleware = /* @__PURE__ */ __name(
() => (next) => async (args) => {
const { request } = args;
if (import_protocol_http.HttpRequest.isInstance(request)) {
delete request.headers[import_util_retry.INVOCATION_ID_HEADER];
delete request.headers[import_util_retry.REQUEST_HEADER];
}
return next(args);
},
"omitRetryHeadersMiddleware"
);
var omitRetryHeadersMiddlewareOptions = {
name: "omitRetryHeadersMiddleware",
tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"],
relation: "before",
toMiddleware: "awsAuthMiddleware",
override: true,
};
var getOmitRetryHeadersPlugin = /* @__PURE__ */ __name(
(options) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);
},
}),
"getOmitRetryHeadersPlugin"
);
var import_smithy_client = require_dist_cjs32();
var import_isStreamingPayload = require_isStreamingPayload();
var retryMiddleware = /* @__PURE__ */ __name(
(options) => (next, context) => async (args) => {
var _a;
let retryStrategy = await options.retryStrategy();
const maxAttempts = await options.maxAttempts();
if (isRetryStrategyV2(retryStrategy)) {
retryStrategy = retryStrategy;
let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]);
let lastError = new Error();
let attempts = 0;
let totalRetryDelay = 0;
const { request } = args;
const isRequest = import_protocol_http.HttpRequest.isInstance(request);
if (isRequest) {
request.headers[import_util_retry.INVOCATION_ID_HEADER] = (0, import_uuid.v4)();
}
while (true) {
try {
if (isRequest) {
request.headers[import_util_retry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
}
const { response, output } = await next(args);
retryStrategy.recordSuccess(retryToken);
output.$metadata.attempts = attempts + 1;
output.$metadata.totalRetryDelay = totalRetryDelay;
return { response, output };
} catch (e) {
const retryErrorInfo = getRetryErrorInfo(e);
lastError = asSdkError(e);
if (isRequest && (0, import_isStreamingPayload.isStreamingPayload)(request)) {
(_a = context.logger instanceof import_smithy_client.NoOpLogger ? console : context.logger) == null
? void 0
: _a.warn("An error was encountered in a non-retryable streaming request.");
throw lastError;
}
try {
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
} catch (refreshError) {
if (!lastError.$metadata) {
lastError.$metadata = {};
}
lastError.$metadata.attempts = attempts + 1;
lastError.$metadata.totalRetryDelay = totalRetryDelay;
throw lastError;
}
attempts = retryToken.getRetryCount();
const delay = retryToken.getRetryDelay();
totalRetryDelay += delay;
await new Promise((resolve) => setTimeout(resolve, delay));
}
}
} else {
retryStrategy = retryStrategy;
if (retryStrategy == null ? void 0 : retryStrategy.mode)
context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]];
return retryStrategy.retry(next, args);
}
},
"retryMiddleware"
);
var isRetryStrategyV2 = /* @__PURE__ */ __name(
(retryStrategy) =>
typeof retryStrategy.acquireInitialRetryToken !== "undefined" &&
typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" &&
typeof retryStrategy.recordSuccess !== "undefined",
"isRetryStrategyV2"
);
var getRetryErrorInfo = /* @__PURE__ */ __name((error) => {
const errorInfo = {
error,
errorType: getRetryErrorType(error),
};
const retryAfterHint = getRetryAfterHint(error.$response);
if (retryAfterHint) {
errorInfo.retryAfterHint = retryAfterHint;
}
return errorInfo;
}, "getRetryErrorInfo");
var getRetryErrorType = /* @__PURE__ */ __name((error) => {
if ((0, import_service_error_classification.isThrottlingError)(error)) return "THROTTLING";
if ((0, import_service_error_classification.isTransientError)(error)) return "TRANSIENT";
if ((0, import_service_error_classification.isServerError)(error)) return "SERVER_ERROR";
return "CLIENT_ERROR";
}, "getRetryErrorType");
var retryMiddlewareOptions = {
name: "retryMiddleware",
tags: ["RETRY"],
step: "finalizeRequest",
priority: "high",
override: true,
};
var getRetryPlugin = /* @__PURE__ */ __name(
(options) => ({
applyToStack: (clientStack) => {
clientStack.add(retryMiddleware(options), retryMiddlewareOptions);
},
}),
"getRetryPlugin"
);
var getRetryAfterHint = /* @__PURE__ */ __name((response) => {
if (!import_protocol_http.HttpResponse.isInstance(response)) return;
const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
if (!retryAfterHeaderName) return;
const retryAfter = response.headers[retryAfterHeaderName];
const retryAfterSeconds = Number(retryAfter);
if (!Number.isNaN(retryAfterSeconds)) return new Date(retryAfterSeconds * 1e3);
const retryAfterDate = new Date(retryAfter);
return retryAfterDate;
}, "getRetryAfterHint");
},
});
// node_modules/@smithy/core/dist-cjs/index.js
var require_dist_cjs34 = __commonJS({
"node_modules/@smithy/core/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig,
EXPIRATION_MS: () => EXPIRATION_MS,
HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner,
HttpBearerAuthSigner: () => HttpBearerAuthSigner,
NoAuthSigner: () => NoAuthSigner,
RequestBuilder: () => RequestBuilder,
createIsIdentityExpiredFunction: () => createIsIdentityExpiredFunction,
createPaginator: () => createPaginator,
doesIdentityRequireRefresh: () => doesIdentityRequireRefresh,
getHttpAuthSchemeEndpointRuleSetPlugin: () => getHttpAuthSchemeEndpointRuleSetPlugin,
getHttpAuthSchemePlugin: () => getHttpAuthSchemePlugin,
getHttpSigningPlugin: () => getHttpSigningPlugin,
getSmithyContext: () => getSmithyContext3,
httpAuthSchemeEndpointRuleSetMiddlewareOptions: () => httpAuthSchemeEndpointRuleSetMiddlewareOptions,
httpAuthSchemeMiddleware: () => httpAuthSchemeMiddleware,
httpAuthSchemeMiddlewareOptions: () => httpAuthSchemeMiddlewareOptions,
httpSigningMiddleware: () => httpSigningMiddleware,
httpSigningMiddlewareOptions: () => httpSigningMiddlewareOptions,
isIdentityExpired: () => isIdentityExpired,
memoizeIdentityProvider: () => memoizeIdentityProvider,
normalizeProvider: () => normalizeProvider,
requestBuilder: () => requestBuilder,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_middleware = require_dist_cjs10();
function convertHttpAuthSchemesToMap(httpAuthSchemes) {
const map = /* @__PURE__ */ new Map();
for (const scheme of httpAuthSchemes) {
map.set(scheme.schemeId, scheme);
}
return map;
}
__name(convertHttpAuthSchemesToMap, "convertHttpAuthSchemesToMap");
var httpAuthSchemeMiddleware = /* @__PURE__ */ __name(
(config, mwOptions) => (next, context) => async (args) => {
var _a;
const options = config.httpAuthSchemeProvider(
await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)
);
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
const failureReasons = [];
for (const option of options) {
const scheme = authSchemes.get(option.schemeId);
if (!scheme) {
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
continue;
}
const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
if (!identityProvider) {
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
continue;
}
const { identityProperties = {}, signingProperties = {} } =
((_a = option.propertiesExtractor) == null ? void 0 : _a.call(option, config, context)) || {};
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
smithyContext.selectedHttpAuthScheme = {
httpAuthOption: option,
identity: await identityProvider(option.identityProperties),
signer: scheme.signer,
};
break;
}
if (!smithyContext.selectedHttpAuthScheme) {
throw new Error(failureReasons.join("\n"));
}
return next(args);
},
"httpAuthSchemeMiddleware"
);
var import_middleware_endpoint = require_dist_cjs18();
var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
step: "serialize",
tags: ["HTTP_AUTH_SCHEME"],
name: "httpAuthSchemeMiddleware",
override: true,
relation: "before",
toMiddleware: import_middleware_endpoint.endpointMiddlewareOptions.name,
};
var getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name(
(config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(
httpAuthSchemeMiddleware(config, {
httpAuthSchemeParametersProvider,
identityProviderConfigProvider,
}),
httpAuthSchemeEndpointRuleSetMiddlewareOptions
);
},
}),
"getHttpAuthSchemeEndpointRuleSetPlugin"
);
var import_middleware_serde = require_dist_cjs17();
var httpAuthSchemeMiddlewareOptions = {
step: "serialize",
tags: ["HTTP_AUTH_SCHEME"],
name: "httpAuthSchemeMiddleware",
override: true,
relation: "before",
toMiddleware: import_middleware_serde.serializerMiddlewareOption.name,
};
var getHttpAuthSchemePlugin = /* @__PURE__ */ __name(
(config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(
httpAuthSchemeMiddleware(config, {
httpAuthSchemeParametersProvider,
identityProviderConfigProvider,
}),
httpAuthSchemeMiddlewareOptions
);
},
}),
"getHttpAuthSchemePlugin"
);
var import_protocol_http = require_dist_cjs2();
var defaultErrorHandler = /* @__PURE__ */ __name(
(signingProperties) => (error) => {
throw error;
},
"defaultErrorHandler"
);
var defaultSuccessHandler = /* @__PURE__ */ __name(
(httpResponse, signingProperties) => {},
"defaultSuccessHandler"
);
var httpSigningMiddleware = /* @__PURE__ */ __name(
(config) => (next, context) => async (args) => {
if (!import_protocol_http.HttpRequest.isInstance(args.request)) {
return next(args);
}
const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
const scheme = smithyContext.selectedHttpAuthScheme;
if (!scheme) {
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
}
const {
httpAuthOption: { signingProperties = {} },
identity,
signer,
} = scheme;
const output = await next({
...args,
request: await signer.sign(args.request, identity, signingProperties),
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
return output;
},
"httpSigningMiddleware"
);
var import_middleware_retry = require_dist_cjs33();
var httpSigningMiddlewareOptions = {
step: "finalizeRequest",
tags: ["HTTP_SIGNING"],
name: "httpSigningMiddleware",
aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
override: true,
relation: "after",
toMiddleware: import_middleware_retry.retryMiddlewareOptions.name,
};
var getHttpSigningPlugin = /* @__PURE__ */ __name(
(config) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
},
}),
"getHttpSigningPlugin"
);
var _DefaultIdentityProviderConfig = class _DefaultIdentityProviderConfig {
constructor(config) {
this.authSchemes = /* @__PURE__ */ new Map();
for (const [key, value] of Object.entries(config)) {
if (value !== void 0) {
this.authSchemes.set(key, value);
}
}
}
getIdentityProvider(schemeId) {
return this.authSchemes.get(schemeId);
}
};
__name(_DefaultIdentityProviderConfig, "DefaultIdentityProviderConfig");
var DefaultIdentityProviderConfig = _DefaultIdentityProviderConfig;
var import_types = require_dist_cjs();
var _HttpApiKeyAuthSigner = class _HttpApiKeyAuthSigner {
async sign(httpRequest, identity, signingProperties) {
if (!signingProperties) {
throw new Error(
"request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"
);
}
if (!signingProperties.name) {
throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");
}
if (!signingProperties.in) {
throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");
}
if (!identity.apiKey) {
throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
}
const clonedRequest = httpRequest.clone();
if (signingProperties.in === import_types.HttpApiKeyAuthLocation.QUERY) {
clonedRequest.query[signingProperties.name] = identity.apiKey;
} else if (signingProperties.in === import_types.HttpApiKeyAuthLocation.HEADER) {
clonedRequest.headers[signingProperties.name] = signingProperties.scheme
? `${signingProperties.scheme} ${identity.apiKey}`
: identity.apiKey;
} else {
throw new Error(
"request can only be signed with `apiKey` locations `query` or `header`, but found: `" +
signingProperties.in +
"`"
);
}
return clonedRequest;
}
};
__name(_HttpApiKeyAuthSigner, "HttpApiKeyAuthSigner");
var HttpApiKeyAuthSigner = _HttpApiKeyAuthSigner;
var _HttpBearerAuthSigner = class _HttpBearerAuthSigner {
async sign(httpRequest, identity, signingProperties) {
const clonedRequest = httpRequest.clone();
if (!identity.token) {
throw new Error("request could not be signed with `token` since the `token` is not defined");
}
clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`;
return clonedRequest;
}
};
__name(_HttpBearerAuthSigner, "HttpBearerAuthSigner");
var HttpBearerAuthSigner = _HttpBearerAuthSigner;
var _NoAuthSigner = class _NoAuthSigner {
async sign(httpRequest, identity, signingProperties) {
return httpRequest;
}
};
__name(_NoAuthSigner, "NoAuthSigner");
var NoAuthSigner = _NoAuthSigner;
var createIsIdentityExpiredFunction = /* @__PURE__ */ __name(
(expirationMs) => (identity) =>
doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs,
"createIsIdentityExpiredFunction"
);
var EXPIRATION_MS = 3e5;
var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
var doesIdentityRequireRefresh = /* @__PURE__ */ __name(
(identity) => identity.expiration !== void 0,
"doesIdentityRequireRefresh"
);
var memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => {
if (provider === void 0) {
return void 0;
}
const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
let resolved;
let pending;
let hasResult;
let isConstant = false;
const coalesceProvider = /* @__PURE__ */ __name(async (options) => {
if (!pending) {
pending = normalizedProvider(options);
}
try {
resolved = await pending;
hasResult = true;
isConstant = false;
} finally {
pending = void 0;
}
return resolved;
}, "coalesceProvider");
if (isExpired === void 0) {
return async (options) => {
if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
resolved = await coalesceProvider(options);
}
return resolved;
};
}
return async (options) => {
if (!hasResult || (options == null ? void 0 : options.forceRefresh)) {
resolved = await coalesceProvider(options);
}
if (isConstant) {
return resolved;
}
if (!requiresRefresh(resolved)) {
isConstant = true;
return resolved;
}
if (isExpired(resolved)) {
await coalesceProvider(options);
return resolved;
}
return resolved;
};
}, "memoizeIdentityProvider");
var getSmithyContext3 = /* @__PURE__ */ __name(
(context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}),
"getSmithyContext"
);
var normalizeProvider = /* @__PURE__ */ __name((input) => {
if (typeof input === "function") return input;
const promisified = Promise.resolve(input);
return () => promisified;
}, "normalizeProvider");
var import_smithy_client = require_dist_cjs32();
function requestBuilder(input, context) {
return new RequestBuilder(input, context);
}
__name(requestBuilder, "requestBuilder");
var _RequestBuilder = class _RequestBuilder {
constructor(input, context) {
this.input = input;
this.context = context;
this.query = {};
this.method = "";
this.headers = {};
this.path = "";
this.body = null;
this.hostname = "";
this.resolvePathStack = [];
}
async build() {
const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
this.path = basePath;
for (const resolvePath of this.resolvePathStack) {
resolvePath(this.path);
}
return new import_protocol_http.HttpRequest({
protocol,
hostname: this.hostname || hostname,
port,
method: this.method,
path: this.path,
query: this.query,
body: this.body,
headers: this.headers,
});
}
hn(hostname) {
this.hostname = hostname;
return this;
}
bp(uriLabel) {
this.resolvePathStack.push((basePath) => {
this.path =
`${(basePath == null ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
uriLabel;
});
return this;
}
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
this.resolvePathStack.push((path) => {
this.path = (0, import_smithy_client.resolvedPath)(
path,
this.input,
memberName,
labelValueProvider,
uriLabel,
isGreedyLabel
);
});
return this;
}
h(headers) {
this.headers = headers;
return this;
}
q(query) {
this.query = query;
return this;
}
b(body) {
this.body = body;
return this;
}
m(method) {
this.method = method;
return this;
}
};
__name(_RequestBuilder, "RequestBuilder");
var RequestBuilder = _RequestBuilder;
var makePagedClientRequest = /* @__PURE__ */ __name(async (CommandCtor, client, input, ...args) => {
return await client.send(new CommandCtor(input), ...args);
}, "makePagedClientRequest");
function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
return /* @__PURE__ */ __name(async function* paginateOperation(config, input, ...additionalArguments) {
let token = config.startingToken || void 0;
let hasNext = true;
let page;
while (hasNext) {
input[inputTokenName] = token;
if (pageSizeTokenName) {
input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize;
}
if (config.client instanceof ClientCtor) {
page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments);
} else {
throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
}
yield page;
const prevToken = token;
token = get(page, outputTokenName);
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
return void 0;
}, "paginateOperation");
}
__name(createPaginator, "createPaginator");
var get = /* @__PURE__ */ __name((fromObject, path) => {
let cursor = fromObject;
const pathComponents = path.split(".");
for (const step of pathComponents) {
if (!cursor || typeof cursor !== "object") {
return void 0;
}
cursor = cursor[step];
}
return cursor;
}, "get");
},
});
// node_modules/@smithy/middleware-content-length/dist-cjs/index.js
var require_dist_cjs35 = __commonJS({
"node_modules/@smithy/middleware-content-length/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
contentLengthMiddleware: () => contentLengthMiddleware,
contentLengthMiddlewareOptions: () => contentLengthMiddlewareOptions,
getContentLengthPlugin: () => getContentLengthPlugin,
});
module2.exports = __toCommonJS2(src_exports);
var import_protocol_http = require_dist_cjs2();
var CONTENT_LENGTH_HEADER = "content-length";
function contentLengthMiddleware(bodyLengthChecker) {
return (next) => async (args) => {
const request = args.request;
if (import_protocol_http.HttpRequest.isInstance(request)) {
const { body, headers } = request;
if (
body &&
Object.keys(headers)
.map((str) => str.toLowerCase())
.indexOf(CONTENT_LENGTH_HEADER) === -1
) {
try {
const length = bodyLengthChecker(body);
request.headers = {
...request.headers,
[CONTENT_LENGTH_HEADER]: String(length),
};
} catch (error) {}
}
}
return next({
...args,
request,
});
};
}
__name(contentLengthMiddleware, "contentLengthMiddleware");
var contentLengthMiddlewareOptions = {
step: "build",
tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
name: "contentLengthMiddleware",
override: true,
};
var getContentLengthPlugin = /* @__PURE__ */ __name(
(options) => ({
applyToStack: (clientStack) => {
clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
},
}),
"getContentLengthPlugin"
);
},
});
// node_modules/tslib/tslib.js
var require_tslib = __commonJS({
"node_modules/tslib/tslib.js"(exports, module2) {
var __extends;
var __assign;
var __rest;
var __decorate;
var __param;
var __esDecorate;
var __runInitializers;
var __propKey;
var __setFunctionName;
var __metadata;
var __awaiter;
var __generator;
var __exportStar;
var __values;
var __read;
var __spread;
var __spreadArrays;
var __spreadArray;
var __await;
var __asyncGenerator;
var __asyncDelegator;
var __asyncValues;
var __makeTemplateObject;
var __importStar;
var __importDefault;
var __classPrivateFieldGet;
var __classPrivateFieldSet;
var __classPrivateFieldIn;
var __createBinding;
var __addDisposableResource;
var __disposeResources;
(function (factory) {
var root =
typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
if (typeof define === "function" && define.amd) {
define("tslib", ["exports"], (exports2) => {
factory(createExporter(root, createExporter(exports2)));
});
} else if (typeof module2 === "object" && typeof module2.exports === "object") {
factory(createExporter(root, createExporter(module2.exports)));
} else {
factory(createExporter(root));
}
function createExporter(exports2, previous) {
if (exports2 !== root) {
if (typeof Object.create === "function") {
Object.defineProperty(exports2, "__esModule", { value: true });
} else {
exports2.__esModule = true;
}
}
return (id, v) => (exports2[id] = previous ? previous(id, v) : v);
}
})((exporter) => {
var extendStatics =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
((d, b) => {
d.__proto__ = b;
})) ||
((d, b) => {
for (var p in b) if (Object.hasOwn(b, p)) d[p] = b[p];
});
__extends = (d, b) => {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());
};
__assign =
Object.assign ||
((t) => {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.hasOwn(s, p)) t[p] = s[p];
}
return t;
});
__rest = (s, e) => {
var t = {};
for (var p in s) if (Object.hasOwn(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
__decorate = (decorators, target, key, desc) => {
var c = arguments.length,
r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc,
d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return (c > 3 && r && Object.defineProperty(target, key, r), r);
};
__param = (paramIndex, decorator) => (target, key) => {
decorator(target, key, paramIndex);
};
__esDecorate = (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) => {
function accept(f) {
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
return f;
}
var kind = contextIn.kind,
key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? (contextIn["static"] ? ctor : ctor.prototype) : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _,
done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = (f) => {
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
extraInitializers.push(accept(f || null));
};
var result = (0, decorators[i])(
kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key],
context
);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if ((_ = accept(result.get))) descriptor.get = _;
if ((_ = accept(result.set))) descriptor.set = _;
if ((_ = accept(result.init))) initializers.unshift(_);
} else if ((_ = accept(result))) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
__runInitializers = (thisArg, initializers, value) => {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
__propKey = (x) => (typeof x === "symbol" ? x : "".concat(x));
__setFunctionName = (f, name, prefix) => {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", {
configurable: true,
value: prefix ? "".concat(prefix, " ", name) : name,
});
};
__metadata = (metadataKey, metadataValue) => {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
return Reflect.metadata(metadataKey, metadataValue);
};
__awaiter = (thisArg, _arguments, P, generator) => {
function adopt(value) {
return value instanceof P
? value
: new P((resolve) => {
resolve(value);
});
}
return new (P || (P = Promise))((resolve, reject) => {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
__generator = (thisArg, body) => {
var _ = {
label: 0,
sent: () => {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: [],
},
f,
y,
t,
g;
return (
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
typeof Symbol === "function" &&
(g[Symbol.iterator] = function () {
return this;
}),
g
);
function verb(n) {
return (v) => step([n, v]);
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while ((g && ((g = 0), op[0] && (_ = 0)), _))
try {
if (
((f = 1),
y &&
(t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) &&
!(t = t.call(y, op[1])).done)
)
return t;
if (((y = 0), t)) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
__exportStar = (m, o) => {
for (var p in m) if (p !== "default" && !Object.hasOwn(o, p)) __createBinding(o, m, p);
};
__createBinding = Object.create
? (o, m, k, k2) => {
if (k2 === void 0) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = {
enumerable: true,
get: () => m[k],
};
}
Object.defineProperty(o, k2, desc);
}
: (o, m, k, k2) => {
if (k2 === void 0) k2 = k;
o[k2] = m[k];
};
__values = (o) => {
var s = typeof Symbol === "function" && Symbol.iterator,
m = s && o[s],
i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number")
return {
next: () => {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
},
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
__read = (o, n) => {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
} catch (error) {
e = { error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
__spread = () => {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
__spreadArrays = () => {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
return r;
};
__spreadArray = (to, from, pack) => {
if (pack || arguments.length === 2)
for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
__await = function (v) {
return this instanceof __await ? ((this.v = v), this) : new __await(v);
};
__asyncGenerator = (thisArg, _arguments, generator) => {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []),
i,
q = [];
return (
(i = {}),
verb("next"),
verb("throw"),
verb("return", awaitReturn),
(i[Symbol.asyncIterator] = function () {
return this;
}),
i
);
function awaitReturn(f) {
return (v) => Promise.resolve(v).then(f, reject);
}
function verb(n, f) {
if (g[n]) {
i[n] = (v) =>
new Promise((a, b) => {
q.push([n, v, a, b]) > 1 || resume(n, v);
});
if (f) i[n] = f(i[n]);
}
}
function resume(n, v) {
try {
step(g[n](v));
} catch (e) {
settle(q[0][3], e);
}
}
function step(r) {
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
}
function fulfill(value) {
resume("next", value);
}
function reject(value) {
resume("throw", value);
}
function settle(f, v) {
if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]);
}
};
__asyncDelegator = (o) => {
var i, p;
return (
(i = {}),
verb("next"),
verb("throw", (e) => {
throw e;
}),
verb("return"),
(i[Symbol.iterator] = function () {
return this;
}),
i
);
function verb(n, f) {
i[n] = o[n] ? (v) => ((p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v) : f;
}
};
__asyncValues = (o) => {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator],
i;
return m
? m.call(o)
: ((o = typeof __values === "function" ? __values(o) : o[Symbol.iterator]()),
(i = {}),
verb("next"),
verb("throw"),
verb("return"),
(i[Symbol.asyncIterator] = function () {
return this;
}),
i);
function verb(n) {
i[n] =
o[n] &&
((v) =>
new Promise((resolve, reject) => {
((v = o[n](v)), settle(resolve, reject, v.done, v.value));
}));
}
function settle(resolve, reject, d, v) {
Promise.resolve(v).then((v2) => {
resolve({ value: v2, done: d });
}, reject);
}
};
__makeTemplateObject = (cooked, raw) => {
if (Object.defineProperty) {
Object.defineProperty(cooked, "raw", { value: raw });
} else {
cooked.raw = raw;
}
return cooked;
};
var __setModuleDefault = Object.create
? (o, v) => {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}
: (o, v) => {
o["default"] = v;
};
__importStar = (mod) => {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) {
for (var k in mod) if (k !== "default" && Object.hasOwn(mod, k)) __createBinding(result, mod, k);
}
__setModuleDefault(result, mod);
return result;
};
__importDefault = (mod) => (mod && mod.__esModule ? mod : { default: mod });
__classPrivateFieldGet = (receiver, state, kind, f) => {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
__classPrivateFieldSet = (receiver, state, value, kind, f) => {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value);
};
__classPrivateFieldIn = (state, receiver) => {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
};
__addDisposableResource = (env, value, async) => {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner)
dispose = function () {
try {
inner.call(this);
} catch (e) {
return Promise.reject(e);
}
};
env.stack.push({ value, dispose, async });
} else if (async) {
env.stack.push({ async: true });
}
return value;
};
var _SuppressedError =
typeof SuppressedError === "function"
? SuppressedError
: (error, suppressed, message) => {
var e = new Error(message);
return ((e.name = "SuppressedError"), (e.error = error), (e.suppressed = suppressed), e);
};
__disposeResources = (env) => {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
function next() {
while (env.stack.length) {
var rec = env.stack.pop();
try {
var result = rec.dispose && rec.dispose.call(rec.value);
if (rec.async)
return Promise.resolve(result).then(next, (e) => {
fail(e);
return next();
});
} catch (e) {
fail(e);
}
}
if (env.hasError) throw env.error;
}
return next();
};
exporter("__extends", __extends);
exporter("__assign", __assign);
exporter("__rest", __rest);
exporter("__decorate", __decorate);
exporter("__param", __param);
exporter("__esDecorate", __esDecorate);
exporter("__runInitializers", __runInitializers);
exporter("__propKey", __propKey);
exporter("__setFunctionName", __setFunctionName);
exporter("__metadata", __metadata);
exporter("__awaiter", __awaiter);
exporter("__generator", __generator);
exporter("__exportStar", __exportStar);
exporter("__createBinding", __createBinding);
exporter("__values", __values);
exporter("__read", __read);
exporter("__spread", __spread);
exporter("__spreadArrays", __spreadArrays);
exporter("__spreadArray", __spreadArray);
exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator);
exporter("__asyncValues", __asyncValues);
exporter("__makeTemplateObject", __makeTemplateObject);
exporter("__importStar", __importStar);
exporter("__importDefault", __importDefault);
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
exporter("__addDisposableResource", __addDisposableResource);
exporter("__disposeResources", __disposeResources);
});
},
});
// node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js
var require_client = __commonJS({
"node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var client_exports = {};
__export2(client_exports, {
emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion,
});
module2.exports = __toCommonJS2(client_exports);
var warningEmitted = false;
var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => {
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
warningEmitted = true;
}
}, "emitWarningIfUnsupportedVersion");
},
});
// node_modules/@smithy/signature-v4/dist-cjs/index.js
var require_dist_cjs36 = __commonJS({
"node_modules/@smithy/signature-v4/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
SignatureV4: () => SignatureV4,
clearCredentialCache: () => clearCredentialCache,
createScope: () => createScope,
getCanonicalHeaders: () => getCanonicalHeaders,
getCanonicalQuery: () => getCanonicalQuery,
getPayloadHash: () => getPayloadHash,
getSigningKey: () => getSigningKey,
moveHeadersToQuery: () => moveHeadersToQuery,
prepareRequest: () => prepareRequest,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_middleware = require_dist_cjs10();
var import_util_utf84 = require_dist_cjs24();
var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
var AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
var EXPIRES_QUERY_PARAM = "X-Amz-Expires";
var SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
var TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
var AUTH_HEADER = "authorization";
var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();
var DATE_HEADER = "date";
var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];
var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();
var SHA256_HEADER = "x-amz-content-sha256";
var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();
var ALWAYS_UNSIGNABLE_HEADERS = {
authorization: true,
"cache-control": true,
connection: true,
expect: true,
from: true,
"keep-alive": true,
"max-forwards": true,
pragma: true,
referer: true,
te: true,
trailer: true,
"transfer-encoding": true,
upgrade: true,
"user-agent": true,
"x-amzn-trace-id": true,
};
var PROXY_HEADER_PATTERN = /^proxy-/;
var SEC_HEADER_PATTERN = /^sec-/;
var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
var MAX_CACHE_SIZE = 50;
var KEY_TYPE_IDENTIFIER = "aws4_request";
var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;
var import_util_hex_encoding = require_dist_cjs30();
var import_util_utf8 = require_dist_cjs24();
var signingKeyCache = {};
var cacheQueue = [];
var createScope = /* @__PURE__ */ __name(
(shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`,
"createScope"
);
var getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => {
const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
const cacheKey = `${shortDate}:${region}:${service}:${(0, import_util_hex_encoding.toHex)(credsHash)}:${credentials.sessionToken}`;
if (cacheKey in signingKeyCache) {
return signingKeyCache[cacheKey];
}
cacheQueue.push(cacheKey);
while (cacheQueue.length > MAX_CACHE_SIZE) {
delete signingKeyCache[cacheQueue.shift()];
}
let key = `AWS4${credentials.secretAccessKey}`;
for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {
key = await hmac(sha256Constructor, key, signable);
}
return (signingKeyCache[cacheKey] = key);
}, "getSigningKey");
var clearCredentialCache = /* @__PURE__ */ __name(() => {
cacheQueue.length = 0;
Object.keys(signingKeyCache).forEach((cacheKey) => {
delete signingKeyCache[cacheKey];
});
}, "clearCredentialCache");
var hmac = /* @__PURE__ */ __name((ctor, secret, data) => {
const hash = new ctor(secret);
hash.update((0, import_util_utf8.toUint8Array)(data));
return hash.digest();
}, "hmac");
var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => {
const canonical = {};
for (const headerName of Object.keys(headers).sort()) {
if (headers[headerName] == void 0) {
continue;
}
const canonicalHeaderName = headerName.toLowerCase();
if (
canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS ||
(unsignableHeaders == null ? void 0 : unsignableHeaders.has(canonicalHeaderName)) ||
PROXY_HEADER_PATTERN.test(canonicalHeaderName) ||
SEC_HEADER_PATTERN.test(canonicalHeaderName)
) {
if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) {
continue;
}
}
canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " ");
}
return canonical;
}, "getCanonicalHeaders");
var import_util_uri_escape = require_dist_cjs26();
var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => {
const keys = [];
const serialized = {};
for (const key of Object.keys(query).sort()) {
if (key.toLowerCase() === SIGNATURE_HEADER) {
continue;
}
keys.push(key);
const value = query[key];
if (typeof value === "string") {
serialized[key] =
`${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value)}`;
} else if (Array.isArray(value)) {
serialized[key] = value
.slice(0)
.reduce(
(encoded, value2) =>
encoded.concat([
`${(0, import_util_uri_escape.escapeUri)(key)}=${(0, import_util_uri_escape.escapeUri)(value2)}`,
]),
[]
)
.sort()
.join("&");
}
}
return keys
.map((key) => serialized[key])
.filter((serialized2) => serialized2)
.join("&");
}, "getCanonicalQuery");
var import_is_array_buffer = require_dist_cjs22();
var import_util_utf82 = require_dist_cjs24();
var getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => {
for (const headerName of Object.keys(headers)) {
if (headerName.toLowerCase() === SHA256_HEADER) {
return headers[headerName];
}
}
if (body == void 0) {
return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
} else if (
typeof body === "string" ||
ArrayBuffer.isView(body) ||
(0, import_is_array_buffer.isArrayBuffer)(body)
) {
const hashCtor = new hashConstructor();
hashCtor.update((0, import_util_utf82.toUint8Array)(body));
return (0, import_util_hex_encoding.toHex)(await hashCtor.digest());
}
return UNSIGNED_PAYLOAD;
}, "getPayloadHash");
var import_util_utf83 = require_dist_cjs24();
var _HeaderFormatter = class _HeaderFormatter {
format(headers) {
const chunks = [];
for (const headerName of Object.keys(headers)) {
const bytes = (0, import_util_utf83.fromUtf8)(headerName);
chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
}
const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
let position = 0;
for (const chunk of chunks) {
out.set(chunk, position);
position += chunk.byteLength;
}
return out;
}
formatHeaderValue(header) {
switch (header.type) {
case "boolean":
return Uint8Array.from([header.value ? 0 : 1]);
case "byte":
return Uint8Array.from([2, header.value]);
case "short": {
const shortView = new DataView(new ArrayBuffer(3));
shortView.setUint8(0, 3);
shortView.setInt16(1, header.value, false);
return new Uint8Array(shortView.buffer);
}
case "integer": {
const intView = new DataView(new ArrayBuffer(5));
intView.setUint8(0, 4);
intView.setInt32(1, header.value, false);
return new Uint8Array(intView.buffer);
}
case "long": {
const longBytes = new Uint8Array(9);
longBytes[0] = 5;
longBytes.set(header.value.bytes, 1);
return longBytes;
}
case "binary": {
const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
binView.setUint8(0, 6);
binView.setUint16(1, header.value.byteLength, false);
const binBytes = new Uint8Array(binView.buffer);
binBytes.set(header.value, 3);
return binBytes;
}
case "string": {
const utf8Bytes = (0, import_util_utf83.fromUtf8)(header.value);
const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
strView.setUint8(0, 7);
strView.setUint16(1, utf8Bytes.byteLength, false);
const strBytes = new Uint8Array(strView.buffer);
strBytes.set(utf8Bytes, 3);
return strBytes;
}
case "timestamp": {
const tsBytes = new Uint8Array(9);
tsBytes[0] = 8;
tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
return tsBytes;
}
case "uuid": {
if (!UUID_PATTERN.test(header.value)) {
throw new Error(`Invalid UUID received: ${header.value}`);
}
const uuidBytes = new Uint8Array(17);
uuidBytes[0] = 9;
uuidBytes.set((0, import_util_hex_encoding.fromHex)(header.value.replace(/-/g, "")), 1);
return uuidBytes;
}
}
}
};
__name(_HeaderFormatter, "HeaderFormatter");
var HeaderFormatter = _HeaderFormatter;
var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
var _Int64 = class _Int642 {
constructor(bytes) {
this.bytes = bytes;
if (bytes.byteLength !== 8) {
throw new Error("Int64 buffers must be exactly 8 bytes");
}
}
static fromNumber(number) {
if (number > 9223372036854776e3 || number < -9223372036854776e3) {
throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
}
const bytes = new Uint8Array(8);
for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {
bytes[i] = remaining;
}
if (number < 0) {
negate(bytes);
}
return new _Int642(bytes);
}
valueOf() {
const bytes = this.bytes.slice(0);
const negative = bytes[0] & 128;
if (negative) {
negate(bytes);
}
return parseInt((0, import_util_hex_encoding.toHex)(bytes), 16) * (negative ? -1 : 1);
}
toString() {
return String(this.valueOf());
}
};
__name(_Int64, "Int64");
var Int64 = _Int64;
function negate(bytes) {
for (let i = 0; i < 8; i++) {
bytes[i] ^= 255;
}
for (let i = 7; i > -1; i--) {
bytes[i]++;
if (bytes[i] !== 0) break;
}
}
__name(negate, "negate");
var hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => {
soughtHeader = soughtHeader.toLowerCase();
for (const headerName of Object.keys(headers)) {
if (soughtHeader === headerName.toLowerCase()) {
return true;
}
}
return false;
}, "hasHeader");
var cloneRequest = /* @__PURE__ */ __name(
({ headers, query, ...rest }) => ({
...rest,
headers: { ...headers },
query: query ? cloneQuery(query) : void 0,
}),
"cloneRequest"
);
var cloneQuery = /* @__PURE__ */ __name(
(query) =>
Object.keys(query).reduce((carry, paramName) => {
const param = query[paramName];
return {
...carry,
[paramName]: Array.isArray(param) ? [...param] : param,
};
}, {}),
"cloneQuery"
);
var moveHeadersToQuery = /* @__PURE__ */ __name((request, options = {}) => {
var _a;
const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : cloneRequest(request);
for (const name of Object.keys(headers)) {
const lname = name.toLowerCase();
if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) == null ? void 0 : _a.has(lname))) {
query[name] = headers[name];
delete headers[name];
}
}
return {
...request,
headers,
query,
};
}, "moveHeadersToQuery");
var prepareRequest = /* @__PURE__ */ __name((request) => {
request = typeof request.clone === "function" ? request.clone() : cloneRequest(request);
for (const headerName of Object.keys(request.headers)) {
if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
delete request.headers[headerName];
}
}
return request;
}, "prepareRequest");
var iso8601 = /* @__PURE__ */ __name(
(time) =>
toDate(time)
.toISOString()
.replace(/\.\d{3}Z$/, "Z"),
"iso8601"
);
var toDate = /* @__PURE__ */ __name((time) => {
if (typeof time === "number") {
return new Date(time * 1e3);
}
if (typeof time === "string") {
if (Number(time)) {
return new Date(Number(time) * 1e3);
}
return new Date(time);
}
return time;
}, "toDate");
var _SignatureV4 = class _SignatureV4 {
constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
this.headerFormatter = new HeaderFormatter();
this.service = service;
this.sha256 = sha256;
this.uriEscapePath = uriEscapePath;
this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true;
this.regionProvider = (0, import_util_middleware.normalizeProvider)(region);
this.credentialProvider = (0, import_util_middleware.normalizeProvider)(credentials);
}
async presign(originalRequest, options = {}) {
const {
signingDate = /* @__PURE__ */ new Date(),
expiresIn = 3600,
unsignableHeaders,
unhoistableHeaders,
signableHeaders,
signingRegion,
signingService,
} = options;
const credentials = await this.credentialProvider();
this.validateResolvedCredentials(credentials);
const region = signingRegion ?? (await this.regionProvider());
const { longDate, shortDate } = formatDate(signingDate);
if (expiresIn > MAX_PRESIGNED_TTL) {
return Promise.reject(
"Signature version 4 presigned URLs must have an expiration date less than one week in the future"
);
}
const scope = createScope(shortDate, region, signingService ?? this.service);
const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders });
if (credentials.sessionToken) {
request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;
}
request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;
request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;
request.query[AMZ_DATE_QUERY_PARAM] = longDate;
request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);
const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders);
request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(
longDate,
scope,
this.getSigningKey(credentials, region, shortDate, signingService),
this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))
);
return request;
}
async sign(toSign, options) {
if (typeof toSign === "string") {
return this.signString(toSign, options);
} else if (toSign.headers && toSign.payload) {
return this.signEvent(toSign, options);
} else if (toSign.message) {
return this.signMessage(toSign, options);
} else {
return this.signRequest(toSign, options);
}
}
async signEvent(
{ headers, payload },
{ signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }
) {
const region = signingRegion ?? (await this.regionProvider());
const { shortDate, longDate } = formatDate(signingDate);
const scope = createScope(shortDate, region, signingService ?? this.service);
const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256);
const hash = new this.sha256();
hash.update(headers);
const hashedHeaders = (0, import_util_hex_encoding.toHex)(await hash.digest());
const stringToSign = [
EVENT_ALGORITHM_IDENTIFIER,
longDate,
scope,
priorSignature,
hashedHeaders,
hashedPayload,
].join("\n");
return this.signString(stringToSign, {
signingDate,
signingRegion: region,
signingService,
});
}
async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) {
const promise = this.signEvent(
{
headers: this.headerFormatter.format(signableMessage.message.headers),
payload: signableMessage.message.body,
},
{
signingDate,
signingRegion,
signingService,
priorSignature: signableMessage.priorSignature,
}
);
return promise.then((signature) => {
return { message: signableMessage.message, signature };
});
}
async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) {
const credentials = await this.credentialProvider();
this.validateResolvedCredentials(credentials);
const region = signingRegion ?? (await this.regionProvider());
const { shortDate } = formatDate(signingDate);
const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
hash.update((0, import_util_utf84.toUint8Array)(stringToSign));
return (0, import_util_hex_encoding.toHex)(await hash.digest());
}
async signRequest(
requestToSign,
{
signingDate = /* @__PURE__ */ new Date(),
signableHeaders,
unsignableHeaders,
signingRegion,
signingService,
} = {}
) {
const credentials = await this.credentialProvider();
this.validateResolvedCredentials(credentials);
const region = signingRegion ?? (await this.regionProvider());
const request = prepareRequest(requestToSign);
const { longDate, shortDate } = formatDate(signingDate);
const scope = createScope(shortDate, region, signingService ?? this.service);
request.headers[AMZ_DATE_HEADER] = longDate;
if (credentials.sessionToken) {
request.headers[TOKEN_HEADER] = credentials.sessionToken;
}
const payloadHash = await getPayloadHash(request, this.sha256);
if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {
request.headers[SHA256_HEADER] = payloadHash;
}
const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
const signature = await this.getSignature(
longDate,
scope,
this.getSigningKey(credentials, region, shortDate, signingService),
this.createCanonicalRequest(request, canonicalHeaders, payloadHash)
);
request.headers[AUTH_HEADER] =
`${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`;
return request;
}
createCanonicalRequest(request, canonicalHeaders, payloadHash) {
const sortedHeaders = Object.keys(canonicalHeaders).sort();
return `${request.method}
${this.getCanonicalPath(request)}
${getCanonicalQuery(request)}
${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")}
${sortedHeaders.join(";")}
${payloadHash}`;
}
async createStringToSign(longDate, credentialScope, canonicalRequest) {
const hash = new this.sha256();
hash.update((0, import_util_utf84.toUint8Array)(canonicalRequest));
const hashedRequest = await hash.digest();
return `${ALGORITHM_IDENTIFIER}
${longDate}
${credentialScope}
${(0, import_util_hex_encoding.toHex)(hashedRequest)}`;
}
getCanonicalPath({ path }) {
if (this.uriEscapePath) {
const normalizedPathSegments = [];
for (const pathSegment of path.split("/")) {
if ((pathSegment == null ? void 0 : pathSegment.length) === 0) continue;
if (pathSegment === ".") continue;
if (pathSegment === "..") {
normalizedPathSegments.pop();
} else {
normalizedPathSegments.push(pathSegment);
}
}
const normalizedPath = `${(path == null ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path == null ? void 0 : path.endsWith("/")) ? "/" : ""}`;
const doubleEncoded = (0, import_util_uri_escape.escapeUri)(normalizedPath);
return doubleEncoded.replace(/%2F/g, "/");
}
return path;
}
async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest);
const hash = new this.sha256(await keyPromise);
hash.update((0, import_util_utf84.toUint8Array)(stringToSign));
return (0, import_util_hex_encoding.toHex)(await hash.digest());
}
getSigningKey(credentials, region, shortDate, service) {
return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);
}
validateResolvedCredentials(credentials) {
if (
typeof credentials !== "object" ||
typeof credentials.accessKeyId !== "string" ||
typeof credentials.secretAccessKey !== "string"
) {
throw new Error("Resolved credential object is not valid");
}
}
};
__name(_SignatureV4, "SignatureV4");
var SignatureV4 = _SignatureV4;
var formatDate = /* @__PURE__ */ __name((now) => {
const longDate = iso8601(now).replace(/[-:]/g, "");
return {
longDate,
shortDate: longDate.slice(0, 8),
};
}, "formatDate");
var getCanonicalHeaderList = /* @__PURE__ */ __name(
(headers) => Object.keys(headers).sort().join(";"),
"getCanonicalHeaderList"
);
},
});
// node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js
var require_httpAuthSchemes = __commonJS({
"node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var httpAuthSchemes_exports = {};
__export2(httpAuthSchemes_exports, {
AWSSDKSigV4Signer: () => AWSSDKSigV4Signer,
AwsSdkSigV4Signer: () => AwsSdkSigV4Signer,
resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config,
resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config,
});
module2.exports = __toCommonJS2(httpAuthSchemes_exports);
var import_protocol_http2 = require_dist_cjs2();
var import_protocol_http = require_dist_cjs2();
var getDateHeader = /* @__PURE__ */ __name((response) => {
var _a, _b;
return import_protocol_http.HttpResponse.isInstance(response)
? (((_a = response.headers) == null ? void 0 : _a.date) ?? ((_b = response.headers) == null ? void 0 : _b.Date))
: void 0;
}, "getDateHeader");
var getSkewCorrectedDate = /* @__PURE__ */ __name(
(systemClockOffset) => new Date(Date.now() + systemClockOffset),
"getSkewCorrectedDate"
);
var isClockSkewed = /* @__PURE__ */ __name(
(clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5,
"isClockSkewed"
);
var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => {
const clockTimeInMs = Date.parse(clockTime);
if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
return clockTimeInMs - Date.now();
}
return currentSystemClockOffset;
}, "getUpdatedSystemClockOffset");
var throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => {
if (!property) {
throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
}
return property;
}, "throwSigningPropertyError");
var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => {
var _a, _b, _c;
const context = throwSigningPropertyError("context", signingProperties.context);
const config = throwSigningPropertyError("config", signingProperties.config);
const authScheme =
(_c = (_b = (_a = context.endpointV2) == null ? void 0 : _a.properties) == null ? void 0 : _b.authSchemes) ==
null
? void 0
: _c[0];
const signerFunction = throwSigningPropertyError("signer", config.signer);
const signer = await signerFunction(authScheme);
const signingRegion = signingProperties == null ? void 0 : signingProperties.signingRegion;
const signingName = signingProperties == null ? void 0 : signingProperties.signingName;
return {
config,
signer,
signingRegion,
signingName,
};
}, "validateSigningProperties");
var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
async sign(httpRequest, identity, signingProperties) {
if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) {
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
}
const { config, signer, signingRegion, signingName } = await validateSigningProperties(signingProperties);
const signedRequest = await signer.sign(httpRequest, {
signingDate: getSkewCorrectedDate(config.systemClockOffset),
signingRegion,
signingService: signingName,
});
return signedRequest;
}
errorHandler(signingProperties) {
return (error) => {
const serverTime = error.ServerTime ?? getDateHeader(error.$response);
if (serverTime) {
const config = throwSigningPropertyError("config", signingProperties.config);
const initialSystemClockOffset = config.systemClockOffset;
config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
if (clockSkewCorrected && error.$metadata) {
error.$metadata.clockSkewCorrected = true;
}
}
throw error;
};
}
successHandler(httpResponse, signingProperties) {
const dateHeader = getDateHeader(httpResponse);
if (dateHeader) {
const config = throwSigningPropertyError("config", signingProperties.config);
config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
}
}
};
__name(_AwsSdkSigV4Signer, "AwsSdkSigV4Signer");
var AwsSdkSigV4Signer = _AwsSdkSigV4Signer;
var AWSSDKSigV4Signer = AwsSdkSigV4Signer;
var import_core = require_dist_cjs34();
var import_signature_v4 = require_dist_cjs36();
var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
let normalizedCreds;
if (config.credentials) {
normalizedCreds = (0, import_core.memoizeIdentityProvider)(
config.credentials,
import_core.isIdentityExpired,
import_core.doesIdentityRequireRefresh
);
}
if (!normalizedCreds) {
if (config.credentialDefaultProvider) {
normalizedCreds = (0, import_core.normalizeProvider)(
config.credentialDefaultProvider(
Object.assign({}, config, {
parentClientConfig: config,
})
)
);
} else {
normalizedCreds = /* @__PURE__ */ __name(async () => {
throw new Error("`credentials` is missing");
}, "normalizedCreds");
}
}
const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config;
let signer;
if (config.signer) {
signer = (0, import_core.normalizeProvider)(config.signer);
} else if (config.regionInfoProvider) {
signer = /* @__PURE__ */ __name(
() =>
(0, import_core.normalizeProvider)(config.region)()
.then(async (region) => [
(await config.regionInfoProvider(region, {
useFipsEndpoint: await config.useFipsEndpoint(),
useDualstackEndpoint: await config.useDualstackEndpoint(),
})) || {},
region,
])
.then(([regionInfo, region]) => {
const { signingRegion, signingService } = regionInfo;
config.signingRegion = config.signingRegion || signingRegion || region;
config.signingName = config.signingName || signingService || config.serviceId;
const params = {
...config,
credentials: normalizedCreds,
region: config.signingRegion,
service: config.signingName,
sha256,
uriEscapePath: signingEscapePath,
};
const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
return new SignerCtor(params);
}),
"signer"
);
} else {
signer = /* @__PURE__ */ __name(async (authScheme) => {
authScheme = Object.assign(
{},
{
name: "sigv4",
signingName: config.signingName || config.defaultSigningName,
signingRegion: await (0, import_core.normalizeProvider)(config.region)(),
properties: {},
},
authScheme
);
const signingRegion = authScheme.signingRegion;
const signingService = authScheme.signingName;
config.signingRegion = config.signingRegion || signingRegion;
config.signingName = config.signingName || signingService || config.serviceId;
const params = {
...config,
credentials: normalizedCreds,
region: config.signingRegion,
service: config.signingName,
sha256,
uriEscapePath: signingEscapePath,
};
const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4;
return new SignerCtor(params);
}, "signer");
}
return {
...config,
systemClockOffset,
signingEscapePath,
credentials: normalizedCreds,
signer,
};
}, "resolveAwsSdkSigV4Config");
var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
},
});
// node_modules/fast-xml-parser/src/util.js
var require_util = __commonJS({
"node_modules/fast-xml-parser/src/util.js"(exports) {
var nameStartChar =
":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*";
var regexName = new RegExp("^" + nameRegexp + "$");
var getAllMatches = (string, regex) => {
const matches = [];
let match = regex.exec(string);
while (match) {
const allmatches = [];
allmatches.startIndex = regex.lastIndex - match[0].length;
const len = match.length;
for (let index = 0; index < len; index++) {
allmatches.push(match[index]);
}
matches.push(allmatches);
match = regex.exec(string);
}
return matches;
};
var isName = (string) => {
const match = regexName.exec(string);
return !(match === null || typeof match === "undefined");
};
exports.isExist = (v) => typeof v !== "undefined";
exports.isEmptyObject = (obj) => Object.keys(obj).length === 0;
exports.merge = (target, a, arrayMode) => {
if (a) {
const keys = Object.keys(a);
const len = keys.length;
for (let i = 0; i < len; i++) {
if (arrayMode === "strict") {
target[keys[i]] = [a[keys[i]]];
} else {
target[keys[i]] = a[keys[i]];
}
}
}
};
exports.getValue = (v) => {
if (exports.isExist(v)) {
return v;
} else {
return "";
}
};
exports.isName = isName;
exports.getAllMatches = getAllMatches;
exports.nameRegexp = nameRegexp;
},
});
// node_modules/fast-xml-parser/src/validator.js
var require_validator = __commonJS({
"node_modules/fast-xml-parser/src/validator.js"(exports) {
var util = require_util();
var defaultOptions = {
allowBooleanAttributes: false,
unpairedTags: [],
};
exports.validate = (xmlData, options) => {
options = Object.assign({}, defaultOptions, options);
const tags = [];
let tagFound = false;
let reachedRoot = false;
if (xmlData[0] === "\uFEFF") {
xmlData = xmlData.substr(1);
}
for (let i = 0; i < xmlData.length; i++) {
if (xmlData[i] === "<" && xmlData[i + 1] === "?") {
i += 2;
i = readPI(xmlData, i);
if (i.err) return i;
} else if (xmlData[i] === "<") {
const tagStartPos = i;
i++;
if (xmlData[i] === "!") {
i = readCommentAndCDATA(xmlData, i);
} else {
let closingTag = false;
if (xmlData[i] === "/") {
closingTag = true;
i++;
}
let tagName = "";
for (
;
i < xmlData.length &&
xmlData[i] !== ">" &&
xmlData[i] !== " " &&
xmlData[i] !== " " &&
xmlData[i] !== "\n" &&
xmlData[i] !== "\r";
i++
) {
tagName += xmlData[i];
}
tagName = tagName.trim();
if (tagName[tagName.length - 1] === "/") {
tagName = tagName.substring(0, tagName.length - 1);
i--;
}
if (!validateTagName(tagName)) {
let msg;
if (tagName.trim().length === 0) {
msg = "Invalid space after '<'.";
} else {
msg = "Tag '" + tagName + "' is an invalid name.";
}
return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i));
}
const result = readAttributeStr(xmlData, i);
if (result === false) {
return getErrorObject(
"InvalidAttr",
"Attributes for '" + tagName + "' have open quote.",
getLineNumberForPosition(xmlData, i)
);
}
let attrStr = result.value;
i = result.index;
if (attrStr[attrStr.length - 1] === "/") {
const attrStrStart = i - attrStr.length;
attrStr = attrStr.substring(0, attrStr.length - 1);
const isValid = validateAttributeString(attrStr, options);
if (isValid === true) {
tagFound = true;
} else {
return getErrorObject(
isValid.err.code,
isValid.err.msg,
getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)
);
}
} else if (closingTag) {
if (!result.tagClosed) {
return getErrorObject(
"InvalidTag",
"Closing tag '" + tagName + "' doesn't have proper closing.",
getLineNumberForPosition(xmlData, i)
);
} else if (attrStr.trim().length > 0) {
return getErrorObject(
"InvalidTag",
"Closing tag '" + tagName + "' can't have attributes or invalid starting.",
getLineNumberForPosition(xmlData, tagStartPos)
);
} else {
const otg = tags.pop();
if (tagName !== otg.tagName) {
const openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);
return getErrorObject(
"InvalidTag",
"Expected closing tag '" +
otg.tagName +
"' (opened in line " +
openPos.line +
", col " +
openPos.col +
") instead of closing tag '" +
tagName +
"'.",
getLineNumberForPosition(xmlData, tagStartPos)
);
}
if (tags.length == 0) {
reachedRoot = true;
}
}
} else {
const isValid = validateAttributeString(attrStr, options);
if (isValid !== true) {
return getErrorObject(
isValid.err.code,
isValid.err.msg,
getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)
);
}
if (reachedRoot === true) {
return getErrorObject(
"InvalidXml",
"Multiple possible root nodes found.",
getLineNumberForPosition(xmlData, i)
);
} else if (options.unpairedTags.indexOf(tagName) !== -1) {
} else {
tags.push({ tagName, tagStartPos });
}
tagFound = true;
}
for (i++; i < xmlData.length; i++) {
if (xmlData[i] === "<") {
if (xmlData[i + 1] === "!") {
i++;
i = readCommentAndCDATA(xmlData, i);
} else if (xmlData[i + 1] === "?") {
i = readPI(xmlData, ++i);
if (i.err) return i;
} else {
break;
}
} else if (xmlData[i] === "&") {
const afterAmp = validateAmpersand(xmlData, i);
if (afterAmp == -1)
return getErrorObject(
"InvalidChar",
"char '&' is not expected.",
getLineNumberForPosition(xmlData, i)
);
i = afterAmp;
} else {
if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {
return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i));
}
}
}
if (xmlData[i] === "<") {
i--;
}
}
} else {
if (isWhiteSpace(xmlData[i])) {
continue;
}
return getErrorObject(
"InvalidChar",
"char '" + xmlData[i] + "' is not expected.",
getLineNumberForPosition(xmlData, i)
);
}
}
if (!tagFound) {
return getErrorObject("InvalidXml", "Start tag expected.", 1);
} else if (tags.length == 1) {
return getErrorObject(
"InvalidTag",
"Unclosed tag '" + tags[0].tagName + "'.",
getLineNumberForPosition(xmlData, tags[0].tagStartPos)
);
} else if (tags.length > 0) {
return getErrorObject(
"InvalidXml",
"Invalid '" +
JSON.stringify(
tags.map((t) => t.tagName),
null,
4
).replace(/\r?\n/g, "") +
"' found.",
{ line: 1, col: 1 }
);
}
return true;
};
function isWhiteSpace(char) {
return char === " " || char === " " || char === "\n" || char === "\r";
}
function readPI(xmlData, i) {
const start = i;
for (; i < xmlData.length; i++) {
if (xmlData[i] == "?" || xmlData[i] == " ") {
const tagname = xmlData.substr(start, i - start);
if (i > 5 && tagname === "xml") {
return getErrorObject(
"InvalidXml",
"XML declaration allowed only at the start of the document.",
getLineNumberForPosition(xmlData, i)
);
} else if (xmlData[i] == "?" && xmlData[i + 1] == ">") {
i++;
break;
} else {
}
}
}
return i;
}
function readCommentAndCDATA(xmlData, i) {
if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") {
for (i += 3; i < xmlData.length; i++) {
if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") {
i += 2;
break;
}
}
} else if (
xmlData.length > i + 8 &&
xmlData[i + 1] === "D" &&
xmlData[i + 2] === "O" &&
xmlData[i + 3] === "C" &&
xmlData[i + 4] === "T" &&
xmlData[i + 5] === "Y" &&
xmlData[i + 6] === "P" &&
xmlData[i + 7] === "E"
) {
let angleBracketsCount = 1;
for (i += 8; i < xmlData.length; i++) {
if (xmlData[i] === "<") {
angleBracketsCount++;
} else if (xmlData[i] === ">") {
angleBracketsCount--;
if (angleBracketsCount === 0) {
break;
}
}
}
} else if (
xmlData.length > i + 9 &&
xmlData[i + 1] === "[" &&
xmlData[i + 2] === "C" &&
xmlData[i + 3] === "D" &&
xmlData[i + 4] === "A" &&
xmlData[i + 5] === "T" &&
xmlData[i + 6] === "A" &&
xmlData[i + 7] === "["
) {
for (i += 8; i < xmlData.length; i++) {
if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") {
i += 2;
break;
}
}
}
return i;
}
var doubleQuote = '"';
var singleQuote = "'";
function readAttributeStr(xmlData, i) {
let attrStr = "";
let startChar = "";
let tagClosed = false;
for (; i < xmlData.length; i++) {
if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {
if (startChar === "") {
startChar = xmlData[i];
} else if (startChar !== xmlData[i]) {
} else {
startChar = "";
}
} else if (xmlData[i] === ">") {
if (startChar === "") {
tagClosed = true;
break;
}
}
attrStr += xmlData[i];
}
if (startChar !== "") {
return false;
}
return {
value: attrStr,
index: i,
tagClosed,
};
}
var validAttrStrRegxp = /(\s*)([^\s=]+)(\s*=)?(\s*(['"])(([\s\S])*?)\5)?/g;
function validateAttributeString(attrStr, options) {
const matches = util.getAllMatches(attrStr, validAttrStrRegxp);
const attrNames = {};
for (let i = 0; i < matches.length; i++) {
if (matches[i][1].length === 0) {
return getErrorObject(
"InvalidAttr",
"Attribute '" + matches[i][2] + "' has no space in starting.",
getPositionFromMatch(matches[i])
);
} else if (matches[i][3] !== void 0 && matches[i][4] === void 0) {
return getErrorObject(
"InvalidAttr",
"Attribute '" + matches[i][2] + "' is without value.",
getPositionFromMatch(matches[i])
);
} else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) {
return getErrorObject(
"InvalidAttr",
"boolean attribute '" + matches[i][2] + "' is not allowed.",
getPositionFromMatch(matches[i])
);
}
const attrName = matches[i][2];
if (!validateAttrName(attrName)) {
return getErrorObject(
"InvalidAttr",
"Attribute '" + attrName + "' is an invalid name.",
getPositionFromMatch(matches[i])
);
}
if (!Object.hasOwn(attrNames, attrName)) {
attrNames[attrName] = 1;
} else {
return getErrorObject(
"InvalidAttr",
"Attribute '" + attrName + "' is repeated.",
getPositionFromMatch(matches[i])
);
}
}
return true;
}
function validateNumberAmpersand(xmlData, i) {
let re = /\d/;
if (xmlData[i] === "x") {
i++;
re = /[\da-fA-F]/;
}
for (; i < xmlData.length; i++) {
if (xmlData[i] === ";") return i;
if (!xmlData[i].match(re)) break;
}
return -1;
}
function validateAmpersand(xmlData, i) {
i++;
if (xmlData[i] === ";") return -1;
if (xmlData[i] === "#") {
i++;
return validateNumberAmpersand(xmlData, i);
}
let count = 0;
for (; i < xmlData.length; i++, count++) {
if (xmlData[i].match(/\w/) && count < 20) continue;
if (xmlData[i] === ";") break;
return -1;
}
return i;
}
function getErrorObject(code, message, lineNumber) {
return {
err: {
code,
msg: message,
line: lineNumber.line || lineNumber,
col: lineNumber.col,
},
};
}
function validateAttrName(attrName) {
return util.isName(attrName);
}
function validateTagName(tagname) {
return util.isName(tagname);
}
function getLineNumberForPosition(xmlData, index) {
const lines = xmlData.substring(0, index).split(/\r?\n/);
return {
line: lines.length,
col: lines[lines.length - 1].length + 1,
};
}
function getPositionFromMatch(match) {
return match.startIndex + match[1].length;
}
},
});
// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
var require_OptionsBuilder = __commonJS({
"node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports) {
var defaultOptions = {
preserveOrder: false,
attributeNamePrefix: "@_",
attributesGroupName: false,
textNodeName: "#text",
ignoreAttributes: true,
removeNSPrefix: false,
allowBooleanAttributes: false,
parseTagValue: true,
parseAttributeValue: false,
trimValues: true,
cdataPropName: false,
numberParseOptions: {
hex: true,
leadingZeros: true,
eNotation: true,
},
tagValueProcessor: (tagName, val2) => val2,
attributeValueProcessor: (attrName, val2) => val2,
stopNodes: [],
alwaysCreateTextNode: false,
isArray: () => false,
commentPropName: false,
unpairedTags: [],
processEntities: true,
htmlEntities: false,
ignoreDeclaration: false,
ignorePiTags: false,
transformTagName: false,
transformAttributeName: false,
updateTag: (tagName, jPath, attrs) => tagName,
};
var buildOptions = (options) => Object.assign({}, defaultOptions, options);
exports.buildOptions = buildOptions;
exports.defaultOptions = defaultOptions;
},
});
// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
var require_xmlNode = __commonJS({
"node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports, module2) {
var XmlNode = class {
constructor(tagname) {
this.tagname = tagname;
this.child = [];
this[":@"] = {};
}
add(key, val2) {
if (key === "__proto__") key = "#__proto__";
this.child.push({ [key]: val2 });
}
addChild(node) {
if (node.tagname === "__proto__") node.tagname = "#__proto__";
if (node[":@"] && Object.keys(node[":@"]).length > 0) {
this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] });
} else {
this.child.push({ [node.tagname]: node.child });
}
}
};
module2.exports = XmlNode;
},
});
// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
var require_DocTypeReader = __commonJS({
"node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports, module2) {
var util = require_util();
function readDocType(xmlData, i) {
const entities = {};
if (
xmlData[i + 3] === "O" &&
xmlData[i + 4] === "C" &&
xmlData[i + 5] === "T" &&
xmlData[i + 6] === "Y" &&
xmlData[i + 7] === "P" &&
xmlData[i + 8] === "E"
) {
i = i + 9;
let angleBracketsCount = 1;
let hasBody = false,
comment = false;
let exp = "";
for (; i < xmlData.length; i++) {
if (xmlData[i] === "<" && !comment) {
if (hasBody && isEntity(xmlData, i)) {
i += 7;
[entityName, val, i] = readEntityExp(xmlData, i + 1);
if (val.indexOf("&") === -1)
entities[validateEntityName(entityName)] = {
regx: RegExp(`&${entityName};`, "g"),
val,
};
} else if (hasBody && isElement(xmlData, i)) i += 8;
else if (hasBody && isAttlist(xmlData, i)) i += 8;
else if (hasBody && isNotation(xmlData, i)) i += 9;
else if (isComment) comment = true;
else throw new Error("Invalid DOCTYPE");
angleBracketsCount++;
exp = "";
} else if (xmlData[i] === ">") {
if (comment) {
if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") {
comment = false;
angleBracketsCount--;
}
} else {
angleBracketsCount--;
}
if (angleBracketsCount === 0) {
break;
}
} else if (xmlData[i] === "[") {
hasBody = true;
} else {
exp += xmlData[i];
}
}
if (angleBracketsCount !== 0) {
throw new Error(`Unclosed DOCTYPE`);
}
} else {
throw new Error(`Invalid Tag instead of DOCTYPE`);
}
return { entities, i };
}
function readEntityExp(xmlData, i) {
let entityName2 = "";
for (; i < xmlData.length && xmlData[i] !== "'" && xmlData[i] !== '"'; i++) {
entityName2 += xmlData[i];
}
entityName2 = entityName2.trim();
if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported");
const startChar = xmlData[i++];
let val2 = "";
for (; i < xmlData.length && xmlData[i] !== startChar; i++) {
val2 += xmlData[i];
}
return [entityName2, val2, i];
}
function isComment(xmlData, i) {
if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true;
return false;
}
function isEntity(xmlData, i) {
if (
xmlData[i + 1] === "!" &&
xmlData[i + 2] === "E" &&
xmlData[i + 3] === "N" &&
xmlData[i + 4] === "T" &&
xmlData[i + 5] === "I" &&
xmlData[i + 6] === "T" &&
xmlData[i + 7] === "Y"
)
return true;
return false;
}
function isElement(xmlData, i) {
if (
xmlData[i + 1] === "!" &&
xmlData[i + 2] === "E" &&
xmlData[i + 3] === "L" &&
xmlData[i + 4] === "E" &&
xmlData[i + 5] === "M" &&
xmlData[i + 6] === "E" &&
xmlData[i + 7] === "N" &&
xmlData[i + 8] === "T"
)
return true;
return false;
}
function isAttlist(xmlData, i) {
if (
xmlData[i + 1] === "!" &&
xmlData[i + 2] === "A" &&
xmlData[i + 3] === "T" &&
xmlData[i + 4] === "T" &&
xmlData[i + 5] === "L" &&
xmlData[i + 6] === "I" &&
xmlData[i + 7] === "S" &&
xmlData[i + 8] === "T"
)
return true;
return false;
}
function isNotation(xmlData, i) {
if (
xmlData[i + 1] === "!" &&
xmlData[i + 2] === "N" &&
xmlData[i + 3] === "O" &&
xmlData[i + 4] === "T" &&
xmlData[i + 5] === "A" &&
xmlData[i + 6] === "T" &&
xmlData[i + 7] === "I" &&
xmlData[i + 8] === "O" &&
xmlData[i + 9] === "N"
)
return true;
return false;
}
function validateEntityName(name) {
if (util.isName(name)) return name;
else throw new Error(`Invalid entity name ${name}`);
}
module2.exports = readDocType;
},
});
// node_modules/strnum/strnum.js
var require_strnum = __commonJS({
"node_modules/strnum/strnum.js"(exports, module2) {
var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
var numRegex = /^([-+])?(0*)(\.[0-9]+([eE]-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]-?[0-9]+)?)?)$/;
if (!Number.parseInt && window.parseInt) {
Number.parseInt = window.parseInt;
}
if (!Number.parseFloat && window.parseFloat) {
Number.parseFloat = window.parseFloat;
}
var consider = {
hex: true,
leadingZeros: true,
decimalPoint: ".",
eNotation: true,
};
function toNumber(str, options = {}) {
options = Object.assign({}, consider, options);
if (!str || typeof str !== "string") return str;
const trimmedStr = str.trim();
if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str;
else if (options.hex && hexRegex.test(trimmedStr)) {
return Number.parseInt(trimmedStr, 16);
} else {
const match = numRegex.exec(trimmedStr);
if (match) {
const sign = match[1];
const leadingZeros = match[2];
const numTrimmedByZeros = trimZeros(match[3]);
const eNotation = match[4] || match[6];
if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str;
else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str;
else {
const num = Number(trimmedStr);
const numStr = "" + num;
if (numStr.search(/[eE]/) !== -1) {
if (options.eNotation) return num;
else return str;
} else if (eNotation) {
if (options.eNotation) return num;
else return str;
} else if (trimmedStr.indexOf(".") !== -1) {
if (numStr === "0" && numTrimmedByZeros === "") return num;
else if (numStr === numTrimmedByZeros) return num;
else if (sign && numStr === "-" + numTrimmedByZeros) return num;
else return str;
}
if (leadingZeros) {
if (numTrimmedByZeros === numStr) return num;
else if (sign + numTrimmedByZeros === numStr) return num;
else return str;
}
if (trimmedStr === numStr) return num;
else if (trimmedStr === sign + numStr) return num;
return str;
}
} else {
return str;
}
}
}
function trimZeros(numStr) {
if (numStr && numStr.indexOf(".") !== -1) {
numStr = numStr.replace(/0+$/, "");
if (numStr === ".") numStr = "0";
else if (numStr[0] === ".") numStr = "0" + numStr;
else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1);
return numStr;
}
return numStr;
}
module2.exports = toNumber;
},
});
// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
var require_OrderedObjParser = __commonJS({
"node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports, module2) {
var util = require_util();
var xmlNode = require_xmlNode();
var readDocType = require_DocTypeReader();
var toNumber = require_strnum();
var regx = "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(
/NAME/g,
util.nameRegexp
);
var OrderedObjParser = class {
constructor(options) {
this.options = options;
this.currentNode = null;
this.tagsNodeStack = [];
this.docTypeEntities = {};
this.lastEntities = {
apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
gt: { regex: /&(gt|#62|#x3E);/g, val: ">" },
lt: { regex: /&(lt|#60|#x3C);/g, val: "<" },
quot: { regex: /&(quot|#34|#x22);/g, val: '"' },
};
this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
this.htmlEntities = {
space: { regex: /&(nbsp|#160);/g, val: " " },
cent: { regex: /&(cent|#162);/g, val: "\xA2" },
pound: { regex: /&(pound|#163);/g, val: "\xA3" },
yen: { regex: /&(yen|#165);/g, val: "\xA5" },
euro: { regex: /&(euro|#8364);/g, val: "\u20AC" },
copyright: { regex: /&(copy|#169);/g, val: "\xA9" },
reg: { regex: /&(reg|#174);/g, val: "\xAE" },
inr: { regex: /&(inr|#8377);/g, val: "\u20B9" },
};
this.addExternalEntities = addExternalEntities;
this.parseXml = parseXml;
this.parseTextData = parseTextData;
this.resolveNameSpace = resolveNameSpace;
this.buildAttributesMap = buildAttributesMap;
this.isItStopNode = isItStopNode;
this.replaceEntitiesValue = replaceEntitiesValue;
this.readStopNodeData = readStopNodeData;
this.saveTextToParentTag = saveTextToParentTag;
this.addChild = addChild;
}
};
function addExternalEntities(externalEntities) {
const entKeys = Object.keys(externalEntities);
for (let i = 0; i < entKeys.length; i++) {
const ent = entKeys[i];
this.lastEntities[ent] = {
regex: new RegExp("&" + ent + ";", "g"),
val: externalEntities[ent],
};
}
}
function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
if (val2 !== void 0) {
if (this.options.trimValues && !dontTrim) {
val2 = val2.trim();
}
if (val2.length > 0) {
if (!escapeEntities) val2 = this.replaceEntitiesValue(val2);
const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode);
if (newval === null || newval === void 0) {
return val2;
} else if (typeof newval !== typeof val2 || newval !== val2) {
return newval;
} else if (this.options.trimValues) {
return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);
} else {
const trimmedVal = val2.trim();
if (trimmedVal === val2) {
return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);
} else {
return val2;
}
}
}
}
}
function resolveNameSpace(tagname) {
if (this.options.removeNSPrefix) {
const tags = tagname.split(":");
const prefix = tagname.charAt(0) === "/" ? "/" : "";
if (tags[0] === "xmlns") {
return "";
}
if (tags.length === 2) {
tagname = prefix + tags[1];
}
}
return tagname;
}
var attrsRegx = /([^\s=]+)\s*(=\s*(['"])([\s\S]*?)\3)?/gm;
function buildAttributesMap(attrStr, jPath, tagName) {
if (!this.options.ignoreAttributes && typeof attrStr === "string") {
const matches = util.getAllMatches(attrStr, attrsRegx);
const len = matches.length;
const attrs = {};
for (let i = 0; i < len; i++) {
const attrName = this.resolveNameSpace(matches[i][1]);
let oldVal = matches[i][4];
let aName = this.options.attributeNamePrefix + attrName;
if (attrName.length) {
if (this.options.transformAttributeName) {
aName = this.options.transformAttributeName(aName);
}
if (aName === "__proto__") aName = "#__proto__";
if (oldVal !== void 0) {
if (this.options.trimValues) {
oldVal = oldVal.trim();
}
oldVal = this.replaceEntitiesValue(oldVal);
const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
if (newVal === null || newVal === void 0) {
attrs[aName] = oldVal;
} else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {
attrs[aName] = newVal;
} else {
attrs[aName] = parseValue(oldVal, this.options.parseAttributeValue, this.options.numberParseOptions);
}
} else if (this.options.allowBooleanAttributes) {
attrs[aName] = true;
}
}
}
if (!Object.keys(attrs).length) {
return;
}
if (this.options.attributesGroupName) {
const attrCollection = {};
attrCollection[this.options.attributesGroupName] = attrs;
return attrCollection;
}
return attrs;
}
}
var parseXml = function (xmlData) {
xmlData = xmlData.replace(/\r\n?/g, "\n");
const xmlObj = new xmlNode("!xml");
let currentNode = xmlObj;
let textData = "";
let jPath = "";
for (let i = 0; i < xmlData.length; i++) {
const ch = xmlData[i];
if (ch === "<") {
if (xmlData[i + 1] === "/") {
const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.");
let tagName = xmlData.substring(i + 2, closeIndex).trim();
if (this.options.removeNSPrefix) {
const colonIndex = tagName.indexOf(":");
if (colonIndex !== -1) {
tagName = tagName.substr(colonIndex + 1);
}
}
if (this.options.transformTagName) {
tagName = this.options.transformTagName(tagName);
}
if (currentNode) {
textData = this.saveTextToParentTag(textData, currentNode, jPath);
}
const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1);
if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) {
throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
}
let propIndex = 0;
if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) {
propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1);
this.tagsNodeStack.pop();
} else {
propIndex = jPath.lastIndexOf(".");
}
jPath = jPath.substring(0, propIndex);
currentNode = this.tagsNodeStack.pop();
textData = "";
i = closeIndex;
} else if (xmlData[i + 1] === "?") {
const tagData = readTagExp(xmlData, i, false, "?>");
if (!tagData) throw new Error("Pi Tag is not closed.");
textData = this.saveTextToParentTag(textData, currentNode, jPath);
if ((this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags) {
} else {
const childNode = new xmlNode(tagData.tagName);
childNode.add(this.options.textNodeName, "");
if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {
childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);
}
this.addChild(currentNode, childNode, jPath);
}
i = tagData.closeIndex + 1;
} else if (xmlData.substr(i + 1, 3) === "!--") {
const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed.");
if (this.options.commentPropName) {
const comment = xmlData.substring(i + 4, endIndex - 2);
textData = this.saveTextToParentTag(textData, currentNode, jPath);
currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
}
i = endIndex;
} else if (xmlData.substr(i + 1, 2) === "!D") {
const result = readDocType(xmlData, i);
this.docTypeEntities = result.entities;
i = result.i;
} else if (xmlData.substr(i + 1, 2) === "![") {
const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
const tagExp = xmlData.substring(i + 9, closeIndex);
textData = this.saveTextToParentTag(textData, currentNode, jPath);
if (this.options.cdataPropName) {
currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);
} else {
let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true);
if (val2 == void 0) val2 = "";
currentNode.add(this.options.textNodeName, val2);
}
i = closeIndex + 2;
} else {
const result = readTagExp(xmlData, i, this.options.removeNSPrefix);
let tagName = result.tagName;
let tagExp = result.tagExp;
const attrExpPresent = result.attrExpPresent;
const closeIndex = result.closeIndex;
if (this.options.transformTagName) {
tagName = this.options.transformTagName(tagName);
}
if (currentNode && textData) {
if (currentNode.tagname !== "!xml") {
textData = this.saveTextToParentTag(textData, currentNode, jPath, false);
}
}
const lastTag = currentNode;
if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) {
currentNode = this.tagsNodeStack.pop();
jPath = jPath.substring(0, jPath.lastIndexOf("."));
}
if (tagName !== xmlObj.tagname) {
jPath += jPath ? "." + tagName : tagName;
}
if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {
let tagContent = "";
if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
i = result.closeIndex;
} else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
i = result.closeIndex;
} else {
const result2 = this.readStopNodeData(xmlData, tagName, closeIndex + 1);
if (!result2) throw new Error(`Unexpected end of ${tagName}`);
i = result2.i;
tagContent = result2.tagContent;
}
const childNode = new xmlNode(tagName);
if (tagName !== tagExp && attrExpPresent) {
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
}
if (tagContent) {
tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);
}
jPath = jPath.substr(0, jPath.lastIndexOf("."));
childNode.add(this.options.textNodeName, tagContent);
this.addChild(currentNode, childNode, jPath);
} else {
if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
if (tagName[tagName.length - 1] === "/") {
tagName = tagName.substr(0, tagName.length - 1);
tagExp = tagName;
} else {
tagExp = tagExp.substr(0, tagExp.length - 1);
}
if (this.options.transformTagName) {
tagName = this.options.transformTagName(tagName);
}
const childNode = new xmlNode(tagName);
if (tagName !== tagExp && attrExpPresent) {
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
}
this.addChild(currentNode, childNode, jPath);
jPath = jPath.substr(0, jPath.lastIndexOf("."));
} else {
const childNode = new xmlNode(tagName);
this.tagsNodeStack.push(currentNode);
if (tagName !== tagExp && attrExpPresent) {
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
}
this.addChild(currentNode, childNode, jPath);
currentNode = childNode;
}
textData = "";
i = closeIndex;
}
}
} else {
textData += xmlData[i];
}
}
return xmlObj.child;
};
function addChild(currentNode, childNode, jPath) {
const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]);
if (result === false) {
} else if (typeof result === "string") {
childNode.tagname = result;
currentNode.addChild(childNode);
} else {
currentNode.addChild(childNode);
}
}
var replaceEntitiesValue = function (val2) {
if (this.options.processEntities) {
for (const entityName2 in this.docTypeEntities) {
const entity = this.docTypeEntities[entityName2];
val2 = val2.replace(entity.regx, entity.val);
}
for (const entityName2 in this.lastEntities) {
const entity = this.lastEntities[entityName2];
val2 = val2.replace(entity.regex, entity.val);
}
if (this.options.htmlEntities) {
for (const entityName2 in this.htmlEntities) {
const entity = this.htmlEntities[entityName2];
val2 = val2.replace(entity.regex, entity.val);
}
}
val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val);
}
return val2;
};
function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
if (textData) {
if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0;
textData = this.parseTextData(
textData,
currentNode.tagname,
jPath,
false,
currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false,
isLeafNode
);
if (textData !== void 0 && textData !== "") currentNode.add(this.options.textNodeName, textData);
textData = "";
}
return textData;
}
function isItStopNode(stopNodes, jPath, currentTagName) {
const allNodesExp = "*." + currentTagName;
for (const stopNodePath in stopNodes) {
const stopNodeExp = stopNodes[stopNodePath];
if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true;
}
return false;
}
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
let attrBoundary;
let tagExp = "";
for (let index = i; index < xmlData.length; index++) {
let ch = xmlData[index];
if (attrBoundary) {
if (ch === attrBoundary) attrBoundary = "";
} else if (ch === '"' || ch === "'") {
attrBoundary = ch;
} else if (ch === closingChar[0]) {
if (closingChar[1]) {
if (xmlData[index + 1] === closingChar[1]) {
return {
data: tagExp,
index,
};
}
} else {
return {
data: tagExp,
index,
};
}
} else if (ch === " ") {
ch = " ";
}
tagExp += ch;
}
}
function findClosingIndex(xmlData, str, i, errMsg) {
const closingIndex = xmlData.indexOf(str, i);
if (closingIndex === -1) {
throw new Error(errMsg);
} else {
return closingIndex + str.length - 1;
}
}
function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
if (!result) return;
let tagExp = result.data;
const closeIndex = result.index;
const separatorIndex = tagExp.search(/\s/);
let tagName = tagExp;
let attrExpPresent = true;
if (separatorIndex !== -1) {
tagName = tagExp.substr(0, separatorIndex).replace(/\s\s*$/, "");
tagExp = tagExp.substr(separatorIndex + 1);
}
if (removeNSPrefix) {
const colonIndex = tagName.indexOf(":");
if (colonIndex !== -1) {
tagName = tagName.substr(colonIndex + 1);
attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
}
}
return {
tagName,
tagExp,
closeIndex,
attrExpPresent,
};
}
function readStopNodeData(xmlData, tagName, i) {
const startIndex = i;
let openTagCount = 1;
for (; i < xmlData.length; i++) {
if (xmlData[i] === "<") {
if (xmlData[i + 1] === "/") {
const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`);
const closeTagName = xmlData.substring(i + 2, closeIndex).trim();
if (closeTagName === tagName) {
openTagCount--;
if (openTagCount === 0) {
return {
tagContent: xmlData.substring(startIndex, i),
i: closeIndex,
};
}
}
i = closeIndex;
} else if (xmlData[i + 1] === "?") {
const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed.");
i = closeIndex;
} else if (xmlData.substr(i + 1, 3) === "!--") {
const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed.");
i = closeIndex;
} else if (xmlData.substr(i + 1, 2) === "![") {
const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
i = closeIndex;
} else {
const tagData = readTagExp(xmlData, i, ">");
if (tagData) {
const openTagName = tagData && tagData.tagName;
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
openTagCount++;
}
i = tagData.closeIndex;
}
}
}
}
}
function parseValue(val2, shouldParse, options) {
if (shouldParse && typeof val2 === "string") {
const newval = val2.trim();
if (newval === "true") return true;
else if (newval === "false") return false;
else return toNumber(val2, options);
} else {
if (util.isExist(val2)) {
return val2;
} else {
return "";
}
}
}
module2.exports = OrderedObjParser;
},
});
// node_modules/fast-xml-parser/src/xmlparser/node2json.js
var require_node2json = __commonJS({
"node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports) {
function prettify(node, options) {
return compress(node, options);
}
function compress(arr, options, jPath) {
let text;
const compressedObj = {};
for (let i = 0; i < arr.length; i++) {
const tagObj = arr[i];
const property = propName(tagObj);
let newJpath = "";
if (jPath === void 0) newJpath = property;
else newJpath = jPath + "." + property;
if (property === options.textNodeName) {
if (text === void 0) text = tagObj[property];
else text += "" + tagObj[property];
} else if (property === void 0) {
} else if (tagObj[property]) {
let val2 = compress(tagObj[property], options, newJpath);
const isLeaf = isLeafTag(val2, options);
if (tagObj[":@"]) {
assignAttributes(val2, tagObj[":@"], newJpath, options);
} else if (
Object.keys(val2).length === 1 &&
val2[options.textNodeName] !== void 0 &&
!options.alwaysCreateTextNode
) {
val2 = val2[options.textNodeName];
} else if (Object.keys(val2).length === 0) {
if (options.alwaysCreateTextNode) val2[options.textNodeName] = "";
else val2 = "";
}
if (compressedObj[property] !== void 0 && Object.hasOwn(compressedObj, property)) {
if (!Array.isArray(compressedObj[property])) {
compressedObj[property] = [compressedObj[property]];
}
compressedObj[property].push(val2);
} else {
if (options.isArray(property, newJpath, isLeaf)) {
compressedObj[property] = [val2];
} else {
compressedObj[property] = val2;
}
}
}
}
if (typeof text === "string") {
if (text.length > 0) compressedObj[options.textNodeName] = text;
} else if (text !== void 0) compressedObj[options.textNodeName] = text;
return compressedObj;
}
function propName(obj) {
const keys = Object.keys(obj);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (key !== ":@") return key;
}
}
function assignAttributes(obj, attrMap, jpath, options) {
if (attrMap) {
const keys = Object.keys(attrMap);
const len = keys.length;
for (let i = 0; i < len; i++) {
const atrrName = keys[i];
if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) {
obj[atrrName] = [attrMap[atrrName]];
} else {
obj[atrrName] = attrMap[atrrName];
}
}
}
}
function isLeafTag(obj, options) {
const { textNodeName } = options;
const propCount = Object.keys(obj).length;
if (propCount === 0) {
return true;
}
if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) {
return true;
}
return false;
}
exports.prettify = prettify;
},
});
// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
var require_XMLParser = __commonJS({
"node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports, module2) {
var { buildOptions } = require_OptionsBuilder();
var OrderedObjParser = require_OrderedObjParser();
var { prettify } = require_node2json();
var validator = require_validator();
var XMLParser = class {
constructor(options) {
this.externalEntities = {};
this.options = buildOptions(options);
}
parse(xmlData, validationOption) {
if (typeof xmlData === "string") {
} else if (xmlData.toString) {
xmlData = xmlData.toString();
} else {
throw new Error("XML data is accepted in String or Bytes[] form.");
}
if (validationOption) {
if (validationOption === true) validationOption = {};
const result = validator.validate(xmlData, validationOption);
if (result !== true) {
throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);
}
}
const orderedObjParser = new OrderedObjParser(this.options);
orderedObjParser.addExternalEntities(this.externalEntities);
const orderedResult = orderedObjParser.parseXml(xmlData);
if (this.options.preserveOrder || orderedResult === void 0) return orderedResult;
else return prettify(orderedResult, this.options);
}
addEntity(key, value) {
if (value.indexOf("&") !== -1) {
throw new Error("Entity value can't have '&'");
} else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) {
throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");
} else if (value === "&") {
throw new Error("An entity with value '&' is not permitted");
} else {
this.externalEntities[key] = value;
}
}
};
module2.exports = XMLParser;
},
});
// node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js
var require_orderedJs2Xml = __commonJS({
"node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports, module2) {
var EOL = "\n";
function toXml(jArray, options) {
let indentation = "";
if (options.format && options.indentBy.length > 0) {
indentation = EOL;
}
return arrToStr(jArray, options, "", indentation);
}
function arrToStr(arr, options, jPath, indentation) {
let xmlStr = "";
let isPreviousElementTag = false;
for (let i = 0; i < arr.length; i++) {
const tagObj = arr[i];
const tagName = propName(tagObj);
let newJPath = "";
if (jPath.length === 0) newJPath = tagName;
else newJPath = `${jPath}.${tagName}`;
if (tagName === options.textNodeName) {
let tagText = tagObj[tagName];
if (!isStopNode(newJPath, options)) {
tagText = options.tagValueProcessor(tagName, tagText);
tagText = replaceEntitiesValue(tagText, options);
}
if (isPreviousElementTag) {
xmlStr += indentation;
}
xmlStr += tagText;
isPreviousElementTag = false;
continue;
} else if (tagName === options.cdataPropName) {
if (isPreviousElementTag) {
xmlStr += indentation;
}
xmlStr += `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;
isPreviousElementTag = false;
continue;
} else if (tagName === options.commentPropName) {
xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;
isPreviousElementTag = true;
continue;
} else if (tagName[0] === "?") {
const attStr2 = attr_to_str(tagObj[":@"], options);
const tempInd = tagName === "?xml" ? "" : indentation;
let piTextNodeName = tagObj[tagName][0][options.textNodeName];
piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : "";
xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`;
isPreviousElementTag = true;
continue;
}
let newIdentation = indentation;
if (newIdentation !== "") {
newIdentation += options.indentBy;
}
const attStr = attr_to_str(tagObj[":@"], options);
const tagStart = indentation + `<${tagName}${attStr}`;
const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation);
if (options.unpairedTags.indexOf(tagName) !== -1) {
if (options.suppressUnpairedNode) xmlStr += tagStart + ">";
else xmlStr += tagStart + "/>";
} else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {
xmlStr += tagStart + "/>";
} else if (tagValue && tagValue.endsWith(">")) {
xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>`;
} else {
xmlStr += tagStart + ">";
if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("</"))) {
xmlStr += indentation + options.indentBy + tagValue + indentation;
} else {
xmlStr += tagValue;
}
xmlStr += `</${tagName}>`;
}
isPreviousElementTag = true;
}
return xmlStr;
}
function propName(obj) {
const keys = Object.keys(obj);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (key !== ":@") return key;
}
}
function attr_to_str(attrMap, options) {
let attrStr = "";
if (attrMap && !options.ignoreAttributes) {
for (const attr in attrMap) {
let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);
attrVal = replaceEntitiesValue(attrVal, options);
if (attrVal === true && options.suppressBooleanAttributes) {
attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;
} else {
attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`;
}
}
}
return attrStr;
}
function isStopNode(jPath, options) {
jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1);
const tagName = jPath.substr(jPath.lastIndexOf(".") + 1);
for (const index in options.stopNodes) {
if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true;
}
return false;
}
function replaceEntitiesValue(textValue, options) {
if (textValue && textValue.length > 0 && options.processEntities) {
for (let i = 0; i < options.entities.length; i++) {
const entity = options.entities[i];
textValue = textValue.replace(entity.regex, entity.val);
}
}
return textValue;
}
module2.exports = toXml;
},
});
// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js
var require_json2xml = __commonJS({
"node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports, module2) {
var buildFromOrderedJs = require_orderedJs2Xml();
var defaultOptions = {
attributeNamePrefix: "@_",
attributesGroupName: false,
textNodeName: "#text",
ignoreAttributes: true,
cdataPropName: false,
format: false,
indentBy: " ",
suppressEmptyNode: false,
suppressUnpairedNode: true,
suppressBooleanAttributes: true,
tagValueProcessor: (key, a) => a,
attributeValueProcessor: (attrName, a) => a,
preserveOrder: false,
commentPropName: false,
unpairedTags: [],
entities: [
{ regex: /&/g, val: "&" },
{ regex: />/g, val: ">" },
{ regex: /</g, val: "<" },
{ regex: /'/g, val: "'" },
{ regex: /"/g, val: """ },
],
processEntities: true,
stopNodes: [],
oneListGroup: false,
};
function Builder(options) {
this.options = Object.assign({}, defaultOptions, options);
if (this.options.ignoreAttributes || this.options.attributesGroupName) {
this.isAttribute = () => false;
} else {
this.attrPrefixLen = this.options.attributeNamePrefix.length;
this.isAttribute = isAttribute;
}
this.processTextOrObjNode = processTextOrObjNode;
if (this.options.format) {
this.indentate = indentate;
this.tagEndChar = ">\n";
this.newLine = "\n";
} else {
this.indentate = () => "";
this.tagEndChar = ">";
this.newLine = "";
}
}
Builder.prototype.build = function (jObj) {
if (this.options.preserveOrder) {
return buildFromOrderedJs(jObj, this.options);
} else {
if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
jObj = {
[this.options.arrayNodeName]: jObj,
};
}
return this.j2x(jObj, 0).val;
}
};
Builder.prototype.j2x = function (jObj, level) {
let attrStr = "";
let val2 = "";
for (const key in jObj) {
if (typeof jObj[key] === "undefined") {
} else if (jObj[key] === null) {
if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar;
} else if (jObj[key] instanceof Date) {
val2 += this.buildTextValNode(jObj[key], key, "", level);
} else if (typeof jObj[key] !== "object") {
const attr = this.isAttribute(key);
if (attr) {
attrStr += this.buildAttrPairStr(attr, "" + jObj[key]);
} else {
if (key === this.options.textNodeName) {
const newval = this.options.tagValueProcessor(key, "" + jObj[key]);
val2 += this.replaceEntitiesValue(newval);
} else {
val2 += this.buildTextValNode(jObj[key], key, "", level);
}
}
} else if (Array.isArray(jObj[key])) {
const arrLen = jObj[key].length;
let listTagVal = "";
for (let j = 0; j < arrLen; j++) {
const item = jObj[key][j];
if (typeof item === "undefined") {
} else if (item === null) {
if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar;
} else if (typeof item === "object") {
if (this.options.oneListGroup) {
listTagVal += this.j2x(item, level + 1).val;
} else {
listTagVal += this.processTextOrObjNode(item, key, level);
}
} else {
listTagVal += this.buildTextValNode(item, key, "", level);
}
}
if (this.options.oneListGroup) {
listTagVal = this.buildObjectNode(listTagVal, key, "", level);
}
val2 += listTagVal;
} else {
if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
const Ks = Object.keys(jObj[key]);
const L = Ks.length;
for (let j = 0; j < L; j++) {
attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]);
}
} else {
val2 += this.processTextOrObjNode(jObj[key], key, level);
}
}
}
return { attrStr, val: val2 };
};
Builder.prototype.buildAttrPairStr = function (attrName, val2) {
val2 = this.options.attributeValueProcessor(attrName, "" + val2);
val2 = this.replaceEntitiesValue(val2);
if (this.options.suppressBooleanAttributes && val2 === "true") {
return " " + attrName;
} else return " " + attrName + '="' + val2 + '"';
};
function processTextOrObjNode(object, key, level) {
const result = this.j2x(object, level + 1);
if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) {
return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
} else {
return this.buildObjectNode(result.val, key, result.attrStr, level);
}
}
Builder.prototype.buildObjectNode = function (val2, key, attrStr, level) {
if (val2 === "") {
if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar;
else {
return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar;
}
} else {
let tagEndExp = "</" + key + this.tagEndChar;
let piClosingChar = "";
if (key[0] === "?") {
piClosingChar = "?";
tagEndExp = "";
}
if (attrStr && val2.indexOf("<") === -1) {
return this.indentate(level) + "<" + key + attrStr + piClosingChar + ">" + val2 + tagEndExp;
} else if (
this.options.commentPropName !== false &&
key === this.options.commentPropName &&
piClosingChar.length === 0
) {
return this.indentate(level) + `<!--${val2}-->` + this.newLine;
} else {
return (
this.indentate(level) +
"<" +
key +
attrStr +
piClosingChar +
this.tagEndChar +
val2 +
this.indentate(level) +
tagEndExp
);
}
}
};
Builder.prototype.closeTag = function (key) {
let closeTag = "";
if (this.options.unpairedTags.indexOf(key) !== -1) {
if (!this.options.suppressUnpairedNode) closeTag = "/";
} else if (this.options.suppressEmptyNode) {
closeTag = "/";
} else {
closeTag = `></${key}`;
}
return closeTag;
};
Builder.prototype.buildTextValNode = function (val2, key, attrStr, level) {
if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {
return this.indentate(level) + `<![CDATA[${val2}]]>` + this.newLine;
} else if (this.options.commentPropName !== false && key === this.options.commentPropName) {
return this.indentate(level) + `<!--${val2}-->` + this.newLine;
} else if (key[0] === "?") {
return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar;
} else {
let textValue = this.options.tagValueProcessor(key, val2);
textValue = this.replaceEntitiesValue(textValue);
if (textValue === "") {
return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar;
} else {
return this.indentate(level) + "<" + key + attrStr + ">" + textValue + "</" + key + this.tagEndChar;
}
}
};
Builder.prototype.replaceEntitiesValue = function (textValue) {
if (textValue && textValue.length > 0 && this.options.processEntities) {
for (let i = 0; i < this.options.entities.length; i++) {
const entity = this.options.entities[i];
textValue = textValue.replace(entity.regex, entity.val);
}
}
return textValue;
};
function indentate(level) {
return this.options.indentBy.repeat(level);
}
function isAttribute(name) {
if (name.startsWith(this.options.attributeNamePrefix)) {
return name.substr(this.attrPrefixLen);
} else {
return false;
}
}
module2.exports = Builder;
},
});
// node_modules/fast-xml-parser/src/fxp.js
var require_fxp = __commonJS({
"node_modules/fast-xml-parser/src/fxp.js"(exports, module2) {
var validator = require_validator();
var XMLParser = require_XMLParser();
var XMLBuilder = require_json2xml();
module2.exports = {
XMLParser,
XMLValidator: validator,
XMLBuilder,
};
},
});
// node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js
var require_protocols = __commonJS({
"node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var protocols_exports = {};
__export2(protocols_exports, {
_toBool: () => _toBool,
_toNum: () => _toNum,
_toStr: () => _toStr,
awsExpectUnion: () => awsExpectUnion,
loadRestJsonErrorCode: () => loadRestJsonErrorCode,
loadRestXmlErrorCode: () => loadRestXmlErrorCode,
parseJsonBody: () => parseJsonBody,
parseJsonErrorBody: () => parseJsonErrorBody,
parseXmlBody: () => parseXmlBody,
parseXmlErrorBody: () => parseXmlErrorBody,
});
module2.exports = __toCommonJS2(protocols_exports);
var _toStr = /* @__PURE__ */ __name((val2) => {
if (val2 == null) {
return val2;
}
if (typeof val2 === "number" || typeof val2 === "bigint") {
const warning = new Error(`Received number ${val2} where a string was expected.`);
warning.name = "Warning";
console.warn(warning);
return String(val2);
}
if (typeof val2 === "boolean") {
const warning = new Error(`Received boolean ${val2} where a string was expected.`);
warning.name = "Warning";
console.warn(warning);
return String(val2);
}
return val2;
}, "_toStr");
var _toBool = /* @__PURE__ */ __name((val2) => {
if (val2 == null) {
return val2;
}
if (typeof val2 === "number") {
}
if (typeof val2 === "string") {
const lowercase = val2.toLowerCase();
if (val2 !== "" && lowercase !== "false" && lowercase !== "true") {
const warning = new Error(`Received string "${val2}" where a boolean was expected.`);
warning.name = "Warning";
console.warn(warning);
}
return val2 !== "" && lowercase !== "false";
}
return val2;
}, "_toBool");
var _toNum = /* @__PURE__ */ __name((val2) => {
if (val2 == null) {
return val2;
}
if (typeof val2 === "boolean") {
}
if (typeof val2 === "string") {
const num = Number(val2);
if (num.toString() !== val2) {
const warning = new Error(`Received string "${val2}" where a number was expected.`);
warning.name = "Warning";
console.warn(warning);
return val2;
}
return num;
}
return val2;
}, "_toNum");
var import_smithy_client = require_dist_cjs32();
var awsExpectUnion = /* @__PURE__ */ __name((value) => {
if (value == null) {
return void 0;
}
if (typeof value === "object" && "__type" in value) {
delete value.__type;
}
return (0, import_smithy_client.expectUnion)(value);
}, "awsExpectUnion");
var import_smithy_client2 = require_dist_cjs32();
var collectBodyString = /* @__PURE__ */ __name(
(streamBody, context) =>
(0, import_smithy_client2.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)),
"collectBodyString"
);
var parseJsonBody = /* @__PURE__ */ __name(
(streamBody, context) =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
try {
return JSON.parse(encoded);
} catch (e) {
if ((e == null ? void 0 : e.name) === "SyntaxError") {
Object.defineProperty(e, "$responseBodyText", {
value: encoded,
});
}
throw e;
}
}
return {};
}),
"parseJsonBody"
);
var parseJsonErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
const value = await parseJsonBody(errorBody, context);
value.message = value.message ?? value.Message;
return value;
}, "parseJsonErrorBody");
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
const findKey = /* @__PURE__ */ __name(
(object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()),
"findKey"
);
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
let cleanValue = rawValue;
if (typeof cleanValue === "number") {
cleanValue = cleanValue.toString();
}
if (cleanValue.indexOf(",") >= 0) {
cleanValue = cleanValue.split(",")[0];
}
if (cleanValue.indexOf(":") >= 0) {
cleanValue = cleanValue.split(":")[0];
}
if (cleanValue.indexOf("#") >= 0) {
cleanValue = cleanValue.split("#")[1];
}
return cleanValue;
}, "sanitizeErrorCode");
const headerKey = findKey(output.headers, "x-amzn-errortype");
if (headerKey !== void 0) {
return sanitizeErrorCode(output.headers[headerKey]);
}
if (data.code !== void 0) {
return sanitizeErrorCode(data.code);
}
if (data["__type"] !== void 0) {
return sanitizeErrorCode(data["__type"]);
}
}, "loadRestJsonErrorCode");
var import_smithy_client3 = require_dist_cjs32();
var import_fast_xml_parser = require_fxp();
var parseXmlBody = /* @__PURE__ */ __name(
(streamBody, context) =>
collectBodyString(streamBody, context).then((encoded) => {
if (encoded.length) {
const parser = new import_fast_xml_parser.XMLParser({
attributeNamePrefix: "",
htmlEntities: true,
ignoreAttributes: false,
ignoreDeclaration: true,
parseTagValue: false,
trimValues: false,
tagValueProcessor: (_, val2) => (val2.trim() === "" && val2.includes("\n") ? "" : void 0),
});
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
let parsedObj;
try {
parsedObj = parser.parse(encoded, true);
} catch (e) {
if (e && typeof e === "object") {
Object.defineProperty(e, "$responseBodyText", {
value: encoded,
});
}
throw e;
}
const textNodeName = "#text";
const key = Object.keys(parsedObj)[0];
const parsedObjToReturn = parsedObj[key];
if (parsedObjToReturn[textNodeName]) {
parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
delete parsedObjToReturn[textNodeName];
}
return (0, import_smithy_client3.getValueFromTextNode)(parsedObjToReturn);
}
return {};
}),
"parseXmlBody"
);
var parseXmlErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
const value = await parseXmlBody(errorBody, context);
if (value.Error) {
value.Error.message = value.Error.message ?? value.Error.Message;
}
return value;
}, "parseXmlErrorBody");
var loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => {
var _a;
if (((_a = data == null ? void 0 : data.Error) == null ? void 0 : _a.Code) !== void 0) {
return data.Error.Code;
}
if ((data == null ? void 0 : data.Code) !== void 0) {
return data.Code;
}
if (output.statusCode == 404) {
return "NotFound";
}
}, "loadRestXmlErrorCode");
},
});
// node_modules/@aws-sdk/core/dist-cjs/index.js
var require_dist_cjs37 = __commonJS({
"node_modules/@aws-sdk/core/dist-cjs/index.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require_tslib();
tslib_1.__exportStar(require_client(), exports);
tslib_1.__exportStar(require_httpAuthSchemes(), exports);
tslib_1.__exportStar(require_protocols(), exports);
},
});
// node_modules/@aws-sdk/client-iot-wireless/dist-cjs/auth/httpAuthSchemeProvider.js
var require_httpAuthSchemeProvider = __commonJS({
"node_modules/@aws-sdk/client-iot-wireless/dist-cjs/auth/httpAuthSchemeProvider.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHttpAuthSchemeConfig =
exports.defaultIoTWirelessHttpAuthSchemeProvider =
exports.defaultIoTWirelessHttpAuthSchemeParametersProvider =
void 0;
var core_1 = require_dist_cjs37();
var util_middleware_1 = require_dist_cjs10();
var defaultIoTWirelessHttpAuthSchemeParametersProvider = async (config, context, input) => {
return {
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
region:
(await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
(() => {
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
})(),
};
};
exports.defaultIoTWirelessHttpAuthSchemeParametersProvider = defaultIoTWirelessHttpAuthSchemeParametersProvider;
function createAwsAuthSigv4HttpAuthOption(authParameters) {
return {
schemeId: "aws.auth#sigv4",
signingProperties: {
name: "iotwireless",
region: authParameters.region,
},
propertiesExtractor: (config, context) => ({
signingProperties: {
config,
context,
},
}),
};
}
var defaultIoTWirelessHttpAuthSchemeProvider = (authParameters) => {
const options = [];
switch (authParameters.operation) {
default: {
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
}
}
return options;
};
exports.defaultIoTWirelessHttpAuthSchemeProvider = defaultIoTWirelessHttpAuthSchemeProvider;
var resolveHttpAuthSchemeConfig = (config) => {
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
return {
...config_0,
};
};
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
},
});
// node_modules/@aws-sdk/client-iot-wireless/package.json
var require_package = __commonJS({
"node_modules/@aws-sdk/client-iot-wireless/package.json"(exports, module2) {
module2.exports = {
name: "@aws-sdk/client-iot-wireless",
description: "AWS SDK for JavaScript Iot Wireless Client for Node.js, Browser and React Native",
version: "3.600.0",
scripts: {
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
"build:cjs": "node ../../scripts/compilation/inline client-iot-wireless",
"build:es": "tsc -p tsconfig.es.json",
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo iot-wireless",
},
main: "./dist-cjs/index.js",
types: "./dist-types/index.d.ts",
module: "./dist-es/index.js",
sideEffects: false,
dependencies: {
"@aws-crypto/sha256-browser": "5.2.0",
"@aws-crypto/sha256-js": "5.2.0",
"@aws-sdk/client-sso-oidc": "3.600.0",
"@aws-sdk/client-sts": "3.600.0",
"@aws-sdk/core": "3.598.0",
"@aws-sdk/credential-provider-node": "3.600.0",
"@aws-sdk/middleware-host-header": "3.598.0",
"@aws-sdk/middleware-logger": "3.598.0",
"@aws-sdk/middleware-recursion-detection": "3.598.0",
"@aws-sdk/middleware-user-agent": "3.598.0",
"@aws-sdk/region-config-resolver": "3.598.0",
"@aws-sdk/types": "3.598.0",
"@aws-sdk/util-endpoints": "3.598.0",
"@aws-sdk/util-user-agent-browser": "3.598.0",
"@aws-sdk/util-user-agent-node": "3.598.0",
"@smithy/config-resolver": "^3.0.2",
"@smithy/core": "^2.2.1",
"@smithy/fetch-http-handler": "^3.0.2",
"@smithy/hash-node": "^3.0.1",
"@smithy/invalid-dependency": "^3.0.1",
"@smithy/middleware-content-length": "^3.0.1",
"@smithy/middleware-endpoint": "^3.0.2",
"@smithy/middleware-retry": "^3.0.4",
"@smithy/middleware-serde": "^3.0.1",
"@smithy/middleware-stack": "^3.0.1",
"@smithy/node-config-provider": "^3.1.1",
"@smithy/node-http-handler": "^3.0.1",
"@smithy/protocol-http": "^4.0.1",
"@smithy/smithy-client": "^3.1.2",
"@smithy/types": "^3.1.0",
"@smithy/url-parser": "^3.0.1",
"@smithy/util-base64": "^3.0.0",
"@smithy/util-body-length-browser": "^3.0.0",
"@smithy/util-body-length-node": "^3.0.0",
"@smithy/util-defaults-mode-browser": "^3.0.4",
"@smithy/util-defaults-mode-node": "^3.0.4",
"@smithy/util-endpoints": "^2.0.2",
"@smithy/util-middleware": "^3.0.1",
"@smithy/util-retry": "^3.0.1",
"@smithy/util-stream": "^3.0.2",
"@smithy/util-utf8": "^3.0.0",
tslib: "^2.6.2",
uuid: "^9.0.1",
},
devDependencies: {
"@tsconfig/node16": "16.1.3",
"@types/node": "^16.18.96",
"@types/uuid": "^9.0.4",
concurrently: "7.0.0",
"downlevel-dts": "0.10.1",
rimraf: "3.0.2",
typescript: "~4.9.5",
},
engines: {
node: ">=16.0.0",
},
typesVersions: {
"<4.0": {
"dist-types/*": ["dist-types/ts3.4/*"],
},
},
files: ["dist-*/**"],
author: {
name: "AWS SDK for JavaScript Team",
url: "https://aws.amazon.com/javascript/",
},
license: "Apache-2.0",
browser: {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser",
},
"react-native": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native",
},
homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-wireless",
repository: {
type: "git",
url: "https://github.com/aws/aws-sdk-js-v3.git",
directory: "clients/client-iot-wireless",
},
};
},
});
// node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js
var require_dist_cjs38 = __commonJS({
"node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
ENV_EXPIRATION: () => ENV_EXPIRATION,
ENV_KEY: () => ENV_KEY,
ENV_SECRET: () => ENV_SECRET,
ENV_SESSION: () => ENV_SESSION,
fromEnv: () => fromEnv,
});
module2.exports = __toCommonJS2(src_exports);
var import_property_provider = require_dist_cjs12();
var ENV_KEY = "AWS_ACCESS_KEY_ID";
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
var ENV_SESSION = "AWS_SESSION_TOKEN";
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
var fromEnv = /* @__PURE__ */ __name(
(init) => async () => {
var _a;
(_a = init == null ? void 0 : init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-env - fromEnv");
const accessKeyId = process.env[ENV_KEY];
const secretAccessKey = process.env[ENV_SECRET];
const sessionToken = process.env[ENV_SESSION];
const expiry = process.env[ENV_EXPIRATION];
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
if (accessKeyId && secretAccessKey) {
return {
accessKeyId,
secretAccessKey,
...(sessionToken && { sessionToken }),
...(expiry && { expiration: new Date(expiry) }),
...(credentialScope && { credentialScope }),
};
}
throw new import_property_provider.CredentialsProviderError(
"Unable to find environment variable credentials.",
{ logger: init == null ? void 0 : init.logger }
);
},
"fromEnv"
);
},
});
// node_modules/@smithy/credential-provider-imds/dist-cjs/index.js
var require_dist_cjs39 = __commonJS({
"node_modules/@smithy/credential-provider-imds/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES,
DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN,
ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI,
ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI,
Endpoint: () => Endpoint,
fromContainerMetadata: () => fromContainerMetadata,
fromInstanceMetadata: () => fromInstanceMetadata,
getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint,
httpRequest: () => httpRequest,
providerConfigFromInit: () => providerConfigFromInit,
});
module2.exports = __toCommonJS2(src_exports);
var import_url = require("url");
var import_property_provider = require_dist_cjs12();
var import_buffer = require("buffer");
var import_http = require("http");
function httpRequest(options) {
return new Promise((resolve, reject) => {
var _a;
const req = (0, import_http.request)({
method: "GET",
...options,
hostname: (_a = options.hostname) == null ? void 0 : _a.replace(/^\[(.+)\]$/, "$1"),
});
req.on("error", (err) => {
reject(
Object.assign(
new import_property_provider.ProviderError("Unable to connect to instance metadata service"),
err
)
);
req.destroy();
});
req.on("timeout", () => {
reject(new import_property_provider.ProviderError("TimeoutError from instance metadata service"));
req.destroy();
});
req.on("response", (res) => {
const { statusCode = 400 } = res;
if (statusCode < 200 || 300 <= statusCode) {
reject(
Object.assign(
new import_property_provider.ProviderError("Error response received from instance metadata service"),
{ statusCode }
)
);
req.destroy();
}
const chunks = [];
res.on("data", (chunk) => {
chunks.push(chunk);
});
res.on("end", () => {
resolve(import_buffer.Buffer.concat(chunks));
req.destroy();
});
});
req.end();
});
}
__name(httpRequest, "httpRequest");
var isImdsCredentials = /* @__PURE__ */ __name(
(arg) =>
Boolean(arg) &&
typeof arg === "object" &&
typeof arg.AccessKeyId === "string" &&
typeof arg.SecretAccessKey === "string" &&
typeof arg.Token === "string" &&
typeof arg.Expiration === "string",
"isImdsCredentials"
);
var fromImdsCredentials = /* @__PURE__ */ __name(
(creds) => ({
accessKeyId: creds.AccessKeyId,
secretAccessKey: creds.SecretAccessKey,
sessionToken: creds.Token,
expiration: new Date(creds.Expiration),
}),
"fromImdsCredentials"
);
var DEFAULT_TIMEOUT = 1e3;
var DEFAULT_MAX_RETRIES = 0;
var providerConfigFromInit = /* @__PURE__ */ __name(
({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({
maxRetries,
timeout,
}),
"providerConfigFromInit"
);
var retry = /* @__PURE__ */ __name((toRetry, maxRetries) => {
let promise = toRetry();
for (let i = 0; i < maxRetries; i++) {
promise = promise.catch(toRetry);
}
return promise;
}, "retry");
var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
var fromContainerMetadata = /* @__PURE__ */ __name((init = {}) => {
const { timeout, maxRetries } = providerConfigFromInit(init);
return () =>
retry(async () => {
const requestOptions = await getCmdsUri({ logger: init.logger });
const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
if (!isImdsCredentials(credsResponse)) {
throw new import_property_provider.CredentialsProviderError(
"Invalid response received from instance metadata service.",
{
logger: init.logger,
}
);
}
return fromImdsCredentials(credsResponse);
}, maxRetries);
}, "fromContainerMetadata");
var requestFromEcsImds = /* @__PURE__ */ __name(async (timeout, options) => {
if (process.env[ENV_CMDS_AUTH_TOKEN]) {
options.headers = {
...options.headers,
Authorization: process.env[ENV_CMDS_AUTH_TOKEN],
};
}
const buffer = await httpRequest({
...options,
timeout,
});
return buffer.toString();
}, "requestFromEcsImds");
var CMDS_IP = "169.254.170.2";
var GREENGRASS_HOSTS = {
localhost: true,
"127.0.0.1": true,
};
var GREENGRASS_PROTOCOLS = {
"http:": true,
"https:": true,
};
var getCmdsUri = /* @__PURE__ */ __name(async ({ logger }) => {
if (process.env[ENV_CMDS_RELATIVE_URI]) {
return {
hostname: CMDS_IP,
path: process.env[ENV_CMDS_RELATIVE_URI],
};
}
if (process.env[ENV_CMDS_FULL_URI]) {
const parsed = (0, import_url.parse)(process.env[ENV_CMDS_FULL_URI]);
if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
throw new import_property_provider.CredentialsProviderError(
`${parsed.hostname} is not a valid container metadata service hostname`,
{
tryNextLink: false,
logger,
}
);
}
if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
throw new import_property_provider.CredentialsProviderError(
`${parsed.protocol} is not a valid container metadata service protocol`,
{
tryNextLink: false,
logger,
}
);
}
return {
...parsed,
port: parsed.port ? parseInt(parsed.port, 10) : void 0,
};
}
throw new import_property_provider.CredentialsProviderError(
`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`,
{
tryNextLink: false,
logger,
}
);
}, "getCmdsUri");
var _InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError2
extends import_property_provider.CredentialsProviderError
{
constructor(message, tryNextLink = true) {
super(message, tryNextLink);
this.tryNextLink = tryNextLink;
this.name = "InstanceMetadataV1FallbackError";
Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError2.prototype);
}
};
__name(_InstanceMetadataV1FallbackError, "InstanceMetadataV1FallbackError");
var InstanceMetadataV1FallbackError = _InstanceMetadataV1FallbackError;
var import_node_config_provider = require_dist_cjs14();
var import_url_parser = require_dist_cjs16();
var Endpoint = /* @__PURE__ */ ((Endpoint2) => {
Endpoint2["IPv4"] = "http://169.254.169.254";
Endpoint2["IPv6"] = "http://[fd00:ec2::254]";
return Endpoint2;
})(Endpoint || {});
var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
var ENDPOINT_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],
configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],
default: void 0,
};
var EndpointMode = /* @__PURE__ */ ((EndpointMode2) => {
EndpointMode2["IPv4"] = "IPv4";
EndpointMode2["IPv6"] = "IPv6";
return EndpointMode2;
})(EndpointMode || {});
var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
var ENDPOINT_MODE_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],
configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],
default: "IPv4",
};
var getInstanceMetadataEndpoint = /* @__PURE__ */ __name(
async () =>
(0, import_url_parser.parseUrl)((await getFromEndpointConfig()) || (await getFromEndpointModeConfig())),
"getInstanceMetadataEndpoint"
);
var getFromEndpointConfig = /* @__PURE__ */ __name(
async () => (0, import_node_config_provider.loadConfig)(ENDPOINT_CONFIG_OPTIONS)(),
"getFromEndpointConfig"
);
var getFromEndpointModeConfig = /* @__PURE__ */ __name(async () => {
const endpointMode = await (0, import_node_config_provider.loadConfig)(ENDPOINT_MODE_CONFIG_OPTIONS)();
switch (endpointMode) {
case "IPv4":
return "http://169.254.169.254";
case "IPv6":
return "http://[fd00:ec2::254]";
default:
throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`);
}
}, "getFromEndpointModeConfig");
var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger) => {
const refreshInterval =
STATIC_STABILITY_REFRESH_INTERVAL_SECONDS +
Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
logger.warn(
`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
For more information, please visit: ` + STATIC_STABILITY_DOC_URL
);
const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
return {
...credentials,
...(originalExpiration ? { originalExpiration } : {}),
expiration: newExpiration,
};
}, "getExtendedInstanceMetadataCredentials");
var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => {
const logger = (options == null ? void 0 : options.logger) || console;
let pastCredentials;
return async () => {
let credentials;
try {
credentials = await provider();
if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
credentials = getExtendedInstanceMetadataCredentials(credentials, logger);
}
} catch (e) {
if (pastCredentials) {
logger.warn("Credential renew failed: ", e);
credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);
} else {
throw e;
}
}
pastCredentials = credentials;
return credentials;
};
}, "staticStabilityProvider");
var IMDS_PATH = "/latest/meta-data/iam/security-credentials/";
var IMDS_TOKEN_PATH = "/latest/api/token";
var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED";
var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled";
var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
var fromInstanceMetadata = /* @__PURE__ */ __name(
(init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }),
"fromInstanceMetadata"
);
var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
let disableFetchToken = false;
const { logger, profile } = init;
const { timeout, maxRetries } = providerConfigFromInit(init);
const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => {
var _a;
const isImdsV1Fallback =
disableFetchToken || ((_a = options.headers) == null ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null;
if (isImdsV1Fallback) {
let fallbackBlockedFromProfile = false;
let fallbackBlockedFromProcessEnv = false;
const configValue = await (0, import_node_config_provider.loadConfig)(
{
environmentVariableSelector: (env) => {
const envValue = env[AWS_EC2_METADATA_V1_DISABLED];
fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
if (envValue === void 0) {
throw new import_property_provider.CredentialsProviderError(
`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`,
{ logger: init.logger }
);
}
return fallbackBlockedFromProcessEnv;
},
configFileSelector: (profile2) => {
const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
return fallbackBlockedFromProfile;
},
default: false,
},
{
profile,
}
)();
if (init.ec2MetadataV1Disabled || configValue) {
const causes = [];
if (init.ec2MetadataV1Disabled)
causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");
if (fallbackBlockedFromProfile)
causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
if (fallbackBlockedFromProcessEnv)
causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);
throw new InstanceMetadataV1FallbackError(
`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(
", "
)}].`
);
}
}
const imdsProfile = (
await retry(async () => {
let profile2;
try {
profile2 = await getProfile(options);
} catch (err) {
if (err.statusCode === 401) {
disableFetchToken = false;
}
throw err;
}
return profile2;
}, maxRetries2)
).trim();
return retry(async () => {
let creds;
try {
creds = await getCredentialsFromProfile(imdsProfile, options, init);
} catch (err) {
if (err.statusCode === 401) {
disableFetchToken = false;
}
throw err;
}
return creds;
}, maxRetries2);
}, "getCredentials");
return async () => {
const endpoint = await getInstanceMetadataEndpoint();
if (disableFetchToken) {
logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
return getCredentials(maxRetries, { ...endpoint, timeout });
} else {
let token;
try {
token = (await getMetadataToken({ ...endpoint, timeout })).toString();
} catch (error) {
if ((error == null ? void 0 : error.statusCode) === 400) {
throw Object.assign(error, {
message: "EC2 Metadata token request returned error",
});
} else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) {
disableFetchToken = true;
}
logger == null ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
return getCredentials(maxRetries, { ...endpoint, timeout });
}
return getCredentials(maxRetries, {
...endpoint,
headers: {
[X_AWS_EC2_METADATA_TOKEN]: token,
},
timeout,
});
}
};
}, "getInstanceMetadataProvider");
var getMetadataToken = /* @__PURE__ */ __name(
async (options) =>
httpRequest({
...options,
path: IMDS_TOKEN_PATH,
method: "PUT",
headers: {
"x-aws-ec2-metadata-token-ttl-seconds": "21600",
},
}),
"getMetadataToken"
);
var getProfile = /* @__PURE__ */ __name(
async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(),
"getProfile"
);
var getCredentialsFromProfile = /* @__PURE__ */ __name(async (profile, options, init) => {
const credentialsResponse = JSON.parse(
(
await httpRequest({
...options,
path: IMDS_PATH + profile,
})
).toString()
);
if (!isImdsCredentials(credentialsResponse)) {
throw new import_property_provider.CredentialsProviderError(
"Invalid response received from instance metadata service.",
{
logger: init.logger,
}
);
}
return fromImdsCredentials(credentialsResponse);
}, "getCredentialsFromProfile");
},
});
// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js
var require_checkUrl = __commonJS({
"node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkUrl = void 0;
var property_provider_1 = require_dist_cjs12();
var ECS_CONTAINER_HOST = "169.254.170.2";
var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
var checkUrl = (url, logger) => {
if (url.protocol === "https:") {
return;
}
if (
url.hostname === ECS_CONTAINER_HOST ||
url.hostname === EKS_CONTAINER_HOST_IPv4 ||
url.hostname === EKS_CONTAINER_HOST_IPv6
) {
return;
}
if (url.hostname.includes("[")) {
if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") {
return;
}
} else {
if (url.hostname === "localhost") {
return;
}
const ipComponents = url.hostname.split(".");
const inRange = (component) => {
const num = parseInt(component, 10);
return 0 <= num && num <= 255;
};
if (
ipComponents[0] === "127" &&
inRange(ipComponents[1]) &&
inRange(ipComponents[2]) &&
inRange(ipComponents[3]) &&
ipComponents.length === 4
) {
return;
}
}
throw new property_provider_1.CredentialsProviderError(
`URL not accepted. It must either be HTTPS or match one of the following:
- loopback CIDR 127.0.0.0/8 or [::1/128]
- ECS container host 169.254.170.2
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,
{ logger }
);
};
exports.checkUrl = checkUrl;
},
});
// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js
var require_requestHelpers = __commonJS({
"node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCredentials = exports.createGetRequest = void 0;
var property_provider_1 = require_dist_cjs12();
var protocol_http_1 = require_dist_cjs2();
var smithy_client_1 = require_dist_cjs32();
var util_stream_1 = require_dist_cjs31();
function createGetRequest(url) {
return new protocol_http_1.HttpRequest({
protocol: url.protocol,
hostname: url.hostname,
port: Number(url.port),
path: url.pathname,
query: Array.from(url.searchParams.entries()).reduce((acc, [k, v]) => {
acc[k] = v;
return acc;
}, {}),
fragment: url.hash,
});
}
exports.createGetRequest = createGetRequest;
async function getCredentials(response, logger) {
const stream = (0, util_stream_1.sdkStreamMixin)(response.body);
const str = await stream.transformToString();
if (response.statusCode === 200) {
const parsed = JSON.parse(str);
if (
typeof parsed.AccessKeyId !== "string" ||
typeof parsed.SecretAccessKey !== "string" ||
typeof parsed.Token !== "string" ||
typeof parsed.Expiration !== "string"
) {
throw new property_provider_1.CredentialsProviderError(
"HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",
{ logger }
);
}
return {
accessKeyId: parsed.AccessKeyId,
secretAccessKey: parsed.SecretAccessKey,
sessionToken: parsed.Token,
expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration),
};
}
if (response.statusCode >= 400 && response.statusCode < 500) {
let parsedBody = {};
try {
parsedBody = JSON.parse(str);
} catch (e) {}
throw Object.assign(
new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, {
logger,
}),
{
Code: parsedBody.Code,
Message: parsedBody.Message,
}
);
}
throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, {
logger,
});
}
exports.getCredentials = getCredentials;
},
});
// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js
var require_retry_wrapper = __commonJS({
"node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.retryWrapper = void 0;
var retryWrapper = (toRetry, maxRetries, delayMs) => {
return async () => {
for (let i = 0; i < maxRetries; ++i) {
try {
return await toRetry();
} catch (e) {
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
}
return await toRetry();
};
};
exports.retryWrapper = retryWrapper;
},
});
// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js
var require_fromHttp = __commonJS({
"node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromHttp = void 0;
var tslib_1 = require_tslib();
var node_http_handler_1 = require_dist_cjs28();
var property_provider_1 = require_dist_cjs12();
var promises_1 = tslib_1.__importDefault(require("fs/promises"));
var checkUrl_1 = require_checkUrl();
var requestHelpers_1 = require_requestHelpers();
var retry_wrapper_1 = require_retry_wrapper();
var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
var fromHttp = (options = {}) => {
var _a, _b, _c;
(_a = options.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-http - fromHttp");
let host;
const relative =
options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
const tokenFile =
options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
const warn =
((_c = (_b = options.logger) == null ? void 0 : _b.constructor) == null ? void 0 : _c.name) === "NoOpLogger" ||
!options.logger
? console.warn
: options.logger.warn;
if (relative && full) {
warn(
"@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."
);
warn("awsContainerCredentialsFullUri will take precedence.");
}
if (token && tokenFile) {
warn(
"@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."
);
warn("awsContainerAuthorizationToken will take precedence.");
}
if (full) {
host = full;
} else if (relative) {
host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`;
} else {
throw new property_provider_1.CredentialsProviderError(
`No HTTP credential provider host provided.
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,
{ logger: options.logger }
);
}
const url = new URL(host);
(0, checkUrl_1.checkUrl)(url, options.logger);
const requestHandler = new node_http_handler_1.NodeHttpHandler({
requestTimeout: options.timeout ?? 1e3,
connectionTimeout: options.timeout ?? 1e3,
});
return (0, retry_wrapper_1.retryWrapper)(
async () => {
const request = (0, requestHelpers_1.createGetRequest)(url);
if (token) {
request.headers.Authorization = token;
} else if (tokenFile) {
request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString();
}
try {
const result = await requestHandler.handle(request);
return (0, requestHelpers_1.getCredentials)(result.response);
} catch (e) {
throw new property_provider_1.CredentialsProviderError(String(e), {
logger: options.logger,
});
}
},
options.maxRetries ?? 3,
options.timeout ?? 1e3
);
};
exports.fromHttp = fromHttp;
},
});
// node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js
var require_dist_cjs40 = __commonJS({
"node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromHttp = void 0;
var fromHttp_1 = require_fromHttp();
Object.defineProperty(exports, "fromHttp", {
enumerable: true,
get: () => fromHttp_1.fromHttp,
});
},
});
// node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js
var require_httpAuthSchemeProvider2 = __commonJS({
"node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHttpAuthSchemeConfig =
exports.defaultSSOHttpAuthSchemeProvider =
exports.defaultSSOHttpAuthSchemeParametersProvider =
void 0;
var core_1 = require_dist_cjs37();
var util_middleware_1 = require_dist_cjs10();
var defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
return {
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
region:
(await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
(() => {
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
})(),
};
};
exports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;
function createAwsAuthSigv4HttpAuthOption(authParameters) {
return {
schemeId: "aws.auth#sigv4",
signingProperties: {
name: "awsssoportal",
region: authParameters.region,
},
propertiesExtractor: (config, context) => ({
signingProperties: {
config,
context,
},
}),
};
}
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
return {
schemeId: "smithy.api#noAuth",
};
}
var defaultSSOHttpAuthSchemeProvider = (authParameters) => {
const options = [];
switch (authParameters.operation) {
case "GetRoleCredentials": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "ListAccountRoles": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "ListAccounts": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "Logout": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
default: {
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
}
}
return options;
};
exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;
var resolveHttpAuthSchemeConfig = (config) => {
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
return {
...config_0,
};
};
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
},
});
// node_modules/@aws-sdk/client-sso/package.json
var require_package2 = __commonJS({
"node_modules/@aws-sdk/client-sso/package.json"(exports, module2) {
module2.exports = {
name: "@aws-sdk/client-sso",
description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
version: "3.598.0",
scripts: {
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
"build:cjs": "node ../../scripts/compilation/inline client-sso",
"build:es": "tsc -p tsconfig.es.json",
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo sso",
},
main: "./dist-cjs/index.js",
types: "./dist-types/index.d.ts",
module: "./dist-es/index.js",
sideEffects: false,
dependencies: {
"@aws-crypto/sha256-browser": "5.2.0",
"@aws-crypto/sha256-js": "5.2.0",
"@aws-sdk/core": "3.598.0",
"@aws-sdk/middleware-host-header": "3.598.0",
"@aws-sdk/middleware-logger": "3.598.0",
"@aws-sdk/middleware-recursion-detection": "3.598.0",
"@aws-sdk/middleware-user-agent": "3.598.0",
"@aws-sdk/region-config-resolver": "3.598.0",
"@aws-sdk/types": "3.598.0",
"@aws-sdk/util-endpoints": "3.598.0",
"@aws-sdk/util-user-agent-browser": "3.598.0",
"@aws-sdk/util-user-agent-node": "3.598.0",
"@smithy/config-resolver": "^3.0.2",
"@smithy/core": "^2.2.1",
"@smithy/fetch-http-handler": "^3.0.2",
"@smithy/hash-node": "^3.0.1",
"@smithy/invalid-dependency": "^3.0.1",
"@smithy/middleware-content-length": "^3.0.1",
"@smithy/middleware-endpoint": "^3.0.2",
"@smithy/middleware-retry": "^3.0.4",
"@smithy/middleware-serde": "^3.0.1",
"@smithy/middleware-stack": "^3.0.1",
"@smithy/node-config-provider": "^3.1.1",
"@smithy/node-http-handler": "^3.0.1",
"@smithy/protocol-http": "^4.0.1",
"@smithy/smithy-client": "^3.1.2",
"@smithy/types": "^3.1.0",
"@smithy/url-parser": "^3.0.1",
"@smithy/util-base64": "^3.0.0",
"@smithy/util-body-length-browser": "^3.0.0",
"@smithy/util-body-length-node": "^3.0.0",
"@smithy/util-defaults-mode-browser": "^3.0.4",
"@smithy/util-defaults-mode-node": "^3.0.4",
"@smithy/util-endpoints": "^2.0.2",
"@smithy/util-middleware": "^3.0.1",
"@smithy/util-retry": "^3.0.1",
"@smithy/util-utf8": "^3.0.0",
tslib: "^2.6.2",
},
devDependencies: {
"@tsconfig/node16": "16.1.3",
"@types/node": "^16.18.96",
concurrently: "7.0.0",
"downlevel-dts": "0.10.1",
rimraf: "3.0.2",
typescript: "~4.9.5",
},
engines: {
node: ">=16.0.0",
},
typesVersions: {
"<4.0": {
"dist-types/*": ["dist-types/ts3.4/*"],
},
},
files: ["dist-*/**"],
author: {
name: "AWS SDK for JavaScript Team",
url: "https://aws.amazon.com/javascript/",
},
license: "Apache-2.0",
browser: {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser",
},
"react-native": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native",
},
homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",
repository: {
type: "git",
url: "https://github.com/aws/aws-sdk-js-v3.git",
directory: "clients/client-sso",
},
};
},
});
// node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js
var require_dist_cjs41 = __commonJS({
"node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME,
UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME,
crtAvailability: () => crtAvailability,
defaultUserAgent: () => defaultUserAgent,
});
module2.exports = __toCommonJS2(src_exports);
var import_node_config_provider = require_dist_cjs14();
var import_os = require("os");
var import_process = require("process");
var crtAvailability = {
isCrtAvailable: false,
};
var isCrtAvailable = /* @__PURE__ */ __name(() => {
if (crtAvailability.isCrtAvailable) {
return ["md/crt-avail"];
}
return null;
}, "isCrtAvailable");
var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
var UA_APP_ID_INI_NAME = "sdk-ua-app-id";
var defaultUserAgent = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
const sections = [
["aws-sdk-js", clientVersion],
["ua", "2.0"],
[`os/${(0, import_os.platform)()}`, (0, import_os.release)()],
["lang/js"],
["md/nodejs", `${import_process.versions.node}`],
];
const crtAvailable = isCrtAvailable();
if (crtAvailable) {
sections.push(crtAvailable);
}
if (serviceId) {
sections.push([`api/${serviceId}`, clientVersion]);
}
if (import_process.env.AWS_EXECUTION_ENV) {
sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]);
}
const appIdPromise = (0, import_node_config_provider.loadConfig)({
environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME],
default: void 0,
})();
let resolvedUserAgent = void 0;
return async () => {
if (!resolvedUserAgent) {
const appId = await appIdPromise;
resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
}
return resolvedUserAgent;
};
}, "defaultUserAgent");
},
});
// node_modules/@smithy/hash-node/dist-cjs/index.js
var require_dist_cjs42 = __commonJS({
"node_modules/@smithy/hash-node/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
Hash: () => Hash,
});
module2.exports = __toCommonJS2(src_exports);
var import_util_buffer_from = require_dist_cjs23();
var import_util_utf8 = require_dist_cjs24();
var import_buffer = require("buffer");
var import_crypto = require("crypto");
var _Hash = class _Hash {
constructor(algorithmIdentifier, secret) {
this.algorithmIdentifier = algorithmIdentifier;
this.secret = secret;
this.reset();
}
update(toHash, encoding) {
this.hash.update((0, import_util_utf8.toUint8Array)(castSourceData(toHash, encoding)));
}
digest() {
return Promise.resolve(this.hash.digest());
}
reset() {
this.hash = this.secret
? (0, import_crypto.createHmac)(this.algorithmIdentifier, castSourceData(this.secret))
: (0, import_crypto.createHash)(this.algorithmIdentifier);
}
};
__name(_Hash, "Hash");
var Hash = _Hash;
function castSourceData(toCast, encoding) {
if (import_buffer.Buffer.isBuffer(toCast)) {
return toCast;
}
if (typeof toCast === "string") {
return (0, import_util_buffer_from.fromString)(toCast, encoding);
}
if (ArrayBuffer.isView(toCast)) {
return (0, import_util_buffer_from.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength);
}
return (0, import_util_buffer_from.fromArrayBuffer)(toCast);
}
__name(castSourceData, "castSourceData");
},
});
// node_modules/@smithy/util-body-length-node/dist-cjs/index.js
var require_dist_cjs43 = __commonJS({
"node_modules/@smithy/util-body-length-node/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
calculateBodyLength: () => calculateBodyLength,
});
module2.exports = __toCommonJS2(src_exports);
var import_fs = require("fs");
var calculateBodyLength = /* @__PURE__ */ __name((body) => {
if (!body) {
return 0;
}
if (typeof body === "string") {
return Buffer.byteLength(body);
} else if (typeof body.byteLength === "number") {
return body.byteLength;
} else if (typeof body.size === "number") {
return body.size;
} else if (typeof body.start === "number" && typeof body.end === "number") {
return body.end + 1 - body.start;
} else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) {
return (0, import_fs.lstatSync)(body.path).size;
} else if (typeof body.fd === "number") {
return (0, import_fs.fstatSync)(body.fd).size;
}
throw new Error(`Body Length computation failed for ${body}`);
}, "calculateBodyLength");
},
});
// node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js
var require_ruleset = __commonJS({
"node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.ruleSet = void 0;
var u = "required";
var v = "fn";
var w = "argv";
var x = "ref";
var a = true;
var b = "isSet";
var c = "booleanEquals";
var d = "error";
var e = "endpoint";
var f = "tree";
var g = "PartitionResult";
var h = "getAttr";
var i = { [u]: false, type: "String" };
var j = { [u]: true, default: false, type: "Boolean" };
var k = { [x]: "Endpoint" };
var l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] };
var m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] };
var n = {};
var o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] };
var p = { [x]: g };
var q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] };
var r = [l];
var s = [m];
var t = [{ [x]: "Region" }];
var _data = {
version: "1.0",
parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i },
rules: [
{
conditions: [{ [v]: b, [w]: [k] }],
rules: [
{
conditions: r,
error: "Invalid Configuration: FIPS and custom endpoint are not supported",
type: d,
},
{
conditions: s,
error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
type: d,
},
{ endpoint: { url: k, properties: n, headers: n }, type: e },
],
type: f,
},
{
conditions: [{ [v]: b, [w]: t }],
rules: [
{
conditions: [{ [v]: "aws.partition", [w]: t, assign: g }],
rules: [
{
conditions: [l, m],
rules: [
{
conditions: [{ [v]: c, [w]: [a, o] }, q],
rules: [
{
endpoint: {
url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
{
error: "FIPS and DualStack are enabled, but this partition does not support one or both",
type: d,
},
],
type: f,
},
{
conditions: r,
rules: [
{
conditions: [{ [v]: c, [w]: [o, a] }],
rules: [
{
conditions: [
{
[v]: "stringEquals",
[w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"],
},
],
endpoint: {
url: "https://portal.sso.{Region}.amazonaws.com",
properties: n,
headers: n,
},
type: e,
},
{
endpoint: {
url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
{ error: "FIPS is enabled but this partition does not support FIPS", type: d },
],
type: f,
},
{
conditions: s,
rules: [
{
conditions: [q],
rules: [
{
endpoint: {
url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
{
error: "DualStack is enabled but this partition does not support DualStack",
type: d,
},
],
type: f,
},
{
endpoint: {
url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
],
type: f,
},
{ error: "Invalid Configuration: Missing Region", type: d },
],
};
exports.ruleSet = _data;
},
});
// node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js
var require_endpointResolver = __commonJS({
"node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultEndpointResolver = void 0;
var util_endpoints_1 = require_dist_cjs7();
var util_endpoints_2 = require_dist_cjs6();
var ruleset_1 = require_ruleset();
var defaultEndpointResolver = (endpointParams, context = {}) => {
return (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
endpointParams,
logger: context.logger,
});
};
exports.defaultEndpointResolver = defaultEndpointResolver;
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
},
});
// node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js
var require_runtimeConfig_shared = __commonJS({
"node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var core_1 = require_dist_cjs37();
var core_2 = require_dist_cjs34();
var smithy_client_1 = require_dist_cjs32();
var url_parser_1 = require_dist_cjs16();
var util_base64_1 = require_dist_cjs25();
var util_utf8_1 = require_dist_cjs24();
var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider2();
var endpointResolver_1 = require_endpointResolver();
var getRuntimeConfig = (config) => {
return {
apiVersion: "2019-06-10",
base64Decoder: (config == null ? void 0 : config.base64Decoder) ?? util_base64_1.fromBase64,
base64Encoder: (config == null ? void 0 : config.base64Encoder) ?? util_base64_1.toBase64,
disableHostPrefix: (config == null ? void 0 : config.disableHostPrefix) ?? false,
endpointProvider:
(config == null ? void 0 : config.endpointProvider) ?? endpointResolver_1.defaultEndpointResolver,
extensions: (config == null ? void 0 : config.extensions) ?? [],
httpAuthSchemeProvider:
(config == null ? void 0 : config.httpAuthSchemeProvider) ??
httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,
httpAuthSchemes: (config == null ? void 0 : config.httpAuthSchemes) ?? [
{
schemeId: "aws.auth#sigv4",
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
signer: new core_1.AwsSdkSigV4Signer(),
},
{
schemeId: "smithy.api#noAuth",
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
signer: new core_2.NoAuthSigner(),
},
],
logger: (config == null ? void 0 : config.logger) ?? new smithy_client_1.NoOpLogger(),
serviceId: (config == null ? void 0 : config.serviceId) ?? "SSO",
urlParser: (config == null ? void 0 : config.urlParser) ?? url_parser_1.parseUrl,
utf8Decoder: (config == null ? void 0 : config.utf8Decoder) ?? util_utf8_1.fromUtf8,
utf8Encoder: (config == null ? void 0 : config.utf8Encoder) ?? util_utf8_1.toUtf8,
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js
var require_dist_cjs44 = __commonJS({
"node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js"(exports, module2) {
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (
(target = mod != null ? __create2(__getProtoOf2(mod)) : {}),
__copyProps2(
isNodeMode || !mod || !mod.__esModule
? __defProp2(target, "default", { value: mod, enumerable: true })
: target,
mod
)
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
resolveDefaultsModeConfig: () => resolveDefaultsModeConfig,
});
module2.exports = __toCommonJS2(src_exports);
var import_config_resolver = require_dist_cjs11();
var import_node_config_provider = require_dist_cjs14();
var import_property_provider = require_dist_cjs12();
var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
var AWS_REGION_ENV = "AWS_REGION";
var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];
var IMDS_REGION_PATH = "/latest/meta-data/placement/region";
var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE";
var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode";
var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => {
return env[AWS_DEFAULTS_MODE_ENV];
},
configFileSelector: (profile) => {
return profile[AWS_DEFAULTS_MODE_CONFIG];
},
default: "legacy",
};
var resolveDefaultsModeConfig = /* @__PURE__ */ __name(
({
region = (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_REGION_CONFIG_OPTIONS),
defaultsMode = (0, import_node_config_provider.loadConfig)(NODE_DEFAULTS_MODE_CONFIG_OPTIONS),
} = {}) =>
(0, import_property_provider.memoize)(async () => {
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
switch (mode == null ? void 0 : mode.toLowerCase()) {
case "auto":
return resolveNodeDefaultsModeAuto(region);
case "in-region":
case "cross-region":
case "mobile":
case "standard":
case "legacy":
return Promise.resolve(mode == null ? void 0 : mode.toLocaleLowerCase());
case void 0:
return Promise.resolve("legacy");
default:
throw new Error(
`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`
);
}
}),
"resolveDefaultsModeConfig"
);
var resolveNodeDefaultsModeAuto = /* @__PURE__ */ __name(async (clientRegion) => {
if (clientRegion) {
const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion;
const inferredRegion = await inferPhysicalRegion();
if (!inferredRegion) {
return "standard";
}
if (resolvedRegion === inferredRegion) {
return "in-region";
} else {
return "cross-region";
}
}
return "standard";
}, "resolveNodeDefaultsModeAuto");
var inferPhysicalRegion = /* @__PURE__ */ __name(async () => {
if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
}
if (!process.env[ENV_IMDS_DISABLED]) {
try {
const { getInstanceMetadataEndpoint, httpRequest } = await Promise.resolve().then(() =>
__toESM2(require_dist_cjs39())
);
const endpoint = await getInstanceMetadataEndpoint();
return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString();
} catch (e) {}
}
}, "inferPhysicalRegion");
},
});
// node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js
var require_runtimeConfig = __commonJS({
"node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var tslib_1 = require_tslib();
var package_json_1 = tslib_1.__importDefault(require_package2());
var core_1 = require_dist_cjs37();
var util_user_agent_node_1 = require_dist_cjs41();
var config_resolver_1 = require_dist_cjs11();
var hash_node_1 = require_dist_cjs42();
var middleware_retry_1 = require_dist_cjs33();
var node_config_provider_1 = require_dist_cjs14();
var node_http_handler_1 = require_dist_cjs28();
var util_body_length_node_1 = require_dist_cjs43();
var util_retry_1 = require_dist_cjs20();
var runtimeConfig_shared_1 = require_runtimeConfig_shared();
var smithy_client_1 = require_dist_cjs32();
var util_defaults_mode_node_1 = require_dist_cjs44();
var smithy_client_2 = require_dist_cjs32();
var getRuntimeConfig = (config) => {
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
bodyLengthChecker:
(config == null ? void 0 : config.bodyLengthChecker) ?? util_body_length_node_1.calculateBodyLength,
defaultUserAgentProvider:
(config == null ? void 0 : config.defaultUserAgentProvider) ??
(0, util_user_agent_node_1.defaultUserAgent)({
serviceId: clientSharedValues.serviceId,
clientVersion: package_json_1.default.version,
}),
maxAttempts:
(config == null ? void 0 : config.maxAttempts) ??
(0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region:
(config == null ? void 0 : config.region) ??
(0, node_config_provider_1.loadConfig)(
config_resolver_1.NODE_REGION_CONFIG_OPTIONS,
config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS
),
requestHandler: node_http_handler_1.NodeHttpHandler.create(
(config == null ? void 0 : config.requestHandler) ?? defaultConfigProvider
),
retryMode:
(config == null ? void 0 : config.retryMode) ??
(0, node_config_provider_1.loadConfig)({
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
}),
sha256: (config == null ? void 0 : config.sha256) ?? hash_node_1.Hash.bind(null, "sha256"),
streamCollector: (config == null ? void 0 : config.streamCollector) ?? node_http_handler_1.streamCollector,
useDualstackEndpoint:
(config == null ? void 0 : config.useDualstackEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
useFipsEndpoint:
(config == null ? void 0 : config.useFipsEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js
var require_dist_cjs45 = __commonJS({
"node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
NODE_REGION_CONFIG_FILE_OPTIONS: () => NODE_REGION_CONFIG_FILE_OPTIONS,
NODE_REGION_CONFIG_OPTIONS: () => NODE_REGION_CONFIG_OPTIONS,
REGION_ENV_NAME: () => REGION_ENV_NAME,
REGION_INI_NAME: () => REGION_INI_NAME,
getAwsRegionExtensionConfiguration: () => getAwsRegionExtensionConfiguration,
resolveAwsRegionExtensionConfiguration: () => resolveAwsRegionExtensionConfiguration,
resolveRegionConfig: () => resolveRegionConfig,
});
module2.exports = __toCommonJS2(src_exports);
var getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
let runtimeConfigRegion = /* @__PURE__ */ __name(async () => {
if (runtimeConfig.region === void 0) {
throw new Error("Region is missing from runtimeConfig");
}
const region = runtimeConfig.region;
if (typeof region === "string") {
return region;
}
return region();
}, "runtimeConfigRegion");
return {
setRegion(region) {
runtimeConfigRegion = region;
},
region() {
return runtimeConfigRegion;
},
};
}, "getAwsRegionExtensionConfiguration");
var resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => {
return {
region: awsRegionExtensionConfiguration.region(),
};
}, "resolveAwsRegionExtensionConfiguration");
var REGION_ENV_NAME = "AWS_REGION";
var REGION_INI_NAME = "region";
var NODE_REGION_CONFIG_OPTIONS = {
environmentVariableSelector: (env) => env[REGION_ENV_NAME],
configFileSelector: (profile) => profile[REGION_INI_NAME],
default: () => {
throw new Error("Region is missing");
},
};
var NODE_REGION_CONFIG_FILE_OPTIONS = {
preferredFile: "credentials",
};
var isFipsRegion = /* @__PURE__ */ __name(
(region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")),
"isFipsRegion"
);
var getRealRegion = /* @__PURE__ */ __name(
(region) =>
isFipsRegion(region)
? ["fips-aws-global", "aws-fips"].includes(region)
? "us-east-1"
: region.replace(/fips-(dkr-|prod-)?|-fips/, "")
: region,
"getRealRegion"
);
var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
const { region, useFipsEndpoint } = input;
if (!region) {
throw new Error("Region is missing");
}
return {
...input,
region: async () => {
if (typeof region === "string") {
return getRealRegion(region);
}
const providedRegion = await region();
return getRealRegion(providedRegion);
},
useFipsEndpoint: async () => {
const providedRegion = typeof region === "string" ? region : await region();
if (isFipsRegion(providedRegion)) {
return true;
}
return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
},
};
}, "resolveRegionConfig");
},
});
// node_modules/@aws-sdk/client-sso/dist-cjs/index.js
var require_dist_cjs46 = __commonJS({
"node_modules/@aws-sdk/client-sso/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
GetRoleCredentialsCommand: () => GetRoleCredentialsCommand,
GetRoleCredentialsRequestFilterSensitiveLog: () => GetRoleCredentialsRequestFilterSensitiveLog,
GetRoleCredentialsResponseFilterSensitiveLog: () => GetRoleCredentialsResponseFilterSensitiveLog,
InvalidRequestException: () => InvalidRequestException,
ListAccountRolesCommand: () => ListAccountRolesCommand,
ListAccountRolesRequestFilterSensitiveLog: () => ListAccountRolesRequestFilterSensitiveLog,
ListAccountsCommand: () => ListAccountsCommand,
ListAccountsRequestFilterSensitiveLog: () => ListAccountsRequestFilterSensitiveLog,
LogoutCommand: () => LogoutCommand,
LogoutRequestFilterSensitiveLog: () => LogoutRequestFilterSensitiveLog,
ResourceNotFoundException: () => ResourceNotFoundException,
RoleCredentialsFilterSensitiveLog: () => RoleCredentialsFilterSensitiveLog,
SSO: () => SSO,
SSOClient: () => SSOClient,
SSOServiceException: () => SSOServiceException,
TooManyRequestsException: () => TooManyRequestsException,
UnauthorizedException: () => UnauthorizedException,
__Client: () => import_smithy_client.Client,
paginateListAccountRoles: () => paginateListAccountRoles,
paginateListAccounts: () => paginateListAccounts,
});
module2.exports = __toCommonJS2(src_exports);
var import_middleware_host_header = require_dist_cjs3();
var import_middleware_logger = require_dist_cjs4();
var import_middleware_recursion_detection = require_dist_cjs5();
var import_middleware_user_agent = require_dist_cjs8();
var import_config_resolver = require_dist_cjs11();
var import_core = require_dist_cjs34();
var import_middleware_content_length = require_dist_cjs35();
var import_middleware_endpoint = require_dist_cjs18();
var import_middleware_retry = require_dist_cjs33();
var import_httpAuthSchemeProvider = require_httpAuthSchemeProvider2();
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
return {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
defaultSigningName: "awsssoportal",
};
}, "resolveClientEndpointParameters");
var commonParams = {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
var import_runtimeConfig = require_runtimeConfig();
var import_region_config_resolver = require_dist_cjs45();
var import_protocol_http = require_dist_cjs2();
var import_smithy_client = require_dist_cjs32();
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
let _credentials = runtimeConfig.credentials;
return {
setHttpAuthScheme(httpAuthScheme) {
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
if (index === -1) {
_httpAuthSchemes.push(httpAuthScheme);
} else {
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
}
},
httpAuthSchemes() {
return _httpAuthSchemes;
},
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
_httpAuthSchemeProvider = httpAuthSchemeProvider;
},
httpAuthSchemeProvider() {
return _httpAuthSchemeProvider;
},
setCredentials(credentials) {
_credentials = credentials;
},
credentials() {
return _credentials;
},
};
}, "getHttpAuthExtensionConfiguration");
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
return {
httpAuthSchemes: config.httpAuthSchemes(),
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
credentials: config.credentials(),
};
}, "resolveHttpAuthRuntimeConfig");
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
const extensionConfiguration = {
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
};
extensions.forEach((extension) => extension.configure(extensionConfiguration));
return {
...runtimeConfig,
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
};
}, "resolveRuntimeExtensions");
var _SSOClient = class _SSOClient extends import_smithy_client.Client {
constructor(...[configuration]) {
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
const _config_8 = resolveRuntimeExtensions(
_config_7,
(configuration == null ? void 0 : configuration.extensions) || []
);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
this.middlewareStack.use(
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
})
);
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
}
destroy() {
super.destroy();
}
getDefaultHttpAuthSchemeParametersProvider() {
return import_httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider;
}
getIdentityProviderConfigProvider() {
return async (config) =>
new import_core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials,
});
}
};
__name(_SSOClient, "SSOClient");
var SSOClient = _SSOClient;
var import_middleware_serde = require_dist_cjs17();
var _SSOServiceException = class _SSOServiceException2 extends import_smithy_client.ServiceException {
constructor(options) {
super(options);
Object.setPrototypeOf(this, _SSOServiceException2.prototype);
}
};
__name(_SSOServiceException, "SSOServiceException");
var SSOServiceException = _SSOServiceException;
var _InvalidRequestException = class _InvalidRequestException2 extends SSOServiceException {
constructor(opts) {
super({
name: "InvalidRequestException",
$fault: "client",
...opts,
});
this.name = "InvalidRequestException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidRequestException2.prototype);
}
};
__name(_InvalidRequestException, "InvalidRequestException");
var InvalidRequestException = _InvalidRequestException;
var _ResourceNotFoundException = class _ResourceNotFoundException2 extends SSOServiceException {
constructor(opts) {
super({
name: "ResourceNotFoundException",
$fault: "client",
...opts,
});
this.name = "ResourceNotFoundException";
this.$fault = "client";
Object.setPrototypeOf(this, _ResourceNotFoundException2.prototype);
}
};
__name(_ResourceNotFoundException, "ResourceNotFoundException");
var ResourceNotFoundException = _ResourceNotFoundException;
var _TooManyRequestsException = class _TooManyRequestsException2 extends SSOServiceException {
constructor(opts) {
super({
name: "TooManyRequestsException",
$fault: "client",
...opts,
});
this.name = "TooManyRequestsException";
this.$fault = "client";
Object.setPrototypeOf(this, _TooManyRequestsException2.prototype);
}
};
__name(_TooManyRequestsException, "TooManyRequestsException");
var TooManyRequestsException = _TooManyRequestsException;
var _UnauthorizedException = class _UnauthorizedException2 extends SSOServiceException {
constructor(opts) {
super({
name: "UnauthorizedException",
$fault: "client",
...opts,
});
this.name = "UnauthorizedException";
this.$fault = "client";
Object.setPrototypeOf(this, _UnauthorizedException2.prototype);
}
};
__name(_UnauthorizedException, "UnauthorizedException");
var UnauthorizedException = _UnauthorizedException;
var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }),
}),
"GetRoleCredentialsRequestFilterSensitiveLog"
);
var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.secretAccessKey && { secretAccessKey: import_smithy_client.SENSITIVE_STRING }),
...(obj.sessionToken && { sessionToken: import_smithy_client.SENSITIVE_STRING }),
}),
"RoleCredentialsFilterSensitiveLog"
);
var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.roleCredentials && {
roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials),
}),
}),
"GetRoleCredentialsResponseFilterSensitiveLog"
);
var ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }),
}),
"ListAccountRolesRequestFilterSensitiveLog"
);
var ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }),
}),
"ListAccountsRequestFilterSensitiveLog"
);
var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }),
}),
"LogoutRequestFilterSensitiveLog"
);
var import_core2 = require_dist_cjs37();
var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT],
});
b.bp("/federation/credentials");
const query = (0, import_smithy_client.map)({
[_rn]: [, (0, import_smithy_client.expectNonNull)(input[_rN], `roleName`)],
[_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetRoleCredentialsCommand");
var se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT],
});
b.bp("/assignment/roles");
const query = (0, import_smithy_client.map)({
[_nt]: [, input[_nT]],
[_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
[_ai]: [, (0, import_smithy_client.expectNonNull)(input[_aI], `accountId`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListAccountRolesCommand");
var se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT],
});
b.bp("/assignment/accounts");
const query = (0, import_smithy_client.map)({
[_nt]: [, input[_nT]],
[_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListAccountsCommand");
var se_LogoutCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
[_xasbt]: input[_aT],
});
b.bp("/logout");
let body;
b.m("POST").h(headers).b(body);
return b.build();
}, "se_LogoutCommand");
var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
roleCredentials: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetRoleCredentialsCommand");
var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
nextToken: import_smithy_client.expectString,
roleList: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_ListAccountRolesCommand");
var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
accountList: import_smithy_client._json,
nextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListAccountsCommand");
var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_LogoutCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
const parsedOutput = {
...output,
body: await (0, import_core2.parseJsonErrorBody)(output.body, context),
};
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
switch (errorCode) {
case "InvalidRequestException":
case "com.amazonaws.sso#InvalidRequestException":
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
case "ResourceNotFoundException":
case "com.amazonaws.sso#ResourceNotFoundException":
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
case "TooManyRequestsException":
case "com.amazonaws.sso#TooManyRequestsException":
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
case "UnauthorizedException":
case "com.amazonaws.sso#UnauthorizedException":
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
default: {
const parsedBody = parsedOutput.body;
return throwDefaultError({
output,
parsedBody,
errorCode,
});
}
}
}, "de_CommandError");
var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOServiceException);
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidRequestException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidRequestExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new ResourceNotFoundException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new TooManyRequestsException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_TooManyRequestsExceptionRes");
var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new UnauthorizedException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_UnauthorizedExceptionRes");
var deserializeMetadata = /* @__PURE__ */ __name(
(output) => ({
httpStatusCode: output.statusCode,
requestId:
output.headers["x-amzn-requestid"] ??
output.headers["x-amzn-request-id"] ??
output.headers["x-amz-request-id"],
extendedRequestId: output.headers["x-amz-id-2"],
cfId: output.headers["x-amz-cf-id"],
}),
"deserializeMetadata"
);
var isSerializableHeaderValue = /* @__PURE__ */ __name(
(value) =>
value !== void 0 &&
value !== null &&
value !== "" &&
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0),
"isSerializableHeaderValue"
);
var _aI = "accountId";
var _aT = "accessToken";
var _ai = "account_id";
var _mR = "maxResults";
var _mr = "max_result";
var _nT = "nextToken";
var _nt = "next_token";
var _rN = "roleName";
var _rn = "role_name";
var _xasbt = "x-amz-sso_bearer_token";
var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("SWBPortalService", "GetRoleCredentials", {})
.n("SSOClient", "GetRoleCredentialsCommand")
.f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog)
.ser(se_GetRoleCredentialsCommand)
.de(de_GetRoleCredentialsCommand)
.build() {};
__name(_GetRoleCredentialsCommand, "GetRoleCredentialsCommand");
var GetRoleCredentialsCommand = _GetRoleCredentialsCommand;
var _ListAccountRolesCommand = class _ListAccountRolesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("SWBPortalService", "ListAccountRoles", {})
.n("SSOClient", "ListAccountRolesCommand")
.f(ListAccountRolesRequestFilterSensitiveLog, void 0)
.ser(se_ListAccountRolesCommand)
.de(de_ListAccountRolesCommand)
.build() {};
__name(_ListAccountRolesCommand, "ListAccountRolesCommand");
var ListAccountRolesCommand = _ListAccountRolesCommand;
var _ListAccountsCommand = class _ListAccountsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("SWBPortalService", "ListAccounts", {})
.n("SSOClient", "ListAccountsCommand")
.f(ListAccountsRequestFilterSensitiveLog, void 0)
.ser(se_ListAccountsCommand)
.de(de_ListAccountsCommand)
.build() {};
__name(_ListAccountsCommand, "ListAccountsCommand");
var ListAccountsCommand = _ListAccountsCommand;
var _LogoutCommand = class _LogoutCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("SWBPortalService", "Logout", {})
.n("SSOClient", "LogoutCommand")
.f(LogoutRequestFilterSensitiveLog, void 0)
.ser(se_LogoutCommand)
.de(de_LogoutCommand)
.build() {};
__name(_LogoutCommand, "LogoutCommand");
var LogoutCommand = _LogoutCommand;
var commands = {
GetRoleCredentialsCommand,
ListAccountRolesCommand,
ListAccountsCommand,
LogoutCommand,
};
var _SSO = class _SSO extends SSOClient {};
__name(_SSO, "SSO");
var SSO = _SSO;
(0, import_smithy_client.createAggregatedClient)(commands, SSO);
var paginateListAccountRoles = (0, import_core.createPaginator)(
SSOClient,
ListAccountRolesCommand,
"nextToken",
"nextToken",
"maxResults"
);
var paginateListAccounts = (0, import_core.createPaginator)(
SSOClient,
ListAccountsCommand,
"nextToken",
"nextToken",
"maxResults"
);
},
});
// node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js
var require_httpAuthSchemeProvider3 = __commonJS({
"node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHttpAuthSchemeConfig =
exports.defaultSSOOIDCHttpAuthSchemeProvider =
exports.defaultSSOOIDCHttpAuthSchemeParametersProvider =
void 0;
var core_1 = require_dist_cjs37();
var util_middleware_1 = require_dist_cjs10();
var defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
return {
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
region:
(await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
(() => {
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
})(),
};
};
exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = defaultSSOOIDCHttpAuthSchemeParametersProvider;
function createAwsAuthSigv4HttpAuthOption(authParameters) {
return {
schemeId: "aws.auth#sigv4",
signingProperties: {
name: "sso-oauth",
region: authParameters.region,
},
propertiesExtractor: (config, context) => ({
signingProperties: {
config,
context,
},
}),
};
}
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
return {
schemeId: "smithy.api#noAuth",
};
}
var defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
const options = [];
switch (authParameters.operation) {
case "CreateToken": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "RegisterClient": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "StartDeviceAuthorization": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
default: {
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
}
}
return options;
};
exports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider;
var resolveHttpAuthSchemeConfig = (config) => {
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
return {
...config_0,
};
};
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
},
});
// node_modules/@aws-sdk/client-sso-oidc/package.json
var require_package3 = __commonJS({
"node_modules/@aws-sdk/client-sso-oidc/package.json"(exports, module2) {
module2.exports = {
name: "@aws-sdk/client-sso-oidc",
description: "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",
version: "3.600.0",
scripts: {
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
"build:cjs": "node ../../scripts/compilation/inline client-sso-oidc",
"build:es": "tsc -p tsconfig.es.json",
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo sso-oidc",
},
main: "./dist-cjs/index.js",
types: "./dist-types/index.d.ts",
module: "./dist-es/index.js",
sideEffects: false,
dependencies: {
"@aws-crypto/sha256-browser": "5.2.0",
"@aws-crypto/sha256-js": "5.2.0",
"@aws-sdk/client-sts": "3.600.0",
"@aws-sdk/core": "3.598.0",
"@aws-sdk/credential-provider-node": "3.600.0",
"@aws-sdk/middleware-host-header": "3.598.0",
"@aws-sdk/middleware-logger": "3.598.0",
"@aws-sdk/middleware-recursion-detection": "3.598.0",
"@aws-sdk/middleware-user-agent": "3.598.0",
"@aws-sdk/region-config-resolver": "3.598.0",
"@aws-sdk/types": "3.598.0",
"@aws-sdk/util-endpoints": "3.598.0",
"@aws-sdk/util-user-agent-browser": "3.598.0",
"@aws-sdk/util-user-agent-node": "3.598.0",
"@smithy/config-resolver": "^3.0.2",
"@smithy/core": "^2.2.1",
"@smithy/fetch-http-handler": "^3.0.2",
"@smithy/hash-node": "^3.0.1",
"@smithy/invalid-dependency": "^3.0.1",
"@smithy/middleware-content-length": "^3.0.1",
"@smithy/middleware-endpoint": "^3.0.2",
"@smithy/middleware-retry": "^3.0.4",
"@smithy/middleware-serde": "^3.0.1",
"@smithy/middleware-stack": "^3.0.1",
"@smithy/node-config-provider": "^3.1.1",
"@smithy/node-http-handler": "^3.0.1",
"@smithy/protocol-http": "^4.0.1",
"@smithy/smithy-client": "^3.1.2",
"@smithy/types": "^3.1.0",
"@smithy/url-parser": "^3.0.1",
"@smithy/util-base64": "^3.0.0",
"@smithy/util-body-length-browser": "^3.0.0",
"@smithy/util-body-length-node": "^3.0.0",
"@smithy/util-defaults-mode-browser": "^3.0.4",
"@smithy/util-defaults-mode-node": "^3.0.4",
"@smithy/util-endpoints": "^2.0.2",
"@smithy/util-middleware": "^3.0.1",
"@smithy/util-retry": "^3.0.1",
"@smithy/util-utf8": "^3.0.0",
tslib: "^2.6.2",
},
devDependencies: {
"@tsconfig/node16": "16.1.3",
"@types/node": "^16.18.96",
concurrently: "7.0.0",
"downlevel-dts": "0.10.1",
rimraf: "3.0.2",
typescript: "~4.9.5",
},
engines: {
node: ">=16.0.0",
},
typesVersions: {
"<4.0": {
"dist-types/*": ["dist-types/ts3.4/*"],
},
},
files: ["dist-*/**"],
author: {
name: "AWS SDK for JavaScript Team",
url: "https://aws.amazon.com/javascript/",
},
license: "Apache-2.0",
browser: {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser",
},
"react-native": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native",
},
homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc",
repository: {
type: "git",
url: "https://github.com/aws/aws-sdk-js-v3.git",
directory: "clients/client-sso-oidc",
},
};
},
});
// node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js
var require_ruleset2 = __commonJS({
"node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.ruleSet = void 0;
var u = "required";
var v = "fn";
var w = "argv";
var x = "ref";
var a = true;
var b = "isSet";
var c = "booleanEquals";
var d = "error";
var e = "endpoint";
var f = "tree";
var g = "PartitionResult";
var h = "getAttr";
var i = { [u]: false, type: "String" };
var j = { [u]: true, default: false, type: "Boolean" };
var k = { [x]: "Endpoint" };
var l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] };
var m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] };
var n = {};
var o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] };
var p = { [x]: g };
var q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] };
var r = [l];
var s = [m];
var t = [{ [x]: "Region" }];
var _data = {
version: "1.0",
parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i },
rules: [
{
conditions: [{ [v]: b, [w]: [k] }],
rules: [
{
conditions: r,
error: "Invalid Configuration: FIPS and custom endpoint are not supported",
type: d,
},
{
conditions: s,
error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
type: d,
},
{ endpoint: { url: k, properties: n, headers: n }, type: e },
],
type: f,
},
{
conditions: [{ [v]: b, [w]: t }],
rules: [
{
conditions: [{ [v]: "aws.partition", [w]: t, assign: g }],
rules: [
{
conditions: [l, m],
rules: [
{
conditions: [{ [v]: c, [w]: [a, o] }, q],
rules: [
{
endpoint: {
url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
{
error: "FIPS and DualStack are enabled, but this partition does not support one or both",
type: d,
},
],
type: f,
},
{
conditions: r,
rules: [
{
conditions: [{ [v]: c, [w]: [o, a] }],
rules: [
{
conditions: [
{
[v]: "stringEquals",
[w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"],
},
],
endpoint: {
url: "https://oidc.{Region}.amazonaws.com",
properties: n,
headers: n,
},
type: e,
},
{
endpoint: {
url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
{ error: "FIPS is enabled but this partition does not support FIPS", type: d },
],
type: f,
},
{
conditions: s,
rules: [
{
conditions: [q],
rules: [
{
endpoint: {
url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
{
error: "DualStack is enabled but this partition does not support DualStack",
type: d,
},
],
type: f,
},
{
endpoint: {
url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}",
properties: n,
headers: n,
},
type: e,
},
],
type: f,
},
],
type: f,
},
{ error: "Invalid Configuration: Missing Region", type: d },
],
};
exports.ruleSet = _data;
},
});
// node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js
var require_endpointResolver2 = __commonJS({
"node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultEndpointResolver = void 0;
var util_endpoints_1 = require_dist_cjs7();
var util_endpoints_2 = require_dist_cjs6();
var ruleset_1 = require_ruleset2();
var defaultEndpointResolver = (endpointParams, context = {}) => {
return (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
endpointParams,
logger: context.logger,
});
};
exports.defaultEndpointResolver = defaultEndpointResolver;
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
},
});
// node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js
var require_runtimeConfig_shared2 = __commonJS({
"node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var core_1 = require_dist_cjs37();
var core_2 = require_dist_cjs34();
var smithy_client_1 = require_dist_cjs32();
var url_parser_1 = require_dist_cjs16();
var util_base64_1 = require_dist_cjs25();
var util_utf8_1 = require_dist_cjs24();
var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider3();
var endpointResolver_1 = require_endpointResolver2();
var getRuntimeConfig = (config) => {
return {
apiVersion: "2019-06-10",
base64Decoder: (config == null ? void 0 : config.base64Decoder) ?? util_base64_1.fromBase64,
base64Encoder: (config == null ? void 0 : config.base64Encoder) ?? util_base64_1.toBase64,
disableHostPrefix: (config == null ? void 0 : config.disableHostPrefix) ?? false,
endpointProvider:
(config == null ? void 0 : config.endpointProvider) ?? endpointResolver_1.defaultEndpointResolver,
extensions: (config == null ? void 0 : config.extensions) ?? [],
httpAuthSchemeProvider:
(config == null ? void 0 : config.httpAuthSchemeProvider) ??
httpAuthSchemeProvider_1.defaultSSOOIDCHttpAuthSchemeProvider,
httpAuthSchemes: (config == null ? void 0 : config.httpAuthSchemes) ?? [
{
schemeId: "aws.auth#sigv4",
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
signer: new core_1.AwsSdkSigV4Signer(),
},
{
schemeId: "smithy.api#noAuth",
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
signer: new core_2.NoAuthSigner(),
},
],
logger: (config == null ? void 0 : config.logger) ?? new smithy_client_1.NoOpLogger(),
serviceId: (config == null ? void 0 : config.serviceId) ?? "SSO OIDC",
urlParser: (config == null ? void 0 : config.urlParser) ?? url_parser_1.parseUrl,
utf8Decoder: (config == null ? void 0 : config.utf8Decoder) ?? util_utf8_1.fromUtf8,
utf8Encoder: (config == null ? void 0 : config.utf8Encoder) ?? util_utf8_1.toUtf8,
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js
var require_runtimeConfig2 = __commonJS({
"node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var tslib_1 = require_tslib();
var package_json_1 = tslib_1.__importDefault(require_package3());
var core_1 = require_dist_cjs37();
var credential_provider_node_1 = require_dist_cjs54();
var util_user_agent_node_1 = require_dist_cjs41();
var config_resolver_1 = require_dist_cjs11();
var hash_node_1 = require_dist_cjs42();
var middleware_retry_1 = require_dist_cjs33();
var node_config_provider_1 = require_dist_cjs14();
var node_http_handler_1 = require_dist_cjs28();
var util_body_length_node_1 = require_dist_cjs43();
var util_retry_1 = require_dist_cjs20();
var runtimeConfig_shared_1 = require_runtimeConfig_shared2();
var smithy_client_1 = require_dist_cjs32();
var util_defaults_mode_node_1 = require_dist_cjs44();
var smithy_client_2 = require_dist_cjs32();
var getRuntimeConfig = (config) => {
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
bodyLengthChecker:
(config == null ? void 0 : config.bodyLengthChecker) ?? util_body_length_node_1.calculateBodyLength,
credentialDefaultProvider:
(config == null ? void 0 : config.credentialDefaultProvider) ?? credential_provider_node_1.defaultProvider,
defaultUserAgentProvider:
(config == null ? void 0 : config.defaultUserAgentProvider) ??
(0, util_user_agent_node_1.defaultUserAgent)({
serviceId: clientSharedValues.serviceId,
clientVersion: package_json_1.default.version,
}),
maxAttempts:
(config == null ? void 0 : config.maxAttempts) ??
(0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region:
(config == null ? void 0 : config.region) ??
(0, node_config_provider_1.loadConfig)(
config_resolver_1.NODE_REGION_CONFIG_OPTIONS,
config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS
),
requestHandler: node_http_handler_1.NodeHttpHandler.create(
(config == null ? void 0 : config.requestHandler) ?? defaultConfigProvider
),
retryMode:
(config == null ? void 0 : config.retryMode) ??
(0, node_config_provider_1.loadConfig)({
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
}),
sha256: (config == null ? void 0 : config.sha256) ?? hash_node_1.Hash.bind(null, "sha256"),
streamCollector: (config == null ? void 0 : config.streamCollector) ?? node_http_handler_1.streamCollector,
useDualstackEndpoint:
(config == null ? void 0 : config.useDualstackEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
useFipsEndpoint:
(config == null ? void 0 : config.useFipsEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js
var require_dist_cjs47 = __commonJS({
"node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
AccessDeniedException: () => AccessDeniedException,
AuthorizationPendingException: () => AuthorizationPendingException,
CreateTokenCommand: () => CreateTokenCommand,
CreateTokenRequestFilterSensitiveLog: () => CreateTokenRequestFilterSensitiveLog,
CreateTokenResponseFilterSensitiveLog: () => CreateTokenResponseFilterSensitiveLog,
CreateTokenWithIAMCommand: () => CreateTokenWithIAMCommand,
CreateTokenWithIAMRequestFilterSensitiveLog: () => CreateTokenWithIAMRequestFilterSensitiveLog,
CreateTokenWithIAMResponseFilterSensitiveLog: () => CreateTokenWithIAMResponseFilterSensitiveLog,
ExpiredTokenException: () => ExpiredTokenException,
InternalServerException: () => InternalServerException,
InvalidClientException: () => InvalidClientException,
InvalidClientMetadataException: () => InvalidClientMetadataException,
InvalidGrantException: () => InvalidGrantException,
InvalidRedirectUriException: () => InvalidRedirectUriException,
InvalidRequestException: () => InvalidRequestException,
InvalidRequestRegionException: () => InvalidRequestRegionException,
InvalidScopeException: () => InvalidScopeException,
RegisterClientCommand: () => RegisterClientCommand,
RegisterClientResponseFilterSensitiveLog: () => RegisterClientResponseFilterSensitiveLog,
SSOOIDC: () => SSOOIDC,
SSOOIDCClient: () => SSOOIDCClient,
SSOOIDCServiceException: () => SSOOIDCServiceException,
SlowDownException: () => SlowDownException,
StartDeviceAuthorizationCommand: () => StartDeviceAuthorizationCommand,
StartDeviceAuthorizationRequestFilterSensitiveLog: () => StartDeviceAuthorizationRequestFilterSensitiveLog,
UnauthorizedClientException: () => UnauthorizedClientException,
UnsupportedGrantTypeException: () => UnsupportedGrantTypeException,
__Client: () => import_smithy_client.Client,
});
module2.exports = __toCommonJS2(src_exports);
var import_middleware_host_header = require_dist_cjs3();
var import_middleware_logger = require_dist_cjs4();
var import_middleware_recursion_detection = require_dist_cjs5();
var import_middleware_user_agent = require_dist_cjs8();
var import_config_resolver = require_dist_cjs11();
var import_core = require_dist_cjs34();
var import_middleware_content_length = require_dist_cjs35();
var import_middleware_endpoint = require_dist_cjs18();
var import_middleware_retry = require_dist_cjs33();
var import_httpAuthSchemeProvider = require_httpAuthSchemeProvider3();
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
return {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
defaultSigningName: "sso-oauth",
};
}, "resolveClientEndpointParameters");
var commonParams = {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
var import_runtimeConfig = require_runtimeConfig2();
var import_region_config_resolver = require_dist_cjs45();
var import_protocol_http = require_dist_cjs2();
var import_smithy_client = require_dist_cjs32();
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
let _credentials = runtimeConfig.credentials;
return {
setHttpAuthScheme(httpAuthScheme) {
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
if (index === -1) {
_httpAuthSchemes.push(httpAuthScheme);
} else {
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
}
},
httpAuthSchemes() {
return _httpAuthSchemes;
},
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
_httpAuthSchemeProvider = httpAuthSchemeProvider;
},
httpAuthSchemeProvider() {
return _httpAuthSchemeProvider;
},
setCredentials(credentials) {
_credentials = credentials;
},
credentials() {
return _credentials;
},
};
}, "getHttpAuthExtensionConfiguration");
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
return {
httpAuthSchemes: config.httpAuthSchemes(),
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
credentials: config.credentials(),
};
}, "resolveHttpAuthRuntimeConfig");
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
const extensionConfiguration = {
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
};
extensions.forEach((extension) => extension.configure(extensionConfiguration));
return {
...runtimeConfig,
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
};
}, "resolveRuntimeExtensions");
var _SSOOIDCClient = class _SSOOIDCClient extends import_smithy_client.Client {
constructor(...[configuration]) {
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
const _config_8 = resolveRuntimeExtensions(
_config_7,
(configuration == null ? void 0 : configuration.extensions) || []
);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
this.middlewareStack.use(
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
})
);
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
}
destroy() {
super.destroy();
}
getDefaultHttpAuthSchemeParametersProvider() {
return import_httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider;
}
getIdentityProviderConfigProvider() {
return async (config) =>
new import_core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials,
});
}
};
__name(_SSOOIDCClient, "SSOOIDCClient");
var SSOOIDCClient = _SSOOIDCClient;
var import_middleware_serde = require_dist_cjs17();
var _SSOOIDCServiceException = class _SSOOIDCServiceException2 extends import_smithy_client.ServiceException {
constructor(options) {
super(options);
Object.setPrototypeOf(this, _SSOOIDCServiceException2.prototype);
}
};
__name(_SSOOIDCServiceException, "SSOOIDCServiceException");
var SSOOIDCServiceException = _SSOOIDCServiceException;
var _AccessDeniedException = class _AccessDeniedException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "AccessDeniedException",
$fault: "client",
...opts,
});
this.name = "AccessDeniedException";
this.$fault = "client";
Object.setPrototypeOf(this, _AccessDeniedException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_AccessDeniedException, "AccessDeniedException");
var AccessDeniedException = _AccessDeniedException;
var _AuthorizationPendingException = class _AuthorizationPendingException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "AuthorizationPendingException",
$fault: "client",
...opts,
});
this.name = "AuthorizationPendingException";
this.$fault = "client";
Object.setPrototypeOf(this, _AuthorizationPendingException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_AuthorizationPendingException, "AuthorizationPendingException");
var AuthorizationPendingException = _AuthorizationPendingException;
var _ExpiredTokenException = class _ExpiredTokenException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "ExpiredTokenException",
$fault: "client",
...opts,
});
this.name = "ExpiredTokenException";
this.$fault = "client";
Object.setPrototypeOf(this, _ExpiredTokenException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_ExpiredTokenException, "ExpiredTokenException");
var ExpiredTokenException = _ExpiredTokenException;
var _InternalServerException = class _InternalServerException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InternalServerException",
$fault: "server",
...opts,
});
this.name = "InternalServerException";
this.$fault = "server";
Object.setPrototypeOf(this, _InternalServerException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_InternalServerException, "InternalServerException");
var InternalServerException = _InternalServerException;
var _InvalidClientException = class _InvalidClientException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InvalidClientException",
$fault: "client",
...opts,
});
this.name = "InvalidClientException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidClientException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_InvalidClientException, "InvalidClientException");
var InvalidClientException = _InvalidClientException;
var _InvalidGrantException = class _InvalidGrantException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InvalidGrantException",
$fault: "client",
...opts,
});
this.name = "InvalidGrantException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidGrantException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_InvalidGrantException, "InvalidGrantException");
var InvalidGrantException = _InvalidGrantException;
var _InvalidRequestException = class _InvalidRequestException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InvalidRequestException",
$fault: "client",
...opts,
});
this.name = "InvalidRequestException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidRequestException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_InvalidRequestException, "InvalidRequestException");
var InvalidRequestException = _InvalidRequestException;
var _InvalidScopeException = class _InvalidScopeException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InvalidScopeException",
$fault: "client",
...opts,
});
this.name = "InvalidScopeException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidScopeException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_InvalidScopeException, "InvalidScopeException");
var InvalidScopeException = _InvalidScopeException;
var _SlowDownException = class _SlowDownException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "SlowDownException",
$fault: "client",
...opts,
});
this.name = "SlowDownException";
this.$fault = "client";
Object.setPrototypeOf(this, _SlowDownException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_SlowDownException, "SlowDownException");
var SlowDownException = _SlowDownException;
var _UnauthorizedClientException = class _UnauthorizedClientException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "UnauthorizedClientException",
$fault: "client",
...opts,
});
this.name = "UnauthorizedClientException";
this.$fault = "client";
Object.setPrototypeOf(this, _UnauthorizedClientException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_UnauthorizedClientException, "UnauthorizedClientException");
var UnauthorizedClientException = _UnauthorizedClientException;
var _UnsupportedGrantTypeException = class _UnsupportedGrantTypeException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "UnsupportedGrantTypeException",
$fault: "client",
...opts,
});
this.name = "UnsupportedGrantTypeException";
this.$fault = "client";
Object.setPrototypeOf(this, _UnsupportedGrantTypeException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_UnsupportedGrantTypeException, "UnsupportedGrantTypeException");
var UnsupportedGrantTypeException = _UnsupportedGrantTypeException;
var _InvalidRequestRegionException = class _InvalidRequestRegionException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InvalidRequestRegionException",
$fault: "client",
...opts,
});
this.name = "InvalidRequestRegionException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidRequestRegionException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
this.endpoint = opts.endpoint;
this.region = opts.region;
}
};
__name(_InvalidRequestRegionException, "InvalidRequestRegionException");
var InvalidRequestRegionException = _InvalidRequestRegionException;
var _InvalidClientMetadataException = class _InvalidClientMetadataException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InvalidClientMetadataException",
$fault: "client",
...opts,
});
this.name = "InvalidClientMetadataException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidClientMetadataException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_InvalidClientMetadataException, "InvalidClientMetadataException");
var InvalidClientMetadataException = _InvalidClientMetadataException;
var _InvalidRedirectUriException = class _InvalidRedirectUriException2 extends SSOOIDCServiceException {
constructor(opts) {
super({
name: "InvalidRedirectUriException",
$fault: "client",
...opts,
});
this.name = "InvalidRedirectUriException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidRedirectUriException2.prototype);
this.error = opts.error;
this.error_description = opts.error_description;
}
};
__name(_InvalidRedirectUriException, "InvalidRedirectUriException");
var InvalidRedirectUriException = _InvalidRedirectUriException;
var CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING }),
...(obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING }),
...(obj.codeVerifier && { codeVerifier: import_smithy_client.SENSITIVE_STRING }),
}),
"CreateTokenRequestFilterSensitiveLog"
);
var CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }),
...(obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING }),
...(obj.idToken && { idToken: import_smithy_client.SENSITIVE_STRING }),
}),
"CreateTokenResponseFilterSensitiveLog"
);
var CreateTokenWithIAMRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING }),
...(obj.assertion && { assertion: import_smithy_client.SENSITIVE_STRING }),
...(obj.subjectToken && { subjectToken: import_smithy_client.SENSITIVE_STRING }),
...(obj.codeVerifier && { codeVerifier: import_smithy_client.SENSITIVE_STRING }),
}),
"CreateTokenWithIAMRequestFilterSensitiveLog"
);
var CreateTokenWithIAMResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.accessToken && { accessToken: import_smithy_client.SENSITIVE_STRING }),
...(obj.refreshToken && { refreshToken: import_smithy_client.SENSITIVE_STRING }),
...(obj.idToken && { idToken: import_smithy_client.SENSITIVE_STRING }),
}),
"CreateTokenWithIAMResponseFilterSensitiveLog"
);
var RegisterClientResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING }),
}),
"RegisterClientResponseFilterSensitiveLog"
);
var StartDeviceAuthorizationRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.clientSecret && { clientSecret: import_smithy_client.SENSITIVE_STRING }),
}),
"StartDeviceAuthorizationRequestFilterSensitiveLog"
);
var import_core2 = require_dist_cjs37();
var se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/token");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
clientId: [],
clientSecret: [],
code: [],
codeVerifier: [],
deviceCode: [],
grantType: [],
redirectUri: [],
refreshToken: [],
scope: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateTokenCommand");
var se_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/token");
const query = (0, import_smithy_client.map)({
[_ai]: [, "t"],
});
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
assertion: [],
clientId: [],
code: [],
codeVerifier: [],
grantType: [],
redirectUri: [],
refreshToken: [],
requestedTokenType: [],
scope: (_) => (0, import_smithy_client._json)(_),
subjectToken: [],
subjectTokenType: [],
})
);
b.m("POST").h(headers).q(query).b(body);
return b.build();
}, "se_CreateTokenWithIAMCommand");
var se_RegisterClientCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/client/register");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
clientName: [],
clientType: [],
entitledApplicationArn: [],
grantTypes: (_) => (0, import_smithy_client._json)(_),
issuerUrl: [],
redirectUris: (_) => (0, import_smithy_client._json)(_),
scopes: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_RegisterClientCommand");
var se_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/device_authorization");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
clientId: [],
clientSecret: [],
startUrl: [],
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_StartDeviceAuthorizationCommand");
var de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
accessToken: import_smithy_client.expectString,
expiresIn: import_smithy_client.expectInt32,
idToken: import_smithy_client.expectString,
refreshToken: import_smithy_client.expectString,
tokenType: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateTokenCommand");
var de_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
accessToken: import_smithy_client.expectString,
expiresIn: import_smithy_client.expectInt32,
idToken: import_smithy_client.expectString,
issuedTokenType: import_smithy_client.expectString,
refreshToken: import_smithy_client.expectString,
scope: import_smithy_client._json,
tokenType: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateTokenWithIAMCommand");
var de_RegisterClientCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
authorizationEndpoint: import_smithy_client.expectString,
clientId: import_smithy_client.expectString,
clientIdIssuedAt: import_smithy_client.expectLong,
clientSecret: import_smithy_client.expectString,
clientSecretExpiresAt: import_smithy_client.expectLong,
tokenEndpoint: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_RegisterClientCommand");
var de_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
deviceCode: import_smithy_client.expectString,
expiresIn: import_smithy_client.expectInt32,
interval: import_smithy_client.expectInt32,
userCode: import_smithy_client.expectString,
verificationUri: import_smithy_client.expectString,
verificationUriComplete: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_StartDeviceAuthorizationCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
const parsedOutput = {
...output,
body: await (0, import_core2.parseJsonErrorBody)(output.body, context),
};
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
switch (errorCode) {
case "AccessDeniedException":
case "com.amazonaws.ssooidc#AccessDeniedException":
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
case "AuthorizationPendingException":
case "com.amazonaws.ssooidc#AuthorizationPendingException":
throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
case "ExpiredTokenException":
case "com.amazonaws.ssooidc#ExpiredTokenException":
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
case "InternalServerException":
case "com.amazonaws.ssooidc#InternalServerException":
throw await de_InternalServerExceptionRes(parsedOutput, context);
case "InvalidClientException":
case "com.amazonaws.ssooidc#InvalidClientException":
throw await de_InvalidClientExceptionRes(parsedOutput, context);
case "InvalidGrantException":
case "com.amazonaws.ssooidc#InvalidGrantException":
throw await de_InvalidGrantExceptionRes(parsedOutput, context);
case "InvalidRequestException":
case "com.amazonaws.ssooidc#InvalidRequestException":
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
case "InvalidScopeException":
case "com.amazonaws.ssooidc#InvalidScopeException":
throw await de_InvalidScopeExceptionRes(parsedOutput, context);
case "SlowDownException":
case "com.amazonaws.ssooidc#SlowDownException":
throw await de_SlowDownExceptionRes(parsedOutput, context);
case "UnauthorizedClientException":
case "com.amazonaws.ssooidc#UnauthorizedClientException":
throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
case "UnsupportedGrantTypeException":
case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
case "InvalidRequestRegionException":
case "com.amazonaws.ssooidc#InvalidRequestRegionException":
throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context);
case "InvalidClientMetadataException":
case "com.amazonaws.ssooidc#InvalidClientMetadataException":
throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context);
case "InvalidRedirectUriException":
case "com.amazonaws.ssooidc#InvalidRedirectUriException":
throw await de_InvalidRedirectUriExceptionRes(parsedOutput, context);
default: {
const parsedBody = parsedOutput.body;
return throwDefaultError({
output,
parsedBody,
errorCode,
});
}
}
}, "de_CommandError");
var throwDefaultError = (0, import_smithy_client.withBaseException)(SSOOIDCServiceException);
var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new AccessDeniedException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_AccessDeniedExceptionRes");
var de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new AuthorizationPendingException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_AuthorizationPendingExceptionRes");
var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new ExpiredTokenException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ExpiredTokenExceptionRes");
var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InternalServerException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InternalServerExceptionRes");
var de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidClientException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidClientExceptionRes");
var de_InvalidClientMetadataExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidClientMetadataException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidClientMetadataExceptionRes");
var de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidGrantException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidGrantExceptionRes");
var de_InvalidRedirectUriExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidRedirectUriException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidRedirectUriExceptionRes");
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidRequestException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidRequestExceptionRes");
var de_InvalidRequestRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
endpoint: import_smithy_client.expectString,
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
region: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidRequestRegionException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidRequestRegionExceptionRes");
var de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InvalidScopeException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InvalidScopeExceptionRes");
var de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new SlowDownException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_SlowDownExceptionRes");
var de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new UnauthorizedClientException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_UnauthorizedClientExceptionRes");
var de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
error: import_smithy_client.expectString,
error_description: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new UnsupportedGrantTypeException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_UnsupportedGrantTypeExceptionRes");
var deserializeMetadata = /* @__PURE__ */ __name(
(output) => ({
httpStatusCode: output.statusCode,
requestId:
output.headers["x-amzn-requestid"] ??
output.headers["x-amzn-request-id"] ??
output.headers["x-amz-request-id"],
extendedRequestId: output.headers["x-amz-id-2"],
cfId: output.headers["x-amz-cf-id"],
}),
"deserializeMetadata"
);
var _ai = "aws_iam";
var _CreateTokenCommand = class _CreateTokenCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSSOOIDCService", "CreateToken", {})
.n("SSOOIDCClient", "CreateTokenCommand")
.f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog)
.ser(se_CreateTokenCommand)
.de(de_CreateTokenCommand)
.build() {};
__name(_CreateTokenCommand, "CreateTokenCommand");
var CreateTokenCommand = _CreateTokenCommand;
var _CreateTokenWithIAMCommand = class _CreateTokenWithIAMCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSSOOIDCService", "CreateTokenWithIAM", {})
.n("SSOOIDCClient", "CreateTokenWithIAMCommand")
.f(CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog)
.ser(se_CreateTokenWithIAMCommand)
.de(de_CreateTokenWithIAMCommand)
.build() {};
__name(_CreateTokenWithIAMCommand, "CreateTokenWithIAMCommand");
var CreateTokenWithIAMCommand = _CreateTokenWithIAMCommand;
var _RegisterClientCommand = class _RegisterClientCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSSOOIDCService", "RegisterClient", {})
.n("SSOOIDCClient", "RegisterClientCommand")
.f(void 0, RegisterClientResponseFilterSensitiveLog)
.ser(se_RegisterClientCommand)
.de(de_RegisterClientCommand)
.build() {};
__name(_RegisterClientCommand, "RegisterClientCommand");
var RegisterClientCommand = _RegisterClientCommand;
var _StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSSOOIDCService", "StartDeviceAuthorization", {})
.n("SSOOIDCClient", "StartDeviceAuthorizationCommand")
.f(StartDeviceAuthorizationRequestFilterSensitiveLog, void 0)
.ser(se_StartDeviceAuthorizationCommand)
.de(de_StartDeviceAuthorizationCommand)
.build() {};
__name(_StartDeviceAuthorizationCommand, "StartDeviceAuthorizationCommand");
var StartDeviceAuthorizationCommand = _StartDeviceAuthorizationCommand;
var commands = {
CreateTokenCommand,
CreateTokenWithIAMCommand,
RegisterClientCommand,
StartDeviceAuthorizationCommand,
};
var _SSOOIDC = class _SSOOIDC extends SSOOIDCClient {};
__name(_SSOOIDC, "SSOOIDC");
var SSOOIDC = _SSOOIDC;
(0, import_smithy_client.createAggregatedClient)(commands, SSOOIDC);
},
});
// node_modules/@aws-sdk/token-providers/dist-cjs/index.js
var require_dist_cjs48 = __commonJS({
"node_modules/@aws-sdk/token-providers/dist-cjs/index.js"(exports, module2) {
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (
(target = mod != null ? __create2(__getProtoOf2(mod)) : {}),
__copyProps2(
isNodeMode || !mod || !mod.__esModule
? __defProp2(target, "default", { value: mod, enumerable: true })
: target,
mod
)
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
fromSso: () => fromSso,
fromStatic: () => fromStatic,
nodeProvider: () => nodeProvider,
});
module2.exports = __toCommonJS2(src_exports);
var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
var ssoOidcClientsHash = {};
var getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion) => {
const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM2(require_dist_cjs47()));
if (ssoOidcClientsHash[ssoRegion]) {
return ssoOidcClientsHash[ssoRegion];
}
const ssoOidcClient = new SSOOIDCClient({ region: ssoRegion });
ssoOidcClientsHash[ssoRegion] = ssoOidcClient;
return ssoOidcClient;
}, "getSsoOidcClient");
var getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion) => {
const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM2(require_dist_cjs47()));
const ssoOidcClient = await getSsoOidcClient(ssoRegion);
return ssoOidcClient.send(
new CreateTokenCommand({
clientId: ssoToken.clientId,
clientSecret: ssoToken.clientSecret,
refreshToken: ssoToken.refreshToken,
grantType: "refresh_token",
})
);
}, "getNewSsoOidcToken");
var import_property_provider = require_dist_cjs12();
var validateTokenExpiry = /* @__PURE__ */ __name((token) => {
if (token.expiration && token.expiration.getTime() < Date.now()) {
throw new import_property_provider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
}
}, "validateTokenExpiry");
var validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => {
if (typeof value === "undefined") {
throw new import_property_provider.TokenProviderError(
`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`,
false
);
}
}, "validateTokenKey");
var import_shared_ini_file_loader = require_dist_cjs13();
var import_fs = require("fs");
var { writeFile } = import_fs.promises;
var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
const tokenFilepath = (0, import_shared_ini_file_loader.getSSOTokenFilepath)(id);
const tokenString = JSON.stringify(ssoToken, null, 2);
return writeFile(tokenFilepath, tokenString);
}, "writeSSOTokenToFile");
var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
var fromSso = /* @__PURE__ */ __name(
(init = {}) =>
async () => {
var _a;
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
const profile = profiles[profileName];
if (!profile) {
throw new import_property_provider.TokenProviderError(
`Profile '${profileName}' could not be found in shared credentials file.`,
false
);
} else if (!profile["sso_session"]) {
throw new import_property_provider.TokenProviderError(
`Profile '${profileName}' is missing required property 'sso_session'.`
);
}
const ssoSessionName = profile["sso_session"];
const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init);
const ssoSession = ssoSessions[ssoSessionName];
if (!ssoSession) {
throw new import_property_provider.TokenProviderError(
`Sso session '${ssoSessionName}' could not be found in shared credentials file.`,
false
);
}
for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
if (!ssoSession[ssoSessionRequiredKey]) {
throw new import_property_provider.TokenProviderError(
`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`,
false
);
}
}
const ssoStartUrl = ssoSession["sso_start_url"];
const ssoRegion = ssoSession["sso_region"];
let ssoToken;
try {
ssoToken = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoSessionName);
} catch (e) {
throw new import_property_provider.TokenProviderError(
`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`,
false
);
}
validateTokenKey("accessToken", ssoToken.accessToken);
validateTokenKey("expiresAt", ssoToken.expiresAt);
const { accessToken, expiresAt } = ssoToken;
const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
return existingToken;
}
if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
validateTokenExpiry(existingToken);
return existingToken;
}
validateTokenKey("clientId", ssoToken.clientId, true);
validateTokenKey("clientSecret", ssoToken.clientSecret, true);
validateTokenKey("refreshToken", ssoToken.refreshToken, true);
try {
lastRefreshAttemptTime.setTime(Date.now());
const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion);
validateTokenKey("accessToken", newSsoOidcToken.accessToken);
validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
try {
await writeSSOTokenToFile(ssoSessionName, {
...ssoToken,
accessToken: newSsoOidcToken.accessToken,
expiresAt: newTokenExpiration.toISOString(),
refreshToken: newSsoOidcToken.refreshToken,
});
} catch (error) {}
return {
token: newSsoOidcToken.accessToken,
expiration: newTokenExpiration,
};
} catch (error) {
validateTokenExpiry(existingToken);
return existingToken;
}
},
"fromSso"
);
var fromStatic = /* @__PURE__ */ __name(
({ token, logger }) =>
async () => {
logger == null ? void 0 : logger.debug("@aws-sdk/token-providers - fromStatic");
if (!token || !token.token) {
throw new import_property_provider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
}
return token;
},
"fromStatic"
);
var nodeProvider = /* @__PURE__ */ __name(
(init = {}) =>
(0, import_property_provider.memoize)(
(0, import_property_provider.chain)(fromSso(init), async () => {
throw new import_property_provider.TokenProviderError("Could not load token from any providers", false);
}),
(token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5,
(token) => token.expiration !== void 0
),
"nodeProvider"
);
},
});
// node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js
var require_dist_cjs49 = __commonJS({
"node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __esm = (fn, res) =>
function __init() {
return (fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])((fn = 0))), res);
};
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var loadSso_exports = {};
__export2(loadSso_exports, {
GetRoleCredentialsCommand: () => import_client_sso.GetRoleCredentialsCommand,
SSOClient: () => import_client_sso.SSOClient,
});
var import_client_sso;
var init_loadSso = __esm({
"src/loadSso.ts"() {
import_client_sso = require_dist_cjs46();
},
});
var src_exports = {};
__export2(src_exports, {
fromSSO: () => fromSSO,
isSsoProfile: () => isSsoProfile,
validateSsoProfile: () => validateSsoProfile,
});
module2.exports = __toCommonJS2(src_exports);
var isSsoProfile = /* @__PURE__ */ __name(
(arg) =>
arg &&
(typeof arg.sso_start_url === "string" ||
typeof arg.sso_account_id === "string" ||
typeof arg.sso_session === "string" ||
typeof arg.sso_region === "string" ||
typeof arg.sso_role_name === "string"),
"isSsoProfile"
);
var import_token_providers = require_dist_cjs48();
var import_property_provider = require_dist_cjs12();
var import_shared_ini_file_loader = require_dist_cjs13();
var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
var resolveSSOCredentials = /* @__PURE__ */ __name(
async ({
ssoStartUrl,
ssoSession,
ssoAccountId,
ssoRegion,
ssoRoleName,
ssoClient,
clientConfig,
profile,
logger,
}) => {
let token;
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
if (ssoSession) {
try {
const _token = await (0, import_token_providers.fromSso)({ profile })();
token = {
accessToken: _token.token,
expiresAt: new Date(_token.expiration).toISOString(),
};
} catch (e) {
throw new import_property_provider.CredentialsProviderError(e.message, {
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
logger,
});
}
} else {
try {
token = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoStartUrl);
} catch (e) {
throw new import_property_provider.CredentialsProviderError(
`The SSO session associated with this profile is invalid. ${refreshMessage}`,
{
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
logger,
}
);
}
}
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
throw new import_property_provider.CredentialsProviderError(
`The SSO session associated with this profile has expired. ${refreshMessage}`,
{
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
logger,
}
);
}
const { accessToken } = token;
const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } =
await Promise.resolve().then(() => (init_loadSso(), loadSso_exports));
const sso =
ssoClient ||
new SSOClient2(
Object.assign({}, clientConfig ?? {}, {
region: (clientConfig == null ? void 0 : clientConfig.region) ?? ssoRegion,
})
);
let ssoResp;
try {
ssoResp = await sso.send(
new GetRoleCredentialsCommand2({
accountId: ssoAccountId,
roleName: ssoRoleName,
accessToken,
})
);
} catch (e) {
throw new import_property_provider.CredentialsProviderError(e, {
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
logger,
});
}
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope } = {} } =
ssoResp;
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
throw new import_property_provider.CredentialsProviderError("SSO returns an invalid temporary credential.", {
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
logger,
});
}
return {
accessKeyId,
secretAccessKey,
sessionToken,
expiration: new Date(expiration),
credentialScope,
};
},
"resolveSSOCredentials"
);
var validateSsoProfile = /* @__PURE__ */ __name((profile, logger) => {
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
throw new import_property_provider.CredentialsProviderError(
`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(
profile
).join(", ")}
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,
{ tryNextLink: false, logger }
);
}
return profile;
}, "validateSsoProfile");
var fromSSO = /* @__PURE__ */ __name(
(init = {}) =>
async () => {
var _a;
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-sso - fromSSO");
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
const { ssoClient } = init;
const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
const profile = profiles[profileName];
if (!profile) {
throw new import_property_provider.CredentialsProviderError(`Profile ${profileName} was not found.`, {
logger: init.logger,
});
}
if (!isSsoProfile(profile)) {
throw new import_property_provider.CredentialsProviderError(
`Profile ${profileName} is not configured with SSO credentials.`,
{
logger: init.logger,
}
);
}
if (profile == null ? void 0 : profile.sso_session) {
const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init);
const session = ssoSessions[profile.sso_session];
const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
if (ssoRegion && ssoRegion !== session.sso_region) {
throw new import_property_provider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
tryNextLink: false,
logger: init.logger,
});
}
if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
throw new import_property_provider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
tryNextLink: false,
logger: init.logger,
});
}
profile.sso_region = session.sso_region;
profile.sso_start_url = session.sso_start_url;
}
const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(
profile,
init.logger
);
return resolveSSOCredentials({
ssoStartUrl: sso_start_url,
ssoSession: sso_session,
ssoAccountId: sso_account_id,
ssoRegion: sso_region,
ssoRoleName: sso_role_name,
ssoClient,
clientConfig: init.clientConfig,
profile: profileName,
});
} else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
throw new import_property_provider.CredentialsProviderError(
'Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',
{ tryNextLink: false, logger: init.logger }
);
} else {
return resolveSSOCredentials({
ssoStartUrl,
ssoSession,
ssoAccountId,
ssoRegion,
ssoRoleName,
ssoClient,
clientConfig: init.clientConfig,
profile: profileName,
});
}
},
"fromSSO"
);
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js
var require_httpAuthSchemeProvider4 = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHttpAuthSchemeConfig =
exports.resolveStsAuthConfig =
exports.defaultSTSHttpAuthSchemeProvider =
exports.defaultSTSHttpAuthSchemeParametersProvider =
void 0;
var core_1 = require_dist_cjs37();
var util_middleware_1 = require_dist_cjs10();
var STSClient_1 = require_STSClient();
var defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
return {
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
region:
(await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
(() => {
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
})(),
};
};
exports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider;
function createAwsAuthSigv4HttpAuthOption(authParameters) {
return {
schemeId: "aws.auth#sigv4",
signingProperties: {
name: "sts",
region: authParameters.region,
},
propertiesExtractor: (config, context) => ({
signingProperties: {
config,
context,
},
}),
};
}
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
return {
schemeId: "smithy.api#noAuth",
};
}
var defaultSTSHttpAuthSchemeProvider = (authParameters) => {
const options = [];
switch (authParameters.operation) {
case "AssumeRoleWithSAML": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
case "AssumeRoleWithWebIdentity": {
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
break;
}
default: {
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
}
}
return options;
};
exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider;
var resolveStsAuthConfig = (input) => ({
...input,
stsClientCtor: STSClient_1.STSClient,
});
exports.resolveStsAuthConfig = resolveStsAuthConfig;
var resolveHttpAuthSchemeConfig = (config) => {
const config_0 = (0, exports.resolveStsAuthConfig)(config);
const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0);
return {
...config_1,
};
};
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js
var require_EndpointParameters = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.commonParams = exports.resolveClientEndpointParameters = void 0;
var resolveClientEndpointParameters = (options) => {
return {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
useGlobalEndpoint: options.useGlobalEndpoint ?? false,
defaultSigningName: "sts",
};
};
exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
exports.commonParams = {
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
},
});
// node_modules/@aws-sdk/client-sts/package.json
var require_package4 = __commonJS({
"node_modules/@aws-sdk/client-sts/package.json"(exports, module2) {
module2.exports = {
name: "@aws-sdk/client-sts",
description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",
version: "3.600.0",
scripts: {
build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
"build:cjs": "node ../../scripts/compilation/inline client-sts",
"build:es": "tsc -p tsconfig.es.json",
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
"build:types": "rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
clean: "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo sts",
test: "yarn test:unit",
"test:unit": "jest",
},
main: "./dist-cjs/index.js",
types: "./dist-types/index.d.ts",
module: "./dist-es/index.js",
sideEffects: false,
dependencies: {
"@aws-crypto/sha256-browser": "5.2.0",
"@aws-crypto/sha256-js": "5.2.0",
"@aws-sdk/client-sso-oidc": "3.600.0",
"@aws-sdk/core": "3.598.0",
"@aws-sdk/credential-provider-node": "3.600.0",
"@aws-sdk/middleware-host-header": "3.598.0",
"@aws-sdk/middleware-logger": "3.598.0",
"@aws-sdk/middleware-recursion-detection": "3.598.0",
"@aws-sdk/middleware-user-agent": "3.598.0",
"@aws-sdk/region-config-resolver": "3.598.0",
"@aws-sdk/types": "3.598.0",
"@aws-sdk/util-endpoints": "3.598.0",
"@aws-sdk/util-user-agent-browser": "3.598.0",
"@aws-sdk/util-user-agent-node": "3.598.0",
"@smithy/config-resolver": "^3.0.2",
"@smithy/core": "^2.2.1",
"@smithy/fetch-http-handler": "^3.0.2",
"@smithy/hash-node": "^3.0.1",
"@smithy/invalid-dependency": "^3.0.1",
"@smithy/middleware-content-length": "^3.0.1",
"@smithy/middleware-endpoint": "^3.0.2",
"@smithy/middleware-retry": "^3.0.4",
"@smithy/middleware-serde": "^3.0.1",
"@smithy/middleware-stack": "^3.0.1",
"@smithy/node-config-provider": "^3.1.1",
"@smithy/node-http-handler": "^3.0.1",
"@smithy/protocol-http": "^4.0.1",
"@smithy/smithy-client": "^3.1.2",
"@smithy/types": "^3.1.0",
"@smithy/url-parser": "^3.0.1",
"@smithy/util-base64": "^3.0.0",
"@smithy/util-body-length-browser": "^3.0.0",
"@smithy/util-body-length-node": "^3.0.0",
"@smithy/util-defaults-mode-browser": "^3.0.4",
"@smithy/util-defaults-mode-node": "^3.0.4",
"@smithy/util-endpoints": "^2.0.2",
"@smithy/util-middleware": "^3.0.1",
"@smithy/util-retry": "^3.0.1",
"@smithy/util-utf8": "^3.0.0",
tslib: "^2.6.2",
},
devDependencies: {
"@tsconfig/node16": "16.1.3",
"@types/node": "^16.18.96",
concurrently: "7.0.0",
"downlevel-dts": "0.10.1",
rimraf: "3.0.2",
typescript: "~4.9.5",
},
engines: {
node: ">=16.0.0",
},
typesVersions: {
"<4.0": {
"dist-types/*": ["dist-types/ts3.4/*"],
},
},
files: ["dist-*/**"],
author: {
name: "AWS SDK for JavaScript Team",
url: "https://aws.amazon.com/javascript/",
},
license: "Apache-2.0",
browser: {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser",
},
"react-native": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native",
},
homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",
repository: {
type: "git",
url: "https://github.com/aws/aws-sdk-js-v3.git",
directory: "clients/client-sts",
},
};
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js
var require_ruleset3 = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.ruleSet = void 0;
var F = "required";
var G = "type";
var H = "fn";
var I = "argv";
var J = "ref";
var a = false;
var b = true;
var c = "booleanEquals";
var d = "stringEquals";
var e = "sigv4";
var f = "sts";
var g = "us-east-1";
var h = "endpoint";
var i = "https://sts.{Region}.{PartitionResult#dnsSuffix}";
var j = "tree";
var k = "error";
var l = "getAttr";
var m = { [F]: false, [G]: "String" };
var n = { [F]: true, default: false, [G]: "Boolean" };
var o = { [J]: "Endpoint" };
var p = { [H]: "isSet", [I]: [{ [J]: "Region" }] };
var q = { [J]: "Region" };
var r = { [H]: "aws.partition", [I]: [q], assign: "PartitionResult" };
var s = { [J]: "UseFIPS" };
var t = { [J]: "UseDualStack" };
var u = {
url: "https://sts.amazonaws.com",
properties: { authSchemes: [{ name: e, signingName: f, signingRegion: g }] },
headers: {},
};
var v = {};
var w = { conditions: [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h };
var x = { [H]: c, [I]: [s, true] };
var y = { [H]: c, [I]: [t, true] };
var z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] };
var A = { [J]: "PartitionResult" };
var B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] };
var C = [{ [H]: "isSet", [I]: [o] }];
var D = [x];
var E = [y];
var _data = {
version: "1.0",
parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n },
rules: [
{
conditions: [
{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] },
{ [H]: "not", [I]: C },
p,
r,
{ [H]: c, [I]: [s, a] },
{ [H]: c, [I]: [t, a] },
],
rules: [
{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h },
w,
{ conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h },
{ conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h },
{
endpoint: {
url: i,
properties: {
authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }],
},
headers: v,
},
[G]: h,
},
],
[G]: j,
},
{
conditions: C,
rules: [
{
conditions: D,
error: "Invalid Configuration: FIPS and custom endpoint are not supported",
[G]: k,
},
{
conditions: E,
error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
[G]: k,
},
{ endpoint: { url: o, properties: v, headers: v }, [G]: h },
],
[G]: j,
},
{
conditions: [p],
rules: [
{
conditions: [r],
rules: [
{
conditions: [x, y],
rules: [
{
conditions: [{ [H]: c, [I]: [b, z] }, B],
rules: [
{
endpoint: {
url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: v,
headers: v,
},
[G]: h,
},
],
[G]: j,
},
{
error: "FIPS and DualStack are enabled, but this partition does not support one or both",
[G]: k,
},
],
[G]: j,
},
{
conditions: D,
rules: [
{
conditions: [{ [H]: c, [I]: [z, b] }],
rules: [
{
conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }],
endpoint: {
url: "https://sts.{Region}.amazonaws.com",
properties: v,
headers: v,
},
[G]: h,
},
{
endpoint: {
url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",
properties: v,
headers: v,
},
[G]: h,
},
],
[G]: j,
},
{ error: "FIPS is enabled but this partition does not support FIPS", [G]: k },
],
[G]: j,
},
{
conditions: E,
rules: [
{
conditions: [B],
rules: [
{
endpoint: {
url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: v,
headers: v,
},
[G]: h,
},
],
[G]: j,
},
{
error: "DualStack is enabled but this partition does not support DualStack",
[G]: k,
},
],
[G]: j,
},
w,
{ endpoint: { url: i, properties: v, headers: v }, [G]: h },
],
[G]: j,
},
],
[G]: j,
},
{ error: "Invalid Configuration: Missing Region", [G]: k },
],
};
exports.ruleSet = _data;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js
var require_endpointResolver3 = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultEndpointResolver = void 0;
var util_endpoints_1 = require_dist_cjs7();
var util_endpoints_2 = require_dist_cjs6();
var ruleset_1 = require_ruleset3();
var defaultEndpointResolver = (endpointParams, context = {}) => {
return (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
endpointParams,
logger: context.logger,
});
};
exports.defaultEndpointResolver = defaultEndpointResolver;
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js
var require_runtimeConfig_shared3 = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var core_1 = require_dist_cjs37();
var core_2 = require_dist_cjs34();
var smithy_client_1 = require_dist_cjs32();
var url_parser_1 = require_dist_cjs16();
var util_base64_1 = require_dist_cjs25();
var util_utf8_1 = require_dist_cjs24();
var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider4();
var endpointResolver_1 = require_endpointResolver3();
var getRuntimeConfig = (config) => {
return {
apiVersion: "2011-06-15",
base64Decoder: (config == null ? void 0 : config.base64Decoder) ?? util_base64_1.fromBase64,
base64Encoder: (config == null ? void 0 : config.base64Encoder) ?? util_base64_1.toBase64,
disableHostPrefix: (config == null ? void 0 : config.disableHostPrefix) ?? false,
endpointProvider:
(config == null ? void 0 : config.endpointProvider) ?? endpointResolver_1.defaultEndpointResolver,
extensions: (config == null ? void 0 : config.extensions) ?? [],
httpAuthSchemeProvider:
(config == null ? void 0 : config.httpAuthSchemeProvider) ??
httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider,
httpAuthSchemes: (config == null ? void 0 : config.httpAuthSchemes) ?? [
{
schemeId: "aws.auth#sigv4",
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
signer: new core_1.AwsSdkSigV4Signer(),
},
{
schemeId: "smithy.api#noAuth",
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
signer: new core_2.NoAuthSigner(),
},
],
logger: (config == null ? void 0 : config.logger) ?? new smithy_client_1.NoOpLogger(),
serviceId: (config == null ? void 0 : config.serviceId) ?? "STS",
urlParser: (config == null ? void 0 : config.urlParser) ?? url_parser_1.parseUrl,
utf8Decoder: (config == null ? void 0 : config.utf8Decoder) ?? util_utf8_1.fromUtf8,
utf8Encoder: (config == null ? void 0 : config.utf8Encoder) ?? util_utf8_1.toUtf8,
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js
var require_runtimeConfig3 = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var tslib_1 = require_tslib();
var package_json_1 = tslib_1.__importDefault(require_package4());
var core_1 = require_dist_cjs37();
var credential_provider_node_1 = require_dist_cjs54();
var util_user_agent_node_1 = require_dist_cjs41();
var config_resolver_1 = require_dist_cjs11();
var core_2 = require_dist_cjs34();
var hash_node_1 = require_dist_cjs42();
var middleware_retry_1 = require_dist_cjs33();
var node_config_provider_1 = require_dist_cjs14();
var node_http_handler_1 = require_dist_cjs28();
var util_body_length_node_1 = require_dist_cjs43();
var util_retry_1 = require_dist_cjs20();
var runtimeConfig_shared_1 = require_runtimeConfig_shared3();
var smithy_client_1 = require_dist_cjs32();
var util_defaults_mode_node_1 = require_dist_cjs44();
var smithy_client_2 = require_dist_cjs32();
var getRuntimeConfig = (config) => {
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
bodyLengthChecker:
(config == null ? void 0 : config.bodyLengthChecker) ?? util_body_length_node_1.calculateBodyLength,
credentialDefaultProvider:
(config == null ? void 0 : config.credentialDefaultProvider) ?? credential_provider_node_1.defaultProvider,
defaultUserAgentProvider:
(config == null ? void 0 : config.defaultUserAgentProvider) ??
(0, util_user_agent_node_1.defaultUserAgent)({
serviceId: clientSharedValues.serviceId,
clientVersion: package_json_1.default.version,
}),
httpAuthSchemes: (config == null ? void 0 : config.httpAuthSchemes) ?? [
{
schemeId: "aws.auth#sigv4",
identityProvider: (ipc) =>
ipc.getIdentityProvider("aws.auth#sigv4") ||
(async (idProps) =>
await (0, credential_provider_node_1.defaultProvider)(
(idProps == null ? void 0 : idProps.__config) || {}
)()),
signer: new core_1.AwsSdkSigV4Signer(),
},
{
schemeId: "smithy.api#noAuth",
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
signer: new core_2.NoAuthSigner(),
},
],
maxAttempts:
(config == null ? void 0 : config.maxAttempts) ??
(0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region:
(config == null ? void 0 : config.region) ??
(0, node_config_provider_1.loadConfig)(
config_resolver_1.NODE_REGION_CONFIG_OPTIONS,
config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS
),
requestHandler: node_http_handler_1.NodeHttpHandler.create(
(config == null ? void 0 : config.requestHandler) ?? defaultConfigProvider
),
retryMode:
(config == null ? void 0 : config.retryMode) ??
(0, node_config_provider_1.loadConfig)({
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
}),
sha256: (config == null ? void 0 : config.sha256) ?? hash_node_1.Hash.bind(null, "sha256"),
streamCollector: (config == null ? void 0 : config.streamCollector) ?? node_http_handler_1.streamCollector,
useDualstackEndpoint:
(config == null ? void 0 : config.useDualstackEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
useFipsEndpoint:
(config == null ? void 0 : config.useFipsEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js
var require_httpAuthExtensionConfiguration = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;
var getHttpAuthExtensionConfiguration = (runtimeConfig) => {
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
let _credentials = runtimeConfig.credentials;
return {
setHttpAuthScheme(httpAuthScheme) {
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
if (index === -1) {
_httpAuthSchemes.push(httpAuthScheme);
} else {
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
}
},
httpAuthSchemes() {
return _httpAuthSchemes;
},
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
_httpAuthSchemeProvider = httpAuthSchemeProvider;
},
httpAuthSchemeProvider() {
return _httpAuthSchemeProvider;
},
setCredentials(credentials) {
_credentials = credentials;
},
credentials() {
return _credentials;
},
};
};
exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;
var resolveHttpAuthRuntimeConfig = (config) => {
return {
httpAuthSchemes: config.httpAuthSchemes(),
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
credentials: config.credentials(),
};
};
exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js
var require_runtimeExtensions = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveRuntimeExtensions = void 0;
var region_config_resolver_1 = require_dist_cjs45();
var protocol_http_1 = require_dist_cjs2();
var smithy_client_1 = require_dist_cjs32();
var httpAuthExtensionConfiguration_1 = require_httpAuthExtensionConfiguration();
var asPartial = (t) => t;
var resolveRuntimeExtensions = (runtimeConfig, extensions) => {
const extensionConfiguration = {
...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
...asPartial((0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)),
};
extensions.forEach((extension) => extension.configure(extensionConfiguration));
return {
...runtimeConfig,
...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
...(0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration),
};
};
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js
var require_STSClient = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.STSClient = exports.__Client = void 0;
var middleware_host_header_1 = require_dist_cjs3();
var middleware_logger_1 = require_dist_cjs4();
var middleware_recursion_detection_1 = require_dist_cjs5();
var middleware_user_agent_1 = require_dist_cjs8();
var config_resolver_1 = require_dist_cjs11();
var core_1 = require_dist_cjs34();
var middleware_content_length_1 = require_dist_cjs35();
var middleware_endpoint_1 = require_dist_cjs18();
var middleware_retry_1 = require_dist_cjs33();
var smithy_client_1 = require_dist_cjs32();
Object.defineProperty(exports, "__Client", {
enumerable: true,
get: () => smithy_client_1.Client,
});
var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider4();
var EndpointParameters_1 = require_EndpointParameters();
var runtimeConfig_1 = require_runtimeConfig3();
var runtimeExtensions_1 = require_runtimeExtensions();
var STSClient2 = class extends smithy_client_1.Client {
constructor(...[configuration]) {
const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1);
const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2);
const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3);
const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5);
const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6);
const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(
_config_7,
(configuration == null ? void 0 : configuration.extensions) || []
);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
this.middlewareStack.use(
(0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
})
);
this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));
}
destroy() {
super.destroy();
}
getDefaultHttpAuthSchemeParametersProvider() {
return httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider;
}
getIdentityProviderConfigProvider() {
return async (config) =>
new core_1.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials,
});
}
};
exports.STSClient = STSClient2;
},
});
// node_modules/@aws-sdk/client-sts/dist-cjs/index.js
var require_dist_cjs50 = __commonJS({
"node_modules/@aws-sdk/client-sts/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (
__copyProps2(target, mod, "default"),
secondTarget && __copyProps2(secondTarget, mod, "default")
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
AssumeRoleCommand: () => AssumeRoleCommand,
AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog,
AssumeRoleWithSAMLCommand: () => AssumeRoleWithSAMLCommand,
AssumeRoleWithSAMLRequestFilterSensitiveLog: () => AssumeRoleWithSAMLRequestFilterSensitiveLog,
AssumeRoleWithSAMLResponseFilterSensitiveLog: () => AssumeRoleWithSAMLResponseFilterSensitiveLog,
AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand,
AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
ClientInputEndpointParameters: () => import_EndpointParameters9.ClientInputEndpointParameters,
CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog,
DecodeAuthorizationMessageCommand: () => DecodeAuthorizationMessageCommand,
ExpiredTokenException: () => ExpiredTokenException,
GetAccessKeyInfoCommand: () => GetAccessKeyInfoCommand,
GetCallerIdentityCommand: () => GetCallerIdentityCommand,
GetFederationTokenCommand: () => GetFederationTokenCommand,
GetFederationTokenResponseFilterSensitiveLog: () => GetFederationTokenResponseFilterSensitiveLog,
GetSessionTokenCommand: () => GetSessionTokenCommand,
GetSessionTokenResponseFilterSensitiveLog: () => GetSessionTokenResponseFilterSensitiveLog,
IDPCommunicationErrorException: () => IDPCommunicationErrorException,
IDPRejectedClaimException: () => IDPRejectedClaimException,
InvalidAuthorizationMessageException: () => InvalidAuthorizationMessageException,
InvalidIdentityTokenException: () => InvalidIdentityTokenException,
MalformedPolicyDocumentException: () => MalformedPolicyDocumentException,
PackedPolicyTooLargeException: () => PackedPolicyTooLargeException,
RegionDisabledException: () => RegionDisabledException,
STS: () => STS,
STSServiceException: () => STSServiceException,
decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider,
getDefaultRoleAssumer: () => getDefaultRoleAssumer2,
getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2,
});
module2.exports = __toCommonJS2(src_exports);
__reExport(src_exports, require_STSClient(), module2.exports);
var import_middleware_endpoint = require_dist_cjs18();
var import_middleware_serde = require_dist_cjs17();
var import_EndpointParameters = require_EndpointParameters();
var import_smithy_client = require_dist_cjs32();
var _STSServiceException = class _STSServiceException2 extends import_smithy_client.ServiceException {
constructor(options) {
super(options);
Object.setPrototypeOf(this, _STSServiceException2.prototype);
}
};
__name(_STSServiceException, "STSServiceException");
var STSServiceException = _STSServiceException;
var _ExpiredTokenException = class _ExpiredTokenException2 extends STSServiceException {
constructor(opts) {
super({
name: "ExpiredTokenException",
$fault: "client",
...opts,
});
this.name = "ExpiredTokenException";
this.$fault = "client";
Object.setPrototypeOf(this, _ExpiredTokenException2.prototype);
}
};
__name(_ExpiredTokenException, "ExpiredTokenException");
var ExpiredTokenException = _ExpiredTokenException;
var _MalformedPolicyDocumentException = class _MalformedPolicyDocumentException2 extends STSServiceException {
constructor(opts) {
super({
name: "MalformedPolicyDocumentException",
$fault: "client",
...opts,
});
this.name = "MalformedPolicyDocumentException";
this.$fault = "client";
Object.setPrototypeOf(this, _MalformedPolicyDocumentException2.prototype);
}
};
__name(_MalformedPolicyDocumentException, "MalformedPolicyDocumentException");
var MalformedPolicyDocumentException = _MalformedPolicyDocumentException;
var _PackedPolicyTooLargeException = class _PackedPolicyTooLargeException2 extends STSServiceException {
constructor(opts) {
super({
name: "PackedPolicyTooLargeException",
$fault: "client",
...opts,
});
this.name = "PackedPolicyTooLargeException";
this.$fault = "client";
Object.setPrototypeOf(this, _PackedPolicyTooLargeException2.prototype);
}
};
__name(_PackedPolicyTooLargeException, "PackedPolicyTooLargeException");
var PackedPolicyTooLargeException = _PackedPolicyTooLargeException;
var _RegionDisabledException = class _RegionDisabledException2 extends STSServiceException {
constructor(opts) {
super({
name: "RegionDisabledException",
$fault: "client",
...opts,
});
this.name = "RegionDisabledException";
this.$fault = "client";
Object.setPrototypeOf(this, _RegionDisabledException2.prototype);
}
};
__name(_RegionDisabledException, "RegionDisabledException");
var RegionDisabledException = _RegionDisabledException;
var _IDPRejectedClaimException = class _IDPRejectedClaimException2 extends STSServiceException {
constructor(opts) {
super({
name: "IDPRejectedClaimException",
$fault: "client",
...opts,
});
this.name = "IDPRejectedClaimException";
this.$fault = "client";
Object.setPrototypeOf(this, _IDPRejectedClaimException2.prototype);
}
};
__name(_IDPRejectedClaimException, "IDPRejectedClaimException");
var IDPRejectedClaimException = _IDPRejectedClaimException;
var _InvalidIdentityTokenException = class _InvalidIdentityTokenException2 extends STSServiceException {
constructor(opts) {
super({
name: "InvalidIdentityTokenException",
$fault: "client",
...opts,
});
this.name = "InvalidIdentityTokenException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidIdentityTokenException2.prototype);
}
};
__name(_InvalidIdentityTokenException, "InvalidIdentityTokenException");
var InvalidIdentityTokenException = _InvalidIdentityTokenException;
var _IDPCommunicationErrorException = class _IDPCommunicationErrorException2 extends STSServiceException {
constructor(opts) {
super({
name: "IDPCommunicationErrorException",
$fault: "client",
...opts,
});
this.name = "IDPCommunicationErrorException";
this.$fault = "client";
Object.setPrototypeOf(this, _IDPCommunicationErrorException2.prototype);
}
};
__name(_IDPCommunicationErrorException, "IDPCommunicationErrorException");
var IDPCommunicationErrorException = _IDPCommunicationErrorException;
var _InvalidAuthorizationMessageException = class _InvalidAuthorizationMessageException2 extends STSServiceException {
constructor(opts) {
super({
name: "InvalidAuthorizationMessageException",
$fault: "client",
...opts,
});
this.name = "InvalidAuthorizationMessageException";
this.$fault = "client";
Object.setPrototypeOf(this, _InvalidAuthorizationMessageException2.prototype);
}
};
__name(_InvalidAuthorizationMessageException, "InvalidAuthorizationMessageException");
var InvalidAuthorizationMessageException = _InvalidAuthorizationMessageException;
var CredentialsFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.SecretAccessKey && { SecretAccessKey: import_smithy_client.SENSITIVE_STRING }),
}),
"CredentialsFilterSensitiveLog"
);
var AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
}),
"AssumeRoleResponseFilterSensitiveLog"
);
var AssumeRoleWithSAMLRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.SAMLAssertion && { SAMLAssertion: import_smithy_client.SENSITIVE_STRING }),
}),
"AssumeRoleWithSAMLRequestFilterSensitiveLog"
);
var AssumeRoleWithSAMLResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
}),
"AssumeRoleWithSAMLResponseFilterSensitiveLog"
);
var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.WebIdentityToken && { WebIdentityToken: import_smithy_client.SENSITIVE_STRING }),
}),
"AssumeRoleWithWebIdentityRequestFilterSensitiveLog"
);
var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
}),
"AssumeRoleWithWebIdentityResponseFilterSensitiveLog"
);
var GetFederationTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
}),
"GetFederationTokenResponseFilterSensitiveLog"
);
var GetSessionTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
}),
"GetSessionTokenResponseFilterSensitiveLog"
);
var import_core = require_dist_cjs37();
var import_protocol_http = require_dist_cjs2();
var se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_AssumeRoleRequest(input, context),
[_A]: _AR,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_AssumeRoleCommand");
var se_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_AssumeRoleWithSAMLRequest(input, context),
[_A]: _ARWSAML,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_AssumeRoleWithSAMLCommand");
var se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_AssumeRoleWithWebIdentityRequest(input, context),
[_A]: _ARWWI,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_AssumeRoleWithWebIdentityCommand");
var se_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_DecodeAuthorizationMessageRequest(input, context),
[_A]: _DAM,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_DecodeAuthorizationMessageCommand");
var se_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_GetAccessKeyInfoRequest(input, context),
[_A]: _GAKI,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_GetAccessKeyInfoCommand");
var se_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_GetCallerIdentityRequest(input, context),
[_A]: _GCI,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_GetCallerIdentityCommand");
var se_GetFederationTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_GetFederationTokenRequest(input, context),
[_A]: _GFT,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_GetFederationTokenCommand");
var se_GetSessionTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
const headers = SHARED_HEADERS;
let body;
body = buildFormUrlencodedString({
...se_GetSessionTokenRequest(input, context),
[_A]: _GST,
[_V]: _,
});
return buildHttpRpcRequest(context, headers, "/", void 0, body);
}, "se_GetSessionTokenCommand");
var de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_AssumeRoleResponse(data.AssumeRoleResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_AssumeRoleCommand");
var de_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_AssumeRoleWithSAMLCommand");
var de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_AssumeRoleWithWebIdentityCommand");
var de_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_DecodeAuthorizationMessageCommand");
var de_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_GetAccessKeyInfoCommand");
var de_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_GetCallerIdentityCommand");
var de_GetFederationTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_GetFederationTokenCommand");
var de_GetSessionTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode >= 300) {
return de_CommandError(output, context);
}
const data = await (0, import_core.parseXmlBody)(output.body, context);
let contents = {};
contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context);
const response = {
$metadata: deserializeMetadata(output),
...contents,
};
return response;
}, "de_GetSessionTokenCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
const parsedOutput = {
...output,
body: await (0, import_core.parseXmlErrorBody)(output.body, context),
};
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
switch (errorCode) {
case "ExpiredTokenException":
case "com.amazonaws.sts#ExpiredTokenException":
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
case "MalformedPolicyDocument":
case "com.amazonaws.sts#MalformedPolicyDocumentException":
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
case "PackedPolicyTooLarge":
case "com.amazonaws.sts#PackedPolicyTooLargeException":
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
case "RegionDisabledException":
case "com.amazonaws.sts#RegionDisabledException":
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
case "IDPRejectedClaim":
case "com.amazonaws.sts#IDPRejectedClaimException":
throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
case "InvalidIdentityToken":
case "com.amazonaws.sts#InvalidIdentityTokenException":
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
case "IDPCommunicationError":
case "com.amazonaws.sts#IDPCommunicationErrorException":
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
case "InvalidAuthorizationMessageException":
case "com.amazonaws.sts#InvalidAuthorizationMessageException":
throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
default: {
const parsedBody = parsedOutput.body;
return throwDefaultError({
output,
parsedBody: parsedBody.Error,
errorCode,
});
}
}
}, "de_CommandError");
var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_ExpiredTokenException(body.Error, context);
const exception = new ExpiredTokenException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_ExpiredTokenExceptionRes");
var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_IDPCommunicationErrorException(body.Error, context);
const exception = new IDPCommunicationErrorException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_IDPCommunicationErrorExceptionRes");
var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_IDPRejectedClaimException(body.Error, context);
const exception = new IDPRejectedClaimException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_IDPRejectedClaimExceptionRes");
var de_InvalidAuthorizationMessageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_InvalidAuthorizationMessageException(body.Error, context);
const exception = new InvalidAuthorizationMessageException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_InvalidAuthorizationMessageExceptionRes");
var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_InvalidIdentityTokenException(body.Error, context);
const exception = new InvalidIdentityTokenException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_InvalidIdentityTokenExceptionRes");
var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
const exception = new MalformedPolicyDocumentException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_MalformedPolicyDocumentExceptionRes");
var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
const exception = new PackedPolicyTooLargeException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_PackedPolicyTooLargeExceptionRes");
var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const body = parsedOutput.body;
const deserialized = de_RegionDisabledException(body.Error, context);
const exception = new RegionDisabledException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return (0, import_smithy_client.decorateServiceException)(exception, body);
}, "de_RegionDisabledExceptionRes");
var se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context) => {
var _a2, _b, _c, _d;
const entries = {};
if (input[_RA] != null) {
entries[_RA] = input[_RA];
}
if (input[_RSN] != null) {
entries[_RSN] = input[_RSN];
}
if (input[_PA] != null) {
const memberEntries = se_policyDescriptorListType(input[_PA], context);
if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
entries.PolicyArns = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `PolicyArns.${key}`;
entries[loc] = value;
});
}
if (input[_P] != null) {
entries[_P] = input[_P];
}
if (input[_DS] != null) {
entries[_DS] = input[_DS];
}
if (input[_T] != null) {
const memberEntries = se_tagListType(input[_T], context);
if (((_b = input[_T]) == null ? void 0 : _b.length) === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `Tags.${key}`;
entries[loc] = value;
});
}
if (input[_TTK] != null) {
const memberEntries = se_tagKeyListType(input[_TTK], context);
if (((_c = input[_TTK]) == null ? void 0 : _c.length) === 0) {
entries.TransitiveTagKeys = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `TransitiveTagKeys.${key}`;
entries[loc] = value;
});
}
if (input[_EI] != null) {
entries[_EI] = input[_EI];
}
if (input[_SN] != null) {
entries[_SN] = input[_SN];
}
if (input[_TC] != null) {
entries[_TC] = input[_TC];
}
if (input[_SI] != null) {
entries[_SI] = input[_SI];
}
if (input[_PC] != null) {
const memberEntries = se_ProvidedContextsListType(input[_PC], context);
if (((_d = input[_PC]) == null ? void 0 : _d.length) === 0) {
entries.ProvidedContexts = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `ProvidedContexts.${key}`;
entries[loc] = value;
});
}
return entries;
}, "se_AssumeRoleRequest");
var se_AssumeRoleWithSAMLRequest = /* @__PURE__ */ __name((input, context) => {
var _a2;
const entries = {};
if (input[_RA] != null) {
entries[_RA] = input[_RA];
}
if (input[_PAr] != null) {
entries[_PAr] = input[_PAr];
}
if (input[_SAMLA] != null) {
entries[_SAMLA] = input[_SAMLA];
}
if (input[_PA] != null) {
const memberEntries = se_policyDescriptorListType(input[_PA], context);
if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
entries.PolicyArns = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `PolicyArns.${key}`;
entries[loc] = value;
});
}
if (input[_P] != null) {
entries[_P] = input[_P];
}
if (input[_DS] != null) {
entries[_DS] = input[_DS];
}
return entries;
}, "se_AssumeRoleWithSAMLRequest");
var se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((input, context) => {
var _a2;
const entries = {};
if (input[_RA] != null) {
entries[_RA] = input[_RA];
}
if (input[_RSN] != null) {
entries[_RSN] = input[_RSN];
}
if (input[_WIT] != null) {
entries[_WIT] = input[_WIT];
}
if (input[_PI] != null) {
entries[_PI] = input[_PI];
}
if (input[_PA] != null) {
const memberEntries = se_policyDescriptorListType(input[_PA], context);
if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
entries.PolicyArns = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `PolicyArns.${key}`;
entries[loc] = value;
});
}
if (input[_P] != null) {
entries[_P] = input[_P];
}
if (input[_DS] != null) {
entries[_DS] = input[_DS];
}
return entries;
}, "se_AssumeRoleWithWebIdentityRequest");
var se_DecodeAuthorizationMessageRequest = /* @__PURE__ */ __name((input, context) => {
const entries = {};
if (input[_EM] != null) {
entries[_EM] = input[_EM];
}
return entries;
}, "se_DecodeAuthorizationMessageRequest");
var se_GetAccessKeyInfoRequest = /* @__PURE__ */ __name((input, context) => {
const entries = {};
if (input[_AKI] != null) {
entries[_AKI] = input[_AKI];
}
return entries;
}, "se_GetAccessKeyInfoRequest");
var se_GetCallerIdentityRequest = /* @__PURE__ */ __name((input, context) => {
const entries = {};
return entries;
}, "se_GetCallerIdentityRequest");
var se_GetFederationTokenRequest = /* @__PURE__ */ __name((input, context) => {
var _a2, _b;
const entries = {};
if (input[_N] != null) {
entries[_N] = input[_N];
}
if (input[_P] != null) {
entries[_P] = input[_P];
}
if (input[_PA] != null) {
const memberEntries = se_policyDescriptorListType(input[_PA], context);
if (((_a2 = input[_PA]) == null ? void 0 : _a2.length) === 0) {
entries.PolicyArns = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `PolicyArns.${key}`;
entries[loc] = value;
});
}
if (input[_DS] != null) {
entries[_DS] = input[_DS];
}
if (input[_T] != null) {
const memberEntries = se_tagListType(input[_T], context);
if (((_b = input[_T]) == null ? void 0 : _b.length) === 0) {
entries.Tags = [];
}
Object.entries(memberEntries).forEach(([key, value]) => {
const loc = `Tags.${key}`;
entries[loc] = value;
});
}
return entries;
}, "se_GetFederationTokenRequest");
var se_GetSessionTokenRequest = /* @__PURE__ */ __name((input, context) => {
const entries = {};
if (input[_DS] != null) {
entries[_DS] = input[_DS];
}
if (input[_SN] != null) {
entries[_SN] = input[_SN];
}
if (input[_TC] != null) {
entries[_TC] = input[_TC];
}
return entries;
}, "se_GetSessionTokenRequest");
var se_policyDescriptorListType = /* @__PURE__ */ __name((input, context) => {
const entries = {};
let counter = 1;
for (const entry of input) {
if (entry === null) {
continue;
}
const memberEntries = se_PolicyDescriptorType(entry, context);
Object.entries(memberEntries).forEach(([key, value]) => {
entries[`member.${counter}.${key}`] = value;
});
counter++;
}
return entries;
}, "se_policyDescriptorListType");
var se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context) => {
const entries = {};
if (input[_a] != null) {
entries[_a] = input[_a];
}
return entries;
}, "se_PolicyDescriptorType");
var se_ProvidedContext = /* @__PURE__ */ __name((input, context) => {
const entries = {};
if (input[_PAro] != null) {
entries[_PAro] = input[_PAro];
}
if (input[_CA] != null) {
entries[_CA] = input[_CA];
}
return entries;
}, "se_ProvidedContext");
var se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context) => {
const entries = {};
let counter = 1;
for (const entry of input) {
if (entry === null) {
continue;
}
const memberEntries = se_ProvidedContext(entry, context);
Object.entries(memberEntries).forEach(([key, value]) => {
entries[`member.${counter}.${key}`] = value;
});
counter++;
}
return entries;
}, "se_ProvidedContextsListType");
var se_Tag = /* @__PURE__ */ __name((input, context) => {
const entries = {};
if (input[_K] != null) {
entries[_K] = input[_K];
}
if (input[_Va] != null) {
entries[_Va] = input[_Va];
}
return entries;
}, "se_Tag");
var se_tagKeyListType = /* @__PURE__ */ __name((input, context) => {
const entries = {};
let counter = 1;
for (const entry of input) {
if (entry === null) {
continue;
}
entries[`member.${counter}`] = entry;
counter++;
}
return entries;
}, "se_tagKeyListType");
var se_tagListType = /* @__PURE__ */ __name((input, context) => {
const entries = {};
let counter = 1;
for (const entry of input) {
if (entry === null) {
continue;
}
const memberEntries = se_Tag(entry, context);
Object.entries(memberEntries).forEach(([key, value]) => {
entries[`member.${counter}.${key}`] = value;
});
counter++;
}
return entries;
}, "se_tagListType");
var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_ARI] != null) {
contents[_ARI] = (0, import_smithy_client.expectString)(output[_ARI]);
}
if (output[_Ar] != null) {
contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
}
return contents;
}, "de_AssumedRoleUser");
var de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_C] != null) {
contents[_C] = de_Credentials(output[_C], context);
}
if (output[_ARU] != null) {
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
}
if (output[_PPS] != null) {
contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
}
if (output[_SI] != null) {
contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
}
return contents;
}, "de_AssumeRoleResponse");
var de_AssumeRoleWithSAMLResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_C] != null) {
contents[_C] = de_Credentials(output[_C], context);
}
if (output[_ARU] != null) {
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
}
if (output[_PPS] != null) {
contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
}
if (output[_S] != null) {
contents[_S] = (0, import_smithy_client.expectString)(output[_S]);
}
if (output[_ST] != null) {
contents[_ST] = (0, import_smithy_client.expectString)(output[_ST]);
}
if (output[_I] != null) {
contents[_I] = (0, import_smithy_client.expectString)(output[_I]);
}
if (output[_Au] != null) {
contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]);
}
if (output[_NQ] != null) {
contents[_NQ] = (0, import_smithy_client.expectString)(output[_NQ]);
}
if (output[_SI] != null) {
contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
}
return contents;
}, "de_AssumeRoleWithSAMLResponse");
var de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_C] != null) {
contents[_C] = de_Credentials(output[_C], context);
}
if (output[_SFWIT] != null) {
contents[_SFWIT] = (0, import_smithy_client.expectString)(output[_SFWIT]);
}
if (output[_ARU] != null) {
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
}
if (output[_PPS] != null) {
contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
}
if (output[_Pr] != null) {
contents[_Pr] = (0, import_smithy_client.expectString)(output[_Pr]);
}
if (output[_Au] != null) {
contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]);
}
if (output[_SI] != null) {
contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
}
return contents;
}, "de_AssumeRoleWithWebIdentityResponse");
var de_Credentials = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_AKI] != null) {
contents[_AKI] = (0, import_smithy_client.expectString)(output[_AKI]);
}
if (output[_SAK] != null) {
contents[_SAK] = (0, import_smithy_client.expectString)(output[_SAK]);
}
if (output[_STe] != null) {
contents[_STe] = (0, import_smithy_client.expectString)(output[_STe]);
}
if (output[_E] != null) {
contents[_E] = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.parseRfc3339DateTimeWithOffset)(output[_E])
);
}
return contents;
}, "de_Credentials");
var de_DecodeAuthorizationMessageResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_DM] != null) {
contents[_DM] = (0, import_smithy_client.expectString)(output[_DM]);
}
return contents;
}, "de_DecodeAuthorizationMessageResponse");
var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_ExpiredTokenException");
var de_FederatedUser = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_FUI] != null) {
contents[_FUI] = (0, import_smithy_client.expectString)(output[_FUI]);
}
if (output[_Ar] != null) {
contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
}
return contents;
}, "de_FederatedUser");
var de_GetAccessKeyInfoResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_Ac] != null) {
contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]);
}
return contents;
}, "de_GetAccessKeyInfoResponse");
var de_GetCallerIdentityResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_UI] != null) {
contents[_UI] = (0, import_smithy_client.expectString)(output[_UI]);
}
if (output[_Ac] != null) {
contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]);
}
if (output[_Ar] != null) {
contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
}
return contents;
}, "de_GetCallerIdentityResponse");
var de_GetFederationTokenResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_C] != null) {
contents[_C] = de_Credentials(output[_C], context);
}
if (output[_FU] != null) {
contents[_FU] = de_FederatedUser(output[_FU], context);
}
if (output[_PPS] != null) {
contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
}
return contents;
}, "de_GetFederationTokenResponse");
var de_GetSessionTokenResponse = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_C] != null) {
contents[_C] = de_Credentials(output[_C], context);
}
return contents;
}, "de_GetSessionTokenResponse");
var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_IDPCommunicationErrorException");
var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_IDPRejectedClaimException");
var de_InvalidAuthorizationMessageException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_InvalidAuthorizationMessageException");
var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_InvalidIdentityTokenException");
var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_MalformedPolicyDocumentException");
var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_PackedPolicyTooLargeException");
var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => {
const contents = {};
if (output[_m] != null) {
contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
}
return contents;
}, "de_RegionDisabledException");
var deserializeMetadata = /* @__PURE__ */ __name(
(output) => ({
httpStatusCode: output.statusCode,
requestId:
output.headers["x-amzn-requestid"] ??
output.headers["x-amzn-request-id"] ??
output.headers["x-amz-request-id"],
extendedRequestId: output.headers["x-amz-id-2"],
cfId: output.headers["x-amz-cf-id"],
}),
"deserializeMetadata"
);
var throwDefaultError = (0, import_smithy_client.withBaseException)(STSServiceException);
var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
const contents = {
protocol,
hostname,
port,
method: "POST",
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
headers,
};
if (resolvedHostname !== void 0) {
contents.hostname = resolvedHostname;
}
if (body !== void 0) {
contents.body = body;
}
return new import_protocol_http.HttpRequest(contents);
}, "buildHttpRpcRequest");
var SHARED_HEADERS = {
"content-type": "application/x-www-form-urlencoded",
};
var _ = "2011-06-15";
var _A = "Action";
var _AKI = "AccessKeyId";
var _AR = "AssumeRole";
var _ARI = "AssumedRoleId";
var _ARU = "AssumedRoleUser";
var _ARWSAML = "AssumeRoleWithSAML";
var _ARWWI = "AssumeRoleWithWebIdentity";
var _Ac = "Account";
var _Ar = "Arn";
var _Au = "Audience";
var _C = "Credentials";
var _CA = "ContextAssertion";
var _DAM = "DecodeAuthorizationMessage";
var _DM = "DecodedMessage";
var _DS = "DurationSeconds";
var _E = "Expiration";
var _EI = "ExternalId";
var _EM = "EncodedMessage";
var _FU = "FederatedUser";
var _FUI = "FederatedUserId";
var _GAKI = "GetAccessKeyInfo";
var _GCI = "GetCallerIdentity";
var _GFT = "GetFederationToken";
var _GST = "GetSessionToken";
var _I = "Issuer";
var _K = "Key";
var _N = "Name";
var _NQ = "NameQualifier";
var _P = "Policy";
var _PA = "PolicyArns";
var _PAr = "PrincipalArn";
var _PAro = "ProviderArn";
var _PC = "ProvidedContexts";
var _PI = "ProviderId";
var _PPS = "PackedPolicySize";
var _Pr = "Provider";
var _RA = "RoleArn";
var _RSN = "RoleSessionName";
var _S = "Subject";
var _SAK = "SecretAccessKey";
var _SAMLA = "SAMLAssertion";
var _SFWIT = "SubjectFromWebIdentityToken";
var _SI = "SourceIdentity";
var _SN = "SerialNumber";
var _ST = "SubjectType";
var _STe = "SessionToken";
var _T = "Tags";
var _TC = "TokenCode";
var _TTK = "TransitiveTagKeys";
var _UI = "UserId";
var _V = "Version";
var _Va = "Value";
var _WIT = "WebIdentityToken";
var _a = "arn";
var _m = "message";
var buildFormUrlencodedString = /* @__PURE__ */ __name(
(formEntries) =>
Object.entries(formEntries)
.map(
([key, value]) =>
(0, import_smithy_client.extendedEncodeURIComponent)(key) +
"=" +
(0, import_smithy_client.extendedEncodeURIComponent)(value)
)
.join("&"),
"buildFormUrlencodedString"
);
var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
var _a2;
if (((_a2 = data.Error) == null ? void 0 : _a2.Code) !== void 0) {
return data.Error.Code;
}
if (output.statusCode == 404) {
return "NotFound";
}
}, "loadQueryErrorCode");
var _AssumeRoleCommand = class _AssumeRoleCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "AssumeRole", {})
.n("STSClient", "AssumeRoleCommand")
.f(void 0, AssumeRoleResponseFilterSensitiveLog)
.ser(se_AssumeRoleCommand)
.de(de_AssumeRoleCommand)
.build() {};
__name(_AssumeRoleCommand, "AssumeRoleCommand");
var AssumeRoleCommand = _AssumeRoleCommand;
var import_EndpointParameters2 = require_EndpointParameters();
var _AssumeRoleWithSAMLCommand = class _AssumeRoleWithSAMLCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters2.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {})
.n("STSClient", "AssumeRoleWithSAMLCommand")
.f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog)
.ser(se_AssumeRoleWithSAMLCommand)
.de(de_AssumeRoleWithSAMLCommand)
.build() {};
__name(_AssumeRoleWithSAMLCommand, "AssumeRoleWithSAMLCommand");
var AssumeRoleWithSAMLCommand = _AssumeRoleWithSAMLCommand;
var import_EndpointParameters3 = require_EndpointParameters();
var _AssumeRoleWithWebIdentityCommand = class _AssumeRoleWithWebIdentityCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters3.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {})
.n("STSClient", "AssumeRoleWithWebIdentityCommand")
.f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog)
.ser(se_AssumeRoleWithWebIdentityCommand)
.de(de_AssumeRoleWithWebIdentityCommand)
.build() {};
__name(_AssumeRoleWithWebIdentityCommand, "AssumeRoleWithWebIdentityCommand");
var AssumeRoleWithWebIdentityCommand = _AssumeRoleWithWebIdentityCommand;
var import_EndpointParameters4 = require_EndpointParameters();
var _DecodeAuthorizationMessageCommand = class _DecodeAuthorizationMessageCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters4.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {})
.n("STSClient", "DecodeAuthorizationMessageCommand")
.f(void 0, void 0)
.ser(se_DecodeAuthorizationMessageCommand)
.de(de_DecodeAuthorizationMessageCommand)
.build() {};
__name(_DecodeAuthorizationMessageCommand, "DecodeAuthorizationMessageCommand");
var DecodeAuthorizationMessageCommand = _DecodeAuthorizationMessageCommand;
var import_EndpointParameters5 = require_EndpointParameters();
var _GetAccessKeyInfoCommand = class _GetAccessKeyInfoCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters5.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {})
.n("STSClient", "GetAccessKeyInfoCommand")
.f(void 0, void 0)
.ser(se_GetAccessKeyInfoCommand)
.de(de_GetAccessKeyInfoCommand)
.build() {};
__name(_GetAccessKeyInfoCommand, "GetAccessKeyInfoCommand");
var GetAccessKeyInfoCommand = _GetAccessKeyInfoCommand;
var import_EndpointParameters6 = require_EndpointParameters();
var _GetCallerIdentityCommand = class _GetCallerIdentityCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters6.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {})
.n("STSClient", "GetCallerIdentityCommand")
.f(void 0, void 0)
.ser(se_GetCallerIdentityCommand)
.de(de_GetCallerIdentityCommand)
.build() {};
__name(_GetCallerIdentityCommand, "GetCallerIdentityCommand");
var GetCallerIdentityCommand = _GetCallerIdentityCommand;
var import_EndpointParameters7 = require_EndpointParameters();
var _GetFederationTokenCommand = class _GetFederationTokenCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters7.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {})
.n("STSClient", "GetFederationTokenCommand")
.f(void 0, GetFederationTokenResponseFilterSensitiveLog)
.ser(se_GetFederationTokenCommand)
.de(de_GetFederationTokenCommand)
.build() {};
__name(_GetFederationTokenCommand, "GetFederationTokenCommand");
var GetFederationTokenCommand = _GetFederationTokenCommand;
var import_EndpointParameters8 = require_EndpointParameters();
var _GetSessionTokenCommand = class _GetSessionTokenCommand extends import_smithy_client.Command.classBuilder()
.ep({
...import_EndpointParameters8.commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {})
.n("STSClient", "GetSessionTokenCommand")
.f(void 0, GetSessionTokenResponseFilterSensitiveLog)
.ser(se_GetSessionTokenCommand)
.de(de_GetSessionTokenCommand)
.build() {};
__name(_GetSessionTokenCommand, "GetSessionTokenCommand");
var GetSessionTokenCommand = _GetSessionTokenCommand;
var import_STSClient = require_STSClient();
var commands = {
AssumeRoleCommand,
AssumeRoleWithSAMLCommand,
AssumeRoleWithWebIdentityCommand,
DecodeAuthorizationMessageCommand,
GetAccessKeyInfoCommand,
GetCallerIdentityCommand,
GetFederationTokenCommand,
GetSessionTokenCommand,
};
var _STS = class _STS extends import_STSClient.STSClient {};
__name(_STS, "STS");
var STS = _STS;
(0, import_smithy_client.createAggregatedClient)(commands, STS);
var import_EndpointParameters9 = require_EndpointParameters();
var ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
var resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => {
var _a2;
const region = typeof _region === "function" ? await _region() : _region;
const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
(_a2 = credentialProviderLogger == null ? void 0 : credentialProviderLogger.debug) == null
? void 0
: _a2.call(
credentialProviderLogger,
"@aws-sdk/client-sts::resolveRegion",
"accepting first of:",
`${region} (provider)`,
`${parentRegion} (parent client)`,
`${ASSUME_ROLE_DEFAULT_REGION} (STS default)`
);
return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
}, "resolveRegion");
var getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => {
let stsClient;
let closureSourceCreds;
return async (sourceCreds, params) => {
var _a2, _b, _c;
closureSourceCreds = sourceCreds;
if (!stsClient) {
const {
logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger,
region,
requestHandler = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null
? void 0
: _b.requestHandler,
credentialProviderLogger,
} = stsOptions;
const resolvedRegion = await resolveRegion(
region,
(_c = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c.region,
credentialProviderLogger
);
stsClient = new stsClientCtor({
credentialDefaultProvider: () => async () => closureSourceCreds,
region: resolvedRegion,
requestHandler,
logger,
});
}
const { Credentials: Credentials2 } = await stsClient.send(new AssumeRoleCommand(params));
if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
}
return {
accessKeyId: Credentials2.AccessKeyId,
secretAccessKey: Credentials2.SecretAccessKey,
sessionToken: Credentials2.SessionToken,
expiration: Credentials2.Expiration,
credentialScope: Credentials2.CredentialScope,
};
};
}, "getDefaultRoleAssumer");
var getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => {
let stsClient;
return async (params) => {
var _a2, _b, _c;
if (!stsClient) {
const {
logger = (_a2 = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _a2.logger,
region,
requestHandler = (_b = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null
? void 0
: _b.requestHandler,
credentialProviderLogger,
} = stsOptions;
const resolvedRegion = await resolveRegion(
region,
(_c = stsOptions == null ? void 0 : stsOptions.parentClientConfig) == null ? void 0 : _c.region,
credentialProviderLogger
);
stsClient = new stsClientCtor({
region: resolvedRegion,
requestHandler,
logger,
});
}
const { Credentials: Credentials2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
}
return {
accessKeyId: Credentials2.AccessKeyId,
secretAccessKey: Credentials2.SecretAccessKey,
sessionToken: Credentials2.SessionToken,
expiration: Credentials2.Expiration,
credentialScope: Credentials2.CredentialScope,
};
};
}, "getDefaultRoleAssumerWithWebIdentity");
var import_STSClient2 = require_STSClient();
var getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => {
var _a2;
if (!customizations) return baseCtor;
else
return (
(_a2 = class extends baseCtor {
constructor(config) {
super(config);
for (const customization of customizations) {
this.middlewareStack.use(customization);
}
}
}),
__name(_a2, "CustomizableSTSClient"),
_a2
);
}, "getCustomizableStsClientCtor");
var getDefaultRoleAssumer2 = /* @__PURE__ */ __name(
(stsOptions = {}, stsPlugins) =>
getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)),
"getDefaultRoleAssumer"
);
var getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name(
(stsOptions = {}, stsPlugins) =>
getDefaultRoleAssumerWithWebIdentity(
stsOptions,
getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)
),
"getDefaultRoleAssumerWithWebIdentity"
);
var decorateDefaultCredentialProvider = /* @__PURE__ */ __name(
(provider) => (input) =>
provider({
roleAssumer: getDefaultRoleAssumer2(input),
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input),
...input,
}),
"decorateDefaultCredentialProvider"
);
},
});
// node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js
var require_dist_cjs51 = __commonJS({
"node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
fromProcess: () => fromProcess,
});
module2.exports = __toCommonJS2(src_exports);
var import_shared_ini_file_loader = require_dist_cjs13();
var import_property_provider = require_dist_cjs12();
var import_child_process = require("child_process");
var import_util = require("util");
var getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data) => {
if (data.Version !== 1) {
throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
}
if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) {
throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
}
if (data.Expiration) {
const currentTime = /* @__PURE__ */ new Date();
const expireTime = new Date(data.Expiration);
if (expireTime < currentTime) {
throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
}
}
return {
accessKeyId: data.AccessKeyId,
secretAccessKey: data.SecretAccessKey,
...(data.SessionToken && { sessionToken: data.SessionToken }),
...(data.Expiration && { expiration: new Date(data.Expiration) }),
...(data.CredentialScope && { credentialScope: data.CredentialScope }),
};
}, "getValidatedProcessCredentials");
var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger) => {
const profile = profiles[profileName];
if (profiles[profileName]) {
const credentialProcess = profile["credential_process"];
if (credentialProcess !== void 0) {
const execPromise = (0, import_util.promisify)(import_child_process.exec);
try {
const { stdout } = await execPromise(credentialProcess);
let data;
try {
data = JSON.parse(stdout.trim());
} catch {
throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
}
return getValidatedProcessCredentials(profileName, data);
} catch (error) {
throw new import_property_provider.CredentialsProviderError(error.message, {
logger,
});
}
} else {
throw new import_property_provider.CredentialsProviderError(
`Profile ${profileName} did not contain credential_process.`,
{ logger }
);
}
} else {
throw new import_property_provider.CredentialsProviderError(
`Profile ${profileName} could not be found in shared credentials file.`,
{
logger,
}
);
}
}, "resolveProcessCredentials");
var fromProcess = /* @__PURE__ */ __name(
(init = {}) =>
async () => {
var _a;
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-process - fromProcess");
const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
return resolveProcessCredentials(
(0, import_shared_ini_file_loader.getProfileName)(init),
profiles,
init.logger
);
},
"fromProcess"
);
},
});
// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js
var require_fromWebToken = __commonJS({
"node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js"(exports) {
var __createBinding =
(exports && exports.__createBinding) ||
(Object.create
? (o, m, k, k2) => {
if (k2 === void 0) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = {
enumerable: true,
get: () => m[k],
};
}
Object.defineProperty(o, k2, desc);
}
: (o, m, k, k2) => {
if (k2 === void 0) k2 = k;
o[k2] = m[k];
});
var __setModuleDefault =
(exports && exports.__setModuleDefault) ||
(Object.create
? (o, v) => {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}
: (o, v) => {
o["default"] = v;
});
var __importStar =
(exports && exports.__importStar) ||
((mod) => {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) {
for (var k in mod) if (k !== "default" && Object.hasOwn(mod, k)) __createBinding(result, mod, k);
}
__setModuleDefault(result, mod);
return result;
});
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromWebToken = void 0;
var fromWebToken2 = (init) => async () => {
var _a;
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
let { roleAssumerWithWebIdentity } = init;
if (!roleAssumerWithWebIdentity) {
const { getDefaultRoleAssumerWithWebIdentity } = await Promise.resolve().then(() =>
__importStar(require_dist_cjs50())
);
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity(
{
...init.clientConfig,
credentialProviderLogger: init.logger,
parentClientConfig: init.parentClientConfig,
},
init.clientPlugins
);
}
return roleAssumerWithWebIdentity({
RoleArn: roleArn,
RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
WebIdentityToken: webIdentityToken,
ProviderId: providerId,
PolicyArns: policyArns,
Policy: policy,
DurationSeconds: durationSeconds,
});
};
exports.fromWebToken = fromWebToken2;
},
});
// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js
var require_fromTokenFile = __commonJS({
"node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromTokenFile = void 0;
var property_provider_1 = require_dist_cjs12();
var fs_1 = require("fs");
var fromWebToken_1 = require_fromWebToken();
var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
var ENV_ROLE_ARN = "AWS_ROLE_ARN";
var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
var fromTokenFile2 =
(init = {}) =>
async () => {
var _a;
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
const webIdentityTokenFile = (init == null ? void 0 : init.webIdentityTokenFile) ?? process.env[ENV_TOKEN_FILE];
const roleArn = (init == null ? void 0 : init.roleArn) ?? process.env[ENV_ROLE_ARN];
const roleSessionName = (init == null ? void 0 : init.roleSessionName) ?? process.env[ENV_ROLE_SESSION_NAME];
if (!webIdentityTokenFile || !roleArn) {
throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified", {
logger: init.logger,
});
}
return (0, fromWebToken_1.fromWebToken)({
...init,
webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }),
roleArn,
roleSessionName,
})();
};
exports.fromTokenFile = fromTokenFile2;
},
});
// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js
var require_dist_cjs52 = __commonJS({
"node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (
__copyProps2(target, mod, "default"),
secondTarget && __copyProps2(secondTarget, mod, "default")
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
module2.exports = __toCommonJS2(src_exports);
__reExport(src_exports, require_fromTokenFile(), module2.exports);
__reExport(src_exports, require_fromWebToken(), module2.exports);
},
});
// node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js
var require_dist_cjs53 = __commonJS({
"node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js"(exports, module2) {
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (
(target = mod != null ? __create2(__getProtoOf2(mod)) : {}),
__copyProps2(
isNodeMode || !mod || !mod.__esModule
? __defProp2(target, "default", { value: mod, enumerable: true })
: target,
mod
)
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
fromIni: () => fromIni,
});
module2.exports = __toCommonJS2(src_exports);
var import_shared_ini_file_loader = require_dist_cjs13();
var import_property_provider = require_dist_cjs12();
var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger) => {
const sourceProvidersMap = {
EcsContainer: async (options) => {
const { fromHttp } = await Promise.resolve().then(() => __toESM2(require_dist_cjs40()));
const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs39()));
logger == null
? void 0
: logger.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
return (0, import_property_provider.chain)(fromHttp(options ?? {}), fromContainerMetadata(options));
},
Ec2InstanceMetadata: async (options) => {
logger == null
? void 0
: logger.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM2(require_dist_cjs39()));
return fromInstanceMetadata(options);
},
Environment: async (options) => {
logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
const { fromEnv } = await Promise.resolve().then(() => __toESM2(require_dist_cjs38()));
return fromEnv(options);
},
};
if (credentialSource in sourceProvidersMap) {
return sourceProvidersMap[credentialSource];
} else {
throw new import_property_provider.CredentialsProviderError(
`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,
{ logger }
);
}
}, "resolveCredentialSource");
var isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger } = {}) => {
return (
Boolean(arg) &&
typeof arg === "object" &&
typeof arg.role_arn === "string" &&
["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 &&
["undefined", "string"].indexOf(typeof arg.external_id) > -1 &&
["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 &&
(isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger }))
);
}, "isAssumeRoleProfile");
var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger }) => {
var _a;
const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
if (withSourceProfile) {
(_a = logger == null ? void 0 : logger.debug) == null
? void 0
: _a.call(logger, ` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
}
return withSourceProfile;
}, "isAssumeRoleWithSourceProfile");
var isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger }) => {
var _a;
const withProviderProfile =
typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
if (withProviderProfile) {
(_a = logger == null ? void 0 : logger.debug) == null
? void 0
: _a.call(logger, ` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
}
return withProviderProfile;
}, "isCredentialSourceProfile");
var resolveAssumeRoleCredentials = /* @__PURE__ */ __name(
async (profileName, profiles, options, visitedProfiles = {}) => {
var _a, _b;
(_a = options.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
const data = profiles[profileName];
if (!options.roleAssumer) {
const { getDefaultRoleAssumer } = await Promise.resolve().then(() => __toESM2(require_dist_cjs50()));
options.roleAssumer = getDefaultRoleAssumer(
{
...options.clientConfig,
credentialProviderLogger: options.logger,
parentClientConfig: options == null ? void 0 : options.parentClientConfig,
},
options.clientPlugins
);
}
const { source_profile } = data;
if (source_profile && source_profile in visitedProfiles) {
throw new import_property_provider.CredentialsProviderError(
`Detected a cycle attempting to resolve credentials for profile ${(0, import_shared_ini_file_loader.getProfileName)(options)}. Profiles visited: ` +
Object.keys(visitedProfiles).join(", "),
{ logger: options.logger }
);
}
(_b = options.logger) == null
? void 0
: _b.debug(
`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`
);
const sourceCredsProvider = source_profile
? resolveProfileData(
source_profile,
{
...profiles,
[source_profile]: {
...profiles[source_profile],
role_arn: data.role_arn ?? profiles[source_profile].role_arn,
},
},
options,
{
...visitedProfiles,
[source_profile]: true,
}
)
: (await resolveCredentialSource(data.credential_source, profileName, options.logger)(options))();
const params = {
RoleArn: data.role_arn,
RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`,
ExternalId: data.external_id,
DurationSeconds: parseInt(data.duration_seconds || "3600", 10),
};
const { mfa_serial } = data;
if (mfa_serial) {
if (!options.mfaCodeProvider) {
throw new import_property_provider.CredentialsProviderError(
`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`,
{ logger: options.logger, tryNextLink: false }
);
}
params.SerialNumber = mfa_serial;
params.TokenCode = await options.mfaCodeProvider(mfa_serial);
}
const sourceCreds = await sourceCredsProvider;
return options.roleAssumer(sourceCreds, params);
},
"resolveAssumeRoleCredentials"
);
var isProcessProfile = /* @__PURE__ */ __name(
(arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string",
"isProcessProfile"
);
var resolveProcessCredentials = /* @__PURE__ */ __name(
async (options, profile) =>
Promise.resolve()
.then(() => __toESM2(require_dist_cjs51()))
.then(({ fromProcess }) =>
fromProcess({
...options,
profile,
})()
),
"resolveProcessCredentials"
);
var resolveSsoCredentials = /* @__PURE__ */ __name(async (profile, options = {}) => {
const { fromSSO } = await Promise.resolve().then(() => __toESM2(require_dist_cjs49()));
return fromSSO({
profile,
logger: options.logger,
})();
}, "resolveSsoCredentials");
var isSsoProfile = /* @__PURE__ */ __name(
(arg) =>
arg &&
(typeof arg.sso_start_url === "string" ||
typeof arg.sso_account_id === "string" ||
typeof arg.sso_session === "string" ||
typeof arg.sso_region === "string" ||
typeof arg.sso_role_name === "string"),
"isSsoProfile"
);
var isStaticCredsProfile = /* @__PURE__ */ __name(
(arg) =>
Boolean(arg) &&
typeof arg === "object" &&
typeof arg.aws_access_key_id === "string" &&
typeof arg.aws_secret_access_key === "string" &&
["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1,
"isStaticCredsProfile"
);
var resolveStaticCredentials = /* @__PURE__ */ __name((profile, options) => {
var _a;
(_a = options == null ? void 0 : options.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
return Promise.resolve({
accessKeyId: profile.aws_access_key_id,
secretAccessKey: profile.aws_secret_access_key,
sessionToken: profile.aws_session_token,
credentialScope: profile.aws_credential_scope,
});
}, "resolveStaticCredentials");
var isWebIdentityProfile = /* @__PURE__ */ __name(
(arg) =>
Boolean(arg) &&
typeof arg === "object" &&
typeof arg.web_identity_token_file === "string" &&
typeof arg.role_arn === "string" &&
["undefined", "string"].indexOf(typeof arg.role_session_name) > -1,
"isWebIdentityProfile"
);
var resolveWebIdentityCredentials = /* @__PURE__ */ __name(
async (profile, options) =>
Promise.resolve()
.then(() => __toESM2(require_dist_cjs52()))
.then(({ fromTokenFile: fromTokenFile2 }) =>
fromTokenFile2({
webIdentityTokenFile: profile.web_identity_token_file,
roleArn: profile.role_arn,
roleSessionName: profile.role_session_name,
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
logger: options.logger,
parentClientConfig: options.parentClientConfig,
})()
),
"resolveWebIdentityCredentials"
);
var resolveProfileData = /* @__PURE__ */ __name(async (profileName, profiles, options, visitedProfiles = {}) => {
const data = profiles[profileName];
if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
return resolveStaticCredentials(data, options);
}
if (isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {
return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles);
}
if (isStaticCredsProfile(data)) {
return resolveStaticCredentials(data, options);
}
if (isWebIdentityProfile(data)) {
return resolveWebIdentityCredentials(data, options);
}
if (isProcessProfile(data)) {
return resolveProcessCredentials(options, profileName);
}
if (isSsoProfile(data)) {
return await resolveSsoCredentials(profileName, options);
}
throw new import_property_provider.CredentialsProviderError(
`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`,
{ logger: options.logger }
);
}, "resolveProfileData");
var fromIni = /* @__PURE__ */ __name(
(init = {}) =>
async () => {
var _a;
(_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-ini - fromIni");
const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
return resolveProfileData((0, import_shared_ini_file_loader.getProfileName)(init), profiles, init);
},
"fromIni"
);
},
});
// node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js
var require_dist_cjs54 = __commonJS({
"node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js"(exports, module2) {
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toESM2 = (mod, isNodeMode, target) => (
(target = mod != null ? __create2(__getProtoOf2(mod)) : {}),
__copyProps2(
isNodeMode || !mod || !mod.__esModule
? __defProp2(target, "default", { value: mod, enumerable: true })
: target,
mod
)
);
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
credentialsTreatedAsExpired: () => credentialsTreatedAsExpired,
credentialsWillNeedRefresh: () => credentialsWillNeedRefresh,
defaultProvider: () => defaultProvider,
});
module2.exports = __toCommonJS2(src_exports);
var import_credential_provider_env = require_dist_cjs38();
var import_shared_ini_file_loader = require_dist_cjs13();
var import_property_provider = require_dist_cjs12();
var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
var remoteProvider = /* @__PURE__ */ __name(async (init) => {
var _a, _b;
const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } =
await Promise.resolve().then(() => __toESM2(require_dist_cjs39()));
if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) {
(_a = init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");
const { fromHttp } = await Promise.resolve().then(() => __toESM2(require_dist_cjs40()));
return (0, import_property_provider.chain)(fromHttp(init), fromContainerMetadata(init));
}
if (process.env[ENV_IMDS_DISABLED]) {
return async () => {
throw new import_property_provider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", {
logger: init.logger,
});
};
}
(_b = init.logger) == null
? void 0
: _b.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata");
return fromInstanceMetadata(init);
}, "remoteProvider");
var defaultProvider = /* @__PURE__ */ __name(
(init = {}) =>
(0, import_property_provider.memoize)(
(0, import_property_provider.chain)(
...(init.profile || process.env[import_shared_ini_file_loader.ENV_PROFILE]
? []
: [
async () => {
var _a;
(_a = init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv");
return (0, import_credential_provider_env.fromEnv)(init)();
},
]),
async () => {
var _a;
(_a = init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
throw new import_property_provider.CredentialsProviderError(
"Skipping SSO provider in default chain (inputs do not include SSO fields).",
{ logger: init.logger }
);
}
const { fromSSO } = await Promise.resolve().then(() => __toESM2(require_dist_cjs49()));
return fromSSO(init)();
},
async () => {
var _a;
(_a = init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");
const { fromIni } = await Promise.resolve().then(() => __toESM2(require_dist_cjs53()));
return fromIni(init)();
},
async () => {
var _a;
(_a = init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");
const { fromProcess } = await Promise.resolve().then(() => __toESM2(require_dist_cjs51()));
return fromProcess(init)();
},
async () => {
var _a;
(_a = init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");
const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() =>
__toESM2(require_dist_cjs52())
);
return fromTokenFile2(init)();
},
async () => {
var _a;
(_a = init.logger) == null
? void 0
: _a.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider");
return (await remoteProvider(init))();
},
async () => {
throw new import_property_provider.CredentialsProviderError(
"Could not load credentials from any providers",
{
tryNextLink: false,
logger: init.logger,
}
);
}
),
credentialsTreatedAsExpired,
credentialsWillNeedRefresh
),
"defaultProvider"
);
var credentialsWillNeedRefresh = /* @__PURE__ */ __name(
(credentials) => (credentials == null ? void 0 : credentials.expiration) !== void 0,
"credentialsWillNeedRefresh"
);
var credentialsTreatedAsExpired = /* @__PURE__ */ __name(
(credentials) =>
(credentials == null ? void 0 : credentials.expiration) !== void 0 &&
credentials.expiration.getTime() - Date.now() < 3e5,
"credentialsTreatedAsExpired"
);
},
});
// node_modules/@aws-sdk/client-iot-wireless/dist-cjs/endpoint/ruleset.js
var require_ruleset4 = __commonJS({
"node_modules/@aws-sdk/client-iot-wireless/dist-cjs/endpoint/ruleset.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.ruleSet = void 0;
var s = "required";
var t = "fn";
var u = "argv";
var v = "ref";
var a = true;
var b = "isSet";
var c = "booleanEquals";
var d = "error";
var e = "endpoint";
var f = "tree";
var g = "PartitionResult";
var h = { [s]: false, type: "String" };
var i = { [s]: true, default: false, type: "Boolean" };
var j = { [v]: "Endpoint" };
var k = { [t]: c, [u]: [{ [v]: "UseFIPS" }, true] };
var l = { [t]: c, [u]: [{ [v]: "UseDualStack" }, true] };
var m = {};
var n = { [t]: "getAttr", [u]: [{ [v]: g }, "supportsFIPS"] };
var o = { [t]: c, [u]: [true, { [t]: "getAttr", [u]: [{ [v]: g }, "supportsDualStack"] }] };
var p = [k];
var q = [l];
var r = [{ [v]: "Region" }];
var _data = {
version: "1.0",
parameters: { Region: h, UseDualStack: i, UseFIPS: i, Endpoint: h },
rules: [
{
conditions: [{ [t]: b, [u]: [j] }],
rules: [
{
conditions: p,
error: "Invalid Configuration: FIPS and custom endpoint are not supported",
type: d,
},
{
conditions: q,
error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
type: d,
},
{ endpoint: { url: j, properties: m, headers: m }, type: e },
],
type: f,
},
{
conditions: [{ [t]: b, [u]: r }],
rules: [
{
conditions: [{ [t]: "aws.partition", [u]: r, assign: g }],
rules: [
{
conditions: [k, l],
rules: [
{
conditions: [{ [t]: c, [u]: [a, n] }, o],
rules: [
{
endpoint: {
url: "https://api.iotwireless-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: m,
headers: m,
},
type: e,
},
],
type: f,
},
{
error: "FIPS and DualStack are enabled, but this partition does not support one or both",
type: d,
},
],
type: f,
},
{
conditions: p,
rules: [
{
conditions: [{ [t]: c, [u]: [n, a] }],
rules: [
{
endpoint: {
url: "https://api.iotwireless-fips.{Region}.{PartitionResult#dnsSuffix}",
properties: m,
headers: m,
},
type: e,
},
],
type: f,
},
{ error: "FIPS is enabled but this partition does not support FIPS", type: d },
],
type: f,
},
{
conditions: q,
rules: [
{
conditions: [o],
rules: [
{
endpoint: {
url: "https://api.iotwireless.{Region}.{PartitionResult#dualStackDnsSuffix}",
properties: m,
headers: m,
},
type: e,
},
],
type: f,
},
{
error: "DualStack is enabled but this partition does not support DualStack",
type: d,
},
],
type: f,
},
{
endpoint: {
url: "https://api.iotwireless.{Region}.{PartitionResult#dnsSuffix}",
properties: m,
headers: m,
},
type: e,
},
],
type: f,
},
],
type: f,
},
{ error: "Invalid Configuration: Missing Region", type: d },
],
};
exports.ruleSet = _data;
},
});
// node_modules/@aws-sdk/client-iot-wireless/dist-cjs/endpoint/endpointResolver.js
var require_endpointResolver4 = __commonJS({
"node_modules/@aws-sdk/client-iot-wireless/dist-cjs/endpoint/endpointResolver.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultEndpointResolver = void 0;
var util_endpoints_1 = require_dist_cjs7();
var util_endpoints_2 = require_dist_cjs6();
var ruleset_1 = require_ruleset4();
var defaultEndpointResolver = (endpointParams, context = {}) => {
return (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
endpointParams,
logger: context.logger,
});
};
exports.defaultEndpointResolver = defaultEndpointResolver;
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
},
});
// node_modules/@aws-sdk/client-iot-wireless/dist-cjs/runtimeConfig.shared.js
var require_runtimeConfig_shared4 = __commonJS({
"node_modules/@aws-sdk/client-iot-wireless/dist-cjs/runtimeConfig.shared.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var core_1 = require_dist_cjs37();
var smithy_client_1 = require_dist_cjs32();
var url_parser_1 = require_dist_cjs16();
var util_base64_1 = require_dist_cjs25();
var util_utf8_1 = require_dist_cjs24();
var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider();
var endpointResolver_1 = require_endpointResolver4();
var getRuntimeConfig = (config) => {
return {
apiVersion: "2020-11-22",
base64Decoder: (config == null ? void 0 : config.base64Decoder) ?? util_base64_1.fromBase64,
base64Encoder: (config == null ? void 0 : config.base64Encoder) ?? util_base64_1.toBase64,
disableHostPrefix: (config == null ? void 0 : config.disableHostPrefix) ?? false,
endpointProvider:
(config == null ? void 0 : config.endpointProvider) ?? endpointResolver_1.defaultEndpointResolver,
extensions: (config == null ? void 0 : config.extensions) ?? [],
httpAuthSchemeProvider:
(config == null ? void 0 : config.httpAuthSchemeProvider) ??
httpAuthSchemeProvider_1.defaultIoTWirelessHttpAuthSchemeProvider,
httpAuthSchemes: (config == null ? void 0 : config.httpAuthSchemes) ?? [
{
schemeId: "aws.auth#sigv4",
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
signer: new core_1.AwsSdkSigV4Signer(),
},
],
logger: (config == null ? void 0 : config.logger) ?? new smithy_client_1.NoOpLogger(),
serviceId: (config == null ? void 0 : config.serviceId) ?? "IoT Wireless",
urlParser: (config == null ? void 0 : config.urlParser) ?? url_parser_1.parseUrl,
utf8Decoder: (config == null ? void 0 : config.utf8Decoder) ?? util_utf8_1.fromUtf8,
utf8Encoder: (config == null ? void 0 : config.utf8Encoder) ?? util_utf8_1.toUtf8,
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@aws-sdk/client-iot-wireless/dist-cjs/runtimeConfig.js
var require_runtimeConfig4 = __commonJS({
"node_modules/@aws-sdk/client-iot-wireless/dist-cjs/runtimeConfig.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRuntimeConfig = void 0;
var tslib_1 = require_tslib();
var package_json_1 = tslib_1.__importDefault(require_package());
var core_1 = require_dist_cjs37();
var credential_provider_node_1 = require_dist_cjs54();
var util_user_agent_node_1 = require_dist_cjs41();
var config_resolver_1 = require_dist_cjs11();
var hash_node_1 = require_dist_cjs42();
var middleware_retry_1 = require_dist_cjs33();
var node_config_provider_1 = require_dist_cjs14();
var node_http_handler_1 = require_dist_cjs28();
var util_body_length_node_1 = require_dist_cjs43();
var util_retry_1 = require_dist_cjs20();
var runtimeConfig_shared_1 = require_runtimeConfig_shared4();
var smithy_client_1 = require_dist_cjs32();
var util_defaults_mode_node_1 = require_dist_cjs44();
var smithy_client_2 = require_dist_cjs32();
var getRuntimeConfig = (config) => {
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
bodyLengthChecker:
(config == null ? void 0 : config.bodyLengthChecker) ?? util_body_length_node_1.calculateBodyLength,
credentialDefaultProvider:
(config == null ? void 0 : config.credentialDefaultProvider) ?? credential_provider_node_1.defaultProvider,
defaultUserAgentProvider:
(config == null ? void 0 : config.defaultUserAgentProvider) ??
(0, util_user_agent_node_1.defaultUserAgent)({
serviceId: clientSharedValues.serviceId,
clientVersion: package_json_1.default.version,
}),
maxAttempts:
(config == null ? void 0 : config.maxAttempts) ??
(0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region:
(config == null ? void 0 : config.region) ??
(0, node_config_provider_1.loadConfig)(
config_resolver_1.NODE_REGION_CONFIG_OPTIONS,
config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS
),
requestHandler: node_http_handler_1.NodeHttpHandler.create(
(config == null ? void 0 : config.requestHandler) ?? defaultConfigProvider
),
retryMode:
(config == null ? void 0 : config.retryMode) ??
(0, node_config_provider_1.loadConfig)({
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
}),
sha256: (config == null ? void 0 : config.sha256) ?? hash_node_1.Hash.bind(null, "sha256"),
streamCollector: (config == null ? void 0 : config.streamCollector) ?? node_http_handler_1.streamCollector,
useDualstackEndpoint:
(config == null ? void 0 : config.useDualstackEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
useFipsEndpoint:
(config == null ? void 0 : config.useFipsEndpoint) ??
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
};
};
exports.getRuntimeConfig = getRuntimeConfig;
},
});
// node_modules/@aws-sdk/client-iot-wireless/dist-cjs/index.js
var require_dist_cjs55 = __commonJS({
"node_modules/@aws-sdk/client-iot-wireless/dist-cjs/index.js"(exports, module2) {
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
var __export2 = (target, all) => {
for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
if ((from && typeof from === "object") || typeof from === "function") {
for (const key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable,
});
}
return to;
};
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export2(src_exports, {
AccessDeniedException: () => AccessDeniedException,
AggregationPeriod: () => AggregationPeriod,
ApplicationConfigType: () => ApplicationConfigType,
AssociateAwsAccountWithPartnerAccountCommand: () => AssociateAwsAccountWithPartnerAccountCommand,
AssociateAwsAccountWithPartnerAccountRequestFilterSensitiveLog: () =>
AssociateAwsAccountWithPartnerAccountRequestFilterSensitiveLog,
AssociateAwsAccountWithPartnerAccountResponseFilterSensitiveLog: () =>
AssociateAwsAccountWithPartnerAccountResponseFilterSensitiveLog,
AssociateMulticastGroupWithFuotaTaskCommand: () => AssociateMulticastGroupWithFuotaTaskCommand,
AssociateWirelessDeviceWithFuotaTaskCommand: () => AssociateWirelessDeviceWithFuotaTaskCommand,
AssociateWirelessDeviceWithMulticastGroupCommand: () => AssociateWirelessDeviceWithMulticastGroupCommand,
AssociateWirelessDeviceWithThingCommand: () => AssociateWirelessDeviceWithThingCommand,
AssociateWirelessGatewayWithCertificateCommand: () => AssociateWirelessGatewayWithCertificateCommand,
AssociateWirelessGatewayWithThingCommand: () => AssociateWirelessGatewayWithThingCommand,
BatteryLevel: () => BatteryLevel,
CancelMulticastGroupSessionCommand: () => CancelMulticastGroupSessionCommand,
ConflictException: () => ConflictException,
ConnectionStatus: () => ConnectionStatus,
CreateDestinationCommand: () => CreateDestinationCommand,
CreateDeviceProfileCommand: () => CreateDeviceProfileCommand,
CreateFuotaTaskCommand: () => CreateFuotaTaskCommand,
CreateMulticastGroupCommand: () => CreateMulticastGroupCommand,
CreateNetworkAnalyzerConfigurationCommand: () => CreateNetworkAnalyzerConfigurationCommand,
CreateServiceProfileCommand: () => CreateServiceProfileCommand,
CreateWirelessDeviceCommand: () => CreateWirelessDeviceCommand,
CreateWirelessGatewayCommand: () => CreateWirelessGatewayCommand,
CreateWirelessGatewayTaskCommand: () => CreateWirelessGatewayTaskCommand,
CreateWirelessGatewayTaskDefinitionCommand: () => CreateWirelessGatewayTaskDefinitionCommand,
DeleteDestinationCommand: () => DeleteDestinationCommand,
DeleteDeviceProfileCommand: () => DeleteDeviceProfileCommand,
DeleteFuotaTaskCommand: () => DeleteFuotaTaskCommand,
DeleteMulticastGroupCommand: () => DeleteMulticastGroupCommand,
DeleteNetworkAnalyzerConfigurationCommand: () => DeleteNetworkAnalyzerConfigurationCommand,
DeleteQueuedMessagesCommand: () => DeleteQueuedMessagesCommand,
DeleteServiceProfileCommand: () => DeleteServiceProfileCommand,
DeleteWirelessDeviceCommand: () => DeleteWirelessDeviceCommand,
DeleteWirelessDeviceImportTaskCommand: () => DeleteWirelessDeviceImportTaskCommand,
DeleteWirelessGatewayCommand: () => DeleteWirelessGatewayCommand,
DeleteWirelessGatewayTaskCommand: () => DeleteWirelessGatewayTaskCommand,
DeleteWirelessGatewayTaskDefinitionCommand: () => DeleteWirelessGatewayTaskDefinitionCommand,
DeregisterWirelessDeviceCommand: () => DeregisterWirelessDeviceCommand,
DeviceProfileType: () => DeviceProfileType,
DeviceState: () => DeviceState,
DimensionName: () => DimensionName,
DisassociateAwsAccountFromPartnerAccountCommand: () => DisassociateAwsAccountFromPartnerAccountCommand,
DisassociateMulticastGroupFromFuotaTaskCommand: () => DisassociateMulticastGroupFromFuotaTaskCommand,
DisassociateWirelessDeviceFromFuotaTaskCommand: () => DisassociateWirelessDeviceFromFuotaTaskCommand,
DisassociateWirelessDeviceFromMulticastGroupCommand: () => DisassociateWirelessDeviceFromMulticastGroupCommand,
DisassociateWirelessDeviceFromThingCommand: () => DisassociateWirelessDeviceFromThingCommand,
DisassociateWirelessGatewayFromCertificateCommand: () => DisassociateWirelessGatewayFromCertificateCommand,
DisassociateWirelessGatewayFromThingCommand: () => DisassociateWirelessGatewayFromThingCommand,
DlClass: () => DlClass,
DownlinkMode: () => DownlinkMode,
Event: () => Event,
EventNotificationPartnerType: () => EventNotificationPartnerType,
EventNotificationResourceType: () => EventNotificationResourceType,
EventNotificationTopicStatus: () => EventNotificationTopicStatus,
ExpressionType: () => ExpressionType,
FuotaDeviceStatus: () => FuotaDeviceStatus,
FuotaTaskStatus: () => FuotaTaskStatus,
GetDestinationCommand: () => GetDestinationCommand,
GetDeviceProfileCommand: () => GetDeviceProfileCommand,
GetDeviceProfileResponseFilterSensitiveLog: () => GetDeviceProfileResponseFilterSensitiveLog,
GetEventConfigurationByResourceTypesCommand: () => GetEventConfigurationByResourceTypesCommand,
GetFuotaTaskCommand: () => GetFuotaTaskCommand,
GetLogLevelsByResourceTypesCommand: () => GetLogLevelsByResourceTypesCommand,
GetMetricConfigurationCommand: () => GetMetricConfigurationCommand,
GetMetricsCommand: () => GetMetricsCommand,
GetMulticastGroupCommand: () => GetMulticastGroupCommand,
GetMulticastGroupSessionCommand: () => GetMulticastGroupSessionCommand,
GetNetworkAnalyzerConfigurationCommand: () => GetNetworkAnalyzerConfigurationCommand,
GetPartnerAccountCommand: () => GetPartnerAccountCommand,
GetPartnerAccountResponseFilterSensitiveLog: () => GetPartnerAccountResponseFilterSensitiveLog,
GetPositionCommand: () => GetPositionCommand,
GetPositionConfigurationCommand: () => GetPositionConfigurationCommand,
GetPositionEstimateCommand: () => GetPositionEstimateCommand2,
GetResourceEventConfigurationCommand: () => GetResourceEventConfigurationCommand,
GetResourceLogLevelCommand: () => GetResourceLogLevelCommand,
GetResourcePositionCommand: () => GetResourcePositionCommand,
GetServiceEndpointCommand: () => GetServiceEndpointCommand,
GetServiceProfileCommand: () => GetServiceProfileCommand,
GetWirelessDeviceCommand: () => GetWirelessDeviceCommand,
GetWirelessDeviceImportTaskCommand: () => GetWirelessDeviceImportTaskCommand,
GetWirelessDeviceStatisticsCommand: () => GetWirelessDeviceStatisticsCommand,
GetWirelessGatewayCertificateCommand: () => GetWirelessGatewayCertificateCommand,
GetWirelessGatewayCommand: () => GetWirelessGatewayCommand,
GetWirelessGatewayFirmwareInformationCommand: () => GetWirelessGatewayFirmwareInformationCommand,
GetWirelessGatewayStatisticsCommand: () => GetWirelessGatewayStatisticsCommand,
GetWirelessGatewayTaskCommand: () => GetWirelessGatewayTaskCommand,
GetWirelessGatewayTaskDefinitionCommand: () => GetWirelessGatewayTaskDefinitionCommand,
IdentifierType: () => IdentifierType,
ImportTaskStatus: () => ImportTaskStatus,
InternalServerException: () => InternalServerException,
IoTWireless: () => IoTWireless,
IoTWirelessClient: () => IoTWirelessClient2,
IoTWirelessServiceException: () => IoTWirelessServiceException,
ListDestinationsCommand: () => ListDestinationsCommand,
ListDeviceProfilesCommand: () => ListDeviceProfilesCommand,
ListDevicesForWirelessDeviceImportTaskCommand: () => ListDevicesForWirelessDeviceImportTaskCommand,
ListEventConfigurationsCommand: () => ListEventConfigurationsCommand,
ListFuotaTasksCommand: () => ListFuotaTasksCommand,
ListMulticastGroupsByFuotaTaskCommand: () => ListMulticastGroupsByFuotaTaskCommand,
ListMulticastGroupsCommand: () => ListMulticastGroupsCommand,
ListNetworkAnalyzerConfigurationsCommand: () => ListNetworkAnalyzerConfigurationsCommand,
ListPartnerAccountsCommand: () => ListPartnerAccountsCommand,
ListPartnerAccountsResponseFilterSensitiveLog: () => ListPartnerAccountsResponseFilterSensitiveLog,
ListPositionConfigurationsCommand: () => ListPositionConfigurationsCommand,
ListQueuedMessagesCommand: () => ListQueuedMessagesCommand,
ListServiceProfilesCommand: () => ListServiceProfilesCommand,
ListTagsForResourceCommand: () => ListTagsForResourceCommand,
ListWirelessDeviceImportTasksCommand: () => ListWirelessDeviceImportTasksCommand,
ListWirelessDevicesCommand: () => ListWirelessDevicesCommand,
ListWirelessGatewayTaskDefinitionsCommand: () => ListWirelessGatewayTaskDefinitionsCommand,
ListWirelessGatewaysCommand: () => ListWirelessGatewaysCommand,
LogLevel: () => LogLevel,
MessageType: () => MessageType,
MetricName: () => MetricName,
MetricQueryStatus: () => MetricQueryStatus,
MulticastFrameInfo: () => MulticastFrameInfo,
OnboardStatus: () => OnboardStatus,
PartnerType: () => PartnerType,
PositionConfigurationFec: () => PositionConfigurationFec,
PositionConfigurationStatus: () => PositionConfigurationStatus,
PositionResourceType: () => PositionResourceType,
PositionSolverProvider: () => PositionSolverProvider,
PositionSolverType: () => PositionSolverType,
PositioningConfigStatus: () => PositioningConfigStatus,
PutPositionConfigurationCommand: () => PutPositionConfigurationCommand,
PutResourceLogLevelCommand: () => PutResourceLogLevelCommand,
ResetAllResourceLogLevelsCommand: () => ResetAllResourceLogLevelsCommand,
ResetResourceLogLevelCommand: () => ResetResourceLogLevelCommand,
ResourceNotFoundException: () => ResourceNotFoundException,
SendDataToMulticastGroupCommand: () => SendDataToMulticastGroupCommand,
SendDataToWirelessDeviceCommand: () => SendDataToWirelessDeviceCommand,
SidewalkAccountInfoFilterSensitiveLog: () => SidewalkAccountInfoFilterSensitiveLog,
SidewalkAccountInfoWithFingerprintFilterSensitiveLog: () => SidewalkAccountInfoWithFingerprintFilterSensitiveLog,
SidewalkGetDeviceProfileFilterSensitiveLog: () => SidewalkGetDeviceProfileFilterSensitiveLog,
SidewalkUpdateAccountFilterSensitiveLog: () => SidewalkUpdateAccountFilterSensitiveLog,
SigningAlg: () => SigningAlg,
StartBulkAssociateWirelessDeviceWithMulticastGroupCommand: () =>
StartBulkAssociateWirelessDeviceWithMulticastGroupCommand,
StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand: () =>
StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand,
StartFuotaTaskCommand: () => StartFuotaTaskCommand,
StartMulticastGroupSessionCommand: () => StartMulticastGroupSessionCommand,
StartSingleWirelessDeviceImportTaskCommand: () => StartSingleWirelessDeviceImportTaskCommand,
StartWirelessDeviceImportTaskCommand: () => StartWirelessDeviceImportTaskCommand,
SummaryMetricConfigurationStatus: () => SummaryMetricConfigurationStatus,
SupportedRfRegion: () => SupportedRfRegion,
TagResourceCommand: () => TagResourceCommand,
TestWirelessDeviceCommand: () => TestWirelessDeviceCommand,
ThrottlingException: () => ThrottlingException,
TooManyTagsException: () => TooManyTagsException,
UntagResourceCommand: () => UntagResourceCommand,
UpdateDestinationCommand: () => UpdateDestinationCommand,
UpdateEventConfigurationByResourceTypesCommand: () => UpdateEventConfigurationByResourceTypesCommand,
UpdateFuotaTaskCommand: () => UpdateFuotaTaskCommand,
UpdateLogLevelsByResourceTypesCommand: () => UpdateLogLevelsByResourceTypesCommand,
UpdateMetricConfigurationCommand: () => UpdateMetricConfigurationCommand,
UpdateMulticastGroupCommand: () => UpdateMulticastGroupCommand,
UpdateNetworkAnalyzerConfigurationCommand: () => UpdateNetworkAnalyzerConfigurationCommand,
UpdatePartnerAccountCommand: () => UpdatePartnerAccountCommand,
UpdatePartnerAccountRequestFilterSensitiveLog: () => UpdatePartnerAccountRequestFilterSensitiveLog,
UpdatePositionCommand: () => UpdatePositionCommand,
UpdateResourceEventConfigurationCommand: () => UpdateResourceEventConfigurationCommand,
UpdateResourcePositionCommand: () => UpdateResourcePositionCommand,
UpdateWirelessDeviceCommand: () => UpdateWirelessDeviceCommand,
UpdateWirelessDeviceImportTaskCommand: () => UpdateWirelessDeviceImportTaskCommand,
UpdateWirelessGatewayCommand: () => UpdateWirelessGatewayCommand,
ValidationException: () => ValidationException,
WirelessDeviceEvent: () => WirelessDeviceEvent,
WirelessDeviceFrameInfo: () => WirelessDeviceFrameInfo,
WirelessDeviceIdType: () => WirelessDeviceIdType,
WirelessDeviceSidewalkStatus: () => WirelessDeviceSidewalkStatus,
WirelessDeviceType: () => WirelessDeviceType,
WirelessGatewayEvent: () => WirelessGatewayEvent,
WirelessGatewayIdType: () => WirelessGatewayIdType,
WirelessGatewayServiceType: () => WirelessGatewayServiceType,
WirelessGatewayTaskDefinitionType: () => WirelessGatewayTaskDefinitionType,
WirelessGatewayTaskStatus: () => WirelessGatewayTaskStatus,
WirelessGatewayType: () => WirelessGatewayType,
__Client: () => import_smithy_client.Client,
paginateListDestinations: () => paginateListDestinations,
paginateListDeviceProfiles: () => paginateListDeviceProfiles,
paginateListFuotaTasks: () => paginateListFuotaTasks,
paginateListMulticastGroups: () => paginateListMulticastGroups,
paginateListMulticastGroupsByFuotaTask: () => paginateListMulticastGroupsByFuotaTask,
paginateListNetworkAnalyzerConfigurations: () => paginateListNetworkAnalyzerConfigurations,
paginateListPositionConfigurations: () => paginateListPositionConfigurations,
paginateListQueuedMessages: () => paginateListQueuedMessages,
paginateListServiceProfiles: () => paginateListServiceProfiles,
paginateListWirelessDevices: () => paginateListWirelessDevices,
paginateListWirelessGateways: () => paginateListWirelessGateways,
});
module2.exports = __toCommonJS2(src_exports);
var import_middleware_host_header = require_dist_cjs3();
var import_middleware_logger = require_dist_cjs4();
var import_middleware_recursion_detection = require_dist_cjs5();
var import_middleware_user_agent = require_dist_cjs8();
var import_config_resolver = require_dist_cjs11();
var import_core = require_dist_cjs34();
var import_middleware_content_length = require_dist_cjs35();
var import_middleware_endpoint = require_dist_cjs18();
var import_middleware_retry = require_dist_cjs33();
var import_httpAuthSchemeProvider = require_httpAuthSchemeProvider();
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
return {
...options,
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
defaultSigningName: "iotwireless",
};
}, "resolveClientEndpointParameters");
var commonParams = {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
var import_runtimeConfig = require_runtimeConfig4();
var import_region_config_resolver = require_dist_cjs45();
var import_protocol_http = require_dist_cjs2();
var import_smithy_client = require_dist_cjs32();
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
let _credentials = runtimeConfig.credentials;
return {
setHttpAuthScheme(httpAuthScheme) {
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
if (index === -1) {
_httpAuthSchemes.push(httpAuthScheme);
} else {
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
}
},
httpAuthSchemes() {
return _httpAuthSchemes;
},
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
_httpAuthSchemeProvider = httpAuthSchemeProvider;
},
httpAuthSchemeProvider() {
return _httpAuthSchemeProvider;
},
setCredentials(credentials) {
_credentials = credentials;
},
credentials() {
return _credentials;
},
};
}, "getHttpAuthExtensionConfiguration");
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
return {
httpAuthSchemes: config.httpAuthSchemes(),
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
credentials: config.credentials(),
};
}, "resolveHttpAuthRuntimeConfig");
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
const extensionConfiguration = {
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
};
extensions.forEach((extension) => extension.configure(extensionConfiguration));
return {
...runtimeConfig,
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
};
}, "resolveRuntimeExtensions");
var _IoTWirelessClient = class _IoTWirelessClient extends import_smithy_client.Client {
constructor(...[configuration]) {
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
const _config_8 = resolveRuntimeExtensions(
_config_7,
(configuration == null ? void 0 : configuration.extensions) || []
);
super(_config_8);
this.config = _config_8;
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
this.middlewareStack.use(
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
})
);
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
}
destroy() {
super.destroy();
}
getDefaultHttpAuthSchemeParametersProvider() {
return import_httpAuthSchemeProvider.defaultIoTWirelessHttpAuthSchemeParametersProvider;
}
getIdentityProviderConfigProvider() {
return async (config) =>
new import_core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials,
});
}
};
__name(_IoTWirelessClient, "IoTWirelessClient");
var IoTWirelessClient2 = _IoTWirelessClient;
var import_middleware_serde = require_dist_cjs17();
var _IoTWirelessServiceException = class _IoTWirelessServiceException2
extends import_smithy_client.ServiceException
{
constructor(options) {
super(options);
Object.setPrototypeOf(this, _IoTWirelessServiceException2.prototype);
}
};
__name(_IoTWirelessServiceException, "IoTWirelessServiceException");
var IoTWirelessServiceException = _IoTWirelessServiceException;
var _AccessDeniedException = class _AccessDeniedException2 extends IoTWirelessServiceException {
constructor(opts) {
super({
name: "AccessDeniedException",
$fault: "client",
...opts,
});
this.name = "AccessDeniedException";
this.$fault = "client";
Object.setPrototypeOf(this, _AccessDeniedException2.prototype);
this.Message = opts.Message;
}
};
__name(_AccessDeniedException, "AccessDeniedException");
var AccessDeniedException = _AccessDeniedException;
var AggregationPeriod = {
OneDay: "OneDay",
OneHour: "OneHour",
OneWeek: "OneWeek",
};
var ApplicationConfigType = {
SemtechGeoLocation: "SemtechGeolocation",
};
var _ConflictException = class _ConflictException2 extends IoTWirelessServiceException {
constructor(opts) {
super({
name: "ConflictException",
$fault: "client",
...opts,
});
this.name = "ConflictException";
this.$fault = "client";
Object.setPrototypeOf(this, _ConflictException2.prototype);
this.Message = opts.Message;
this.ResourceId = opts.ResourceId;
this.ResourceType = opts.ResourceType;
}
};
__name(_ConflictException, "ConflictException");
var ConflictException = _ConflictException;
var _InternalServerException = class _InternalServerException2 extends IoTWirelessServiceException {
constructor(opts) {
super({
name: "InternalServerException",
$fault: "server",
...opts,
});
this.name = "InternalServerException";
this.$fault = "server";
Object.setPrototypeOf(this, _InternalServerException2.prototype);
this.Message = opts.Message;
}
};
__name(_InternalServerException, "InternalServerException");
var InternalServerException = _InternalServerException;
var _ResourceNotFoundException = class _ResourceNotFoundException2 extends IoTWirelessServiceException {
constructor(opts) {
super({
name: "ResourceNotFoundException",
$fault: "client",
...opts,
});
this.name = "ResourceNotFoundException";
this.$fault = "client";
Object.setPrototypeOf(this, _ResourceNotFoundException2.prototype);
this.Message = opts.Message;
this.ResourceId = opts.ResourceId;
this.ResourceType = opts.ResourceType;
}
};
__name(_ResourceNotFoundException, "ResourceNotFoundException");
var ResourceNotFoundException = _ResourceNotFoundException;
var _ThrottlingException = class _ThrottlingException2 extends IoTWirelessServiceException {
constructor(opts) {
super({
name: "ThrottlingException",
$fault: "client",
...opts,
});
this.name = "ThrottlingException";
this.$fault = "client";
Object.setPrototypeOf(this, _ThrottlingException2.prototype);
this.Message = opts.Message;
}
};
__name(_ThrottlingException, "ThrottlingException");
var ThrottlingException = _ThrottlingException;
var _ValidationException = class _ValidationException2 extends IoTWirelessServiceException {
constructor(opts) {
super({
name: "ValidationException",
$fault: "client",
...opts,
});
this.name = "ValidationException";
this.$fault = "client";
Object.setPrototypeOf(this, _ValidationException2.prototype);
this.Message = opts.Message;
}
};
__name(_ValidationException, "ValidationException");
var ValidationException = _ValidationException;
var BatteryLevel = {
CRITICAL: "critical",
LOW: "low",
NORMAL: "normal",
};
var SigningAlg = {
Ed25519: "Ed25519",
P256r1: "P256r1",
};
var ConnectionStatus = {
CONNECTED: "Connected",
DISCONNECTED: "Disconnected",
};
var EventNotificationTopicStatus = {
Disabled: "Disabled",
Enabled: "Enabled",
};
var ExpressionType = {
MqttTopic: "MqttTopic",
RuleName: "RuleName",
};
var SupportedRfRegion = {
AS923_1: "AS923-1",
AS923_2: "AS923-2",
AS923_3: "AS923-3",
AS923_4: "AS923-4",
AU915: "AU915",
CN470: "CN470",
CN779: "CN779",
EU433: "EU433",
EU868: "EU868",
IN865: "IN865",
KR920: "KR920",
RU864: "RU864",
US915: "US915",
};
var DlClass = {
ClassB: "ClassB",
ClassC: "ClassC",
};
var LogLevel = {
DISABLED: "DISABLED",
ERROR: "ERROR",
INFO: "INFO",
};
var MulticastFrameInfo = {
DISABLED: "DISABLED",
ENABLED: "ENABLED",
};
var WirelessDeviceFrameInfo = {
DISABLED: "DISABLED",
ENABLED: "ENABLED",
};
var PositioningConfigStatus = {
Disabled: "Disabled",
Enabled: "Enabled",
};
var WirelessDeviceType = {
LoRaWAN: "LoRaWAN",
Sidewalk: "Sidewalk",
};
var WirelessGatewayTaskStatus = {
COMPLETED: "COMPLETED",
FAILED: "FAILED",
FIRST_RETRY: "FIRST_RETRY",
IN_PROGRESS: "IN_PROGRESS",
PENDING: "PENDING",
SECOND_RETRY: "SECOND_RETRY",
};
var DeviceProfileType = {
LoRaWAN: "LoRaWAN",
Sidewalk: "Sidewalk",
};
var DeviceState = {
PROVISIONED: "Provisioned",
REGISTEREDNOTSEEN: "RegisteredNotSeen",
REGISTEREDREACHABLE: "RegisteredReachable",
REGISTEREDUNREACHABLE: "RegisteredUnreachable",
};
var DimensionName = {
DeviceId: "DeviceId",
GatewayId: "GatewayId",
};
var PartnerType = {
Sidewalk: "Sidewalk",
};
var DownlinkMode = {
CONCURRENT: "CONCURRENT",
SEQUENTIAL: "SEQUENTIAL",
USING_UPLINK_GATEWAY: "USING_UPLINK_GATEWAY",
};
var Event = {
ACK: "ack",
DISCOVERED: "discovered",
LOST: "lost",
NACK: "nack",
PASSTHROUGH: "passthrough",
};
var IdentifierType = {
DevEui: "DevEui",
GatewayEui: "GatewayEui",
PartnerAccountId: "PartnerAccountId",
WirelessDeviceId: "WirelessDeviceId",
WirelessGatewayId: "WirelessGatewayId",
};
var EventNotificationPartnerType = {
Sidewalk: "Sidewalk",
};
var EventNotificationResourceType = {
SidewalkAccount: "SidewalkAccount",
WirelessDevice: "WirelessDevice",
WirelessGateway: "WirelessGateway",
};
var FuotaDeviceStatus = {
Device_exist_in_conflict_fuota_task: "Device_exist_in_conflict_fuota_task",
FragAlgo_unsupported: "FragAlgo_unsupported",
FragIndex_unsupported: "FragIndex_unsupported",
Initial: "Initial",
MICError: "MICError",
MemoryError: "MemoryError",
MissingFrag: "MissingFrag",
Not_enough_memory: "Not_enough_memory",
Package_Not_Supported: "Package_Not_Supported",
SessionCnt_replay: "SessionCnt_replay",
Successful: "Successful",
Wrong_descriptor: "Wrong_descriptor",
};
var FuotaTaskStatus = {
Delete_Waiting: "Delete_Waiting",
FuotaDone: "FuotaDone",
FuotaSession_Waiting: "FuotaSession_Waiting",
In_FuotaSession: "In_FuotaSession",
Pending: "Pending",
};
var WirelessDeviceEvent = {
Downlink_Data: "Downlink_Data",
Join: "Join",
Registration: "Registration",
Rejoin: "Rejoin",
Uplink_Data: "Uplink_Data",
};
var WirelessGatewayEvent = {
CUPS_Request: "CUPS_Request",
Certificate: "Certificate",
};
var WirelessGatewayType = {
LoRaWAN: "LoRaWAN",
};
var SummaryMetricConfigurationStatus = {
Disabled: "Disabled",
Enabled: "Enabled",
};
var MetricName = {
AwsAccountActiveDeviceCount: "AwsAccountActiveDeviceCount",
AwsAccountActiveGatewayCount: "AwsAccountActiveGatewayCount",
AwsAccountDeviceCount: "AwsAccountDeviceCount",
AwsAccountDownlinkCount: "AwsAccountDownlinkCount",
AwsAccountGatewayCount: "AwsAccountGatewayCount",
AwsAccountJoinAcceptCount: "AwsAccountJoinAcceptCount",
AwsAccountJoinRequestCount: "AwsAccountJoinRequestCount",
AwsAccountRoamingDownlinkCount: "AwsAccountRoamingDownlinkCount",
AwsAccountRoamingUplinkCount: "AwsAccountRoamingUplinkCount",
AwsAccountUplinkCount: "AwsAccountUplinkCount",
AwsAccountUplinkLostCount: "AwsAccountUplinkLostCount",
AwsAccountUplinkLostRate: "AwsAccountUplinkLostRate",
DeviceDownlinkCount: "DeviceDownlinkCount",
DeviceJoinAcceptCount: "DeviceJoinAcceptCount",
DeviceJoinRequestCount: "DeviceJoinRequestCount",
DeviceRSSI: "DeviceRSSI",
DeviceRoamingDownlinkCount: "DeviceRoamingDownlinkCount",
DeviceRoamingRSSI: "DeviceRoamingRSSI",
DeviceRoamingSNR: "DeviceRoamingSNR",
DeviceRoamingUplinkCount: "DeviceRoamingUplinkCount",
DeviceSNR: "DeviceSNR",
DeviceUplinkCount: "DeviceUplinkCount",
DeviceUplinkLostCount: "DeviceUplinkLostCount",
DeviceUplinkLostRate: "DeviceUplinkLostRate",
GatewayDownTime: "GatewayDownTime",
GatewayDownlinkCount: "GatewayDownlinkCount",
GatewayJoinAcceptCount: "GatewayJoinAcceptCount",
GatewayJoinRequestCount: "GatewayJoinRequestCount",
GatewayRSSI: "GatewayRSSI",
GatewaySNR: "GatewaySNR",
GatewayUpTime: "GatewayUpTime",
GatewayUplinkCount: "GatewayUplinkCount",
};
var MetricQueryStatus = {
Failed: "Failed",
Succeeded: "Succeeded",
};
var PositionResourceType = {
WirelessDevice: "WirelessDevice",
WirelessGateway: "WirelessGateway",
};
var PositionSolverProvider = {
SEMTECH: "Semtech",
};
var PositionSolverType = {
GNSS: "GNSS",
};
var PositionConfigurationFec = {
NONE: "NONE",
ROSE: "ROSE",
};
var PositionConfigurationStatus = {
Disabled: "Disabled",
Enabled: "Enabled",
};
var WirelessGatewayServiceType = {
CUPS: "CUPS",
LNS: "LNS",
};
var WirelessDeviceIdType = {
DevEui: "DevEui",
SidewalkManufacturingSn: "SidewalkManufacturingSn",
ThingName: "ThingName",
WirelessDeviceId: "WirelessDeviceId",
};
var WirelessDeviceSidewalkStatus = {
ACTIVATED: "ACTIVATED",
PROVISIONED: "PROVISIONED",
REGISTERED: "REGISTERED",
UNKNOWN: "UNKNOWN",
};
var ImportTaskStatus = {
COMPLETE: "COMPLETE",
DELETING: "DELETING",
FAILED: "FAILED",
INITIALIZED: "INITIALIZED",
INITIALIZING: "INITIALIZING",
PENDING: "PENDING",
};
var WirelessGatewayIdType = {
GatewayEui: "GatewayEui",
ThingName: "ThingName",
WirelessGatewayId: "WirelessGatewayId",
};
var OnboardStatus = {
FAILED: "FAILED",
INITIALIZED: "INITIALIZED",
ONBOARDED: "ONBOARDED",
PENDING: "PENDING",
};
var SidewalkAccountInfoFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.AppServerPrivateKey && {
AppServerPrivateKey: import_smithy_client.SENSITIVE_STRING,
}),
}),
"SidewalkAccountInfoFilterSensitiveLog"
);
var AssociateAwsAccountWithPartnerAccountRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Sidewalk && { Sidewalk: SidewalkAccountInfoFilterSensitiveLog(obj.Sidewalk) }),
}),
"AssociateAwsAccountWithPartnerAccountRequestFilterSensitiveLog"
);
var AssociateAwsAccountWithPartnerAccountResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Sidewalk && { Sidewalk: SidewalkAccountInfoFilterSensitiveLog(obj.Sidewalk) }),
}),
"AssociateAwsAccountWithPartnerAccountResponseFilterSensitiveLog"
);
var SidewalkGetDeviceProfileFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.ApplicationServerPublicKey && {
ApplicationServerPublicKey: import_smithy_client.SENSITIVE_STRING,
}),
}),
"SidewalkGetDeviceProfileFilterSensitiveLog"
);
var GetDeviceProfileResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Sidewalk && { Sidewalk: SidewalkGetDeviceProfileFilterSensitiveLog(obj.Sidewalk) }),
}),
"GetDeviceProfileResponseFilterSensitiveLog"
);
var SidewalkAccountInfoWithFingerprintFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Fingerprint && { Fingerprint: import_smithy_client.SENSITIVE_STRING }),
}),
"SidewalkAccountInfoWithFingerprintFilterSensitiveLog"
);
var GetPartnerAccountResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Sidewalk && {
Sidewalk: SidewalkAccountInfoWithFingerprintFilterSensitiveLog(obj.Sidewalk),
}),
}),
"GetPartnerAccountResponseFilterSensitiveLog"
);
var ListPartnerAccountsResponseFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Sidewalk && {
Sidewalk: obj.Sidewalk.map((item) => SidewalkAccountInfoWithFingerprintFilterSensitiveLog(item)),
}),
}),
"ListPartnerAccountsResponseFilterSensitiveLog"
);
var import_core2 = require_dist_cjs37();
var import_uuid = require_dist();
var WirelessGatewayTaskDefinitionType = {
UPDATE: "UPDATE",
};
var MessageType = {
CUSTOM_COMMAND_ID_GET: "CUSTOM_COMMAND_ID_GET",
CUSTOM_COMMAND_ID_NOTIFY: "CUSTOM_COMMAND_ID_NOTIFY",
CUSTOM_COMMAND_ID_RESP: "CUSTOM_COMMAND_ID_RESP",
CUSTOM_COMMAND_ID_SET: "CUSTOM_COMMAND_ID_SET",
};
var _TooManyTagsException = class _TooManyTagsException2 extends IoTWirelessServiceException {
constructor(opts) {
super({
name: "TooManyTagsException",
$fault: "client",
...opts,
});
this.name = "TooManyTagsException";
this.$fault = "client";
Object.setPrototypeOf(this, _TooManyTagsException2.prototype);
this.Message = opts.Message;
this.ResourceName = opts.ResourceName;
}
};
__name(_TooManyTagsException, "TooManyTagsException");
var TooManyTagsException = _TooManyTagsException;
var SidewalkUpdateAccountFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.AppServerPrivateKey && {
AppServerPrivateKey: import_smithy_client.SENSITIVE_STRING,
}),
}),
"SidewalkUpdateAccountFilterSensitiveLog"
);
var UpdatePartnerAccountRequestFilterSensitiveLog = /* @__PURE__ */ __name(
(obj) => ({
...obj,
...(obj.Sidewalk && { Sidewalk: SidewalkUpdateAccountFilterSensitiveLog(obj.Sidewalk) }),
}),
"UpdatePartnerAccountRequestFilterSensitiveLog"
);
var se_AssociateAwsAccountWithPartnerAccountCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/partner-accounts");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Sidewalk: (_) => (0, import_smithy_client._json)(_),
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_AssociateAwsAccountWithPartnerAccountCommand");
var se_AssociateMulticastGroupWithFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/fuota-tasks/{Id}/multicast-group");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
MulticastGroupId: [],
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_AssociateMulticastGroupWithFuotaTaskCommand");
var se_AssociateWirelessDeviceWithFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/fuota-tasks/{Id}/wireless-device");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
WirelessDeviceId: [],
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_AssociateWirelessDeviceWithFuotaTaskCommand");
var se_AssociateWirelessDeviceWithMulticastGroupCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/multicast-groups/{Id}/wireless-device");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
WirelessDeviceId: [],
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_AssociateWirelessDeviceWithMulticastGroupCommand");
var se_AssociateWirelessDeviceWithThingCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-devices/{Id}/thing");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ThingArn: [],
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_AssociateWirelessDeviceWithThingCommand");
var se_AssociateWirelessGatewayWithCertificateCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-gateways/{Id}/certificate");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
IotCertificateId: [],
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_AssociateWirelessGatewayWithCertificateCommand");
var se_AssociateWirelessGatewayWithThingCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-gateways/{Id}/thing");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ThingArn: [],
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_AssociateWirelessGatewayWithThingCommand");
var se_CancelMulticastGroupSessionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/multicast-groups/{Id}/session");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_CancelMulticastGroupSessionCommand");
var se_CreateDestinationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/destinations");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Description: [],
Expression: [],
ExpressionType: [],
Name: [],
RoleArn: [],
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateDestinationCommand");
var se_CreateDeviceProfileCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/device-profiles");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
Sidewalk: (_) => (0, import_smithy_client._json)(_),
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateDeviceProfileCommand");
var se_CreateFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/fuota-tasks");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Description: [],
FirmwareUpdateImage: [],
FirmwareUpdateRole: [],
FragmentIntervalMS: [],
FragmentSizeBytes: [],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
RedundancyPercent: [],
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateFuotaTaskCommand");
var se_CreateMulticastGroupCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/multicast-groups");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Description: [],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateMulticastGroupCommand");
var se_CreateNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/network-analyzer-configurations");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Description: [],
MulticastGroups: (_) => (0, import_smithy_client._json)(_),
Name: [],
Tags: (_) => (0, import_smithy_client._json)(_),
TraceContent: (_) => (0, import_smithy_client._json)(_),
WirelessDevices: (_) => (0, import_smithy_client._json)(_),
WirelessGateways: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateNetworkAnalyzerConfigurationCommand");
var se_CreateServiceProfileCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/service-profiles");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateServiceProfileCommand");
var se_CreateWirelessDeviceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-devices");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Description: [],
DestinationName: [],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
Positioning: [],
Sidewalk: (_) => (0, import_smithy_client._json)(_),
Tags: (_) => (0, import_smithy_client._json)(_),
Type: [],
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateWirelessDeviceCommand");
var se_CreateWirelessGatewayCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-gateways");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Description: [],
LoRaWAN: (_) => se_LoRaWANGateway(_, context),
Name: [],
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateWirelessGatewayCommand");
var se_CreateWirelessGatewayTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-gateways/{Id}/tasks");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
WirelessGatewayTaskDefinitionId: [],
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateWirelessGatewayTaskCommand");
var se_CreateWirelessGatewayTaskDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-gateway-task-definitions");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
AutoCreateTasks: [],
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
Name: [],
Tags: (_) => (0, import_smithy_client._json)(_),
Update: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_CreateWirelessGatewayTaskDefinitionCommand");
var se_DeleteDestinationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/destinations/{Name}");
b.p("Name", () => input.Name, "{Name}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteDestinationCommand");
var se_DeleteDeviceProfileCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/device-profiles/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteDeviceProfileCommand");
var se_DeleteFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/fuota-tasks/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteFuotaTaskCommand");
var se_DeleteMulticastGroupCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/multicast-groups/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteMulticastGroupCommand");
var se_DeleteNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/network-analyzer-configurations/{ConfigurationName}");
b.p("ConfigurationName", () => input.ConfigurationName, "{ConfigurationName}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteNetworkAnalyzerConfigurationCommand");
var se_DeleteQueuedMessagesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{Id}/data");
b.p("Id", () => input.Id, "{Id}", false);
const query = (0, import_smithy_client.map)({
[_mI]: [, (0, import_smithy_client.expectNonNull)(input[_MI], `MessageId`)],
[_WDT]: [, input[_WDT]],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
}, "se_DeleteQueuedMessagesCommand");
var se_DeleteServiceProfileCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/service-profiles/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteServiceProfileCommand");
var se_DeleteWirelessDeviceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteWirelessDeviceCommand");
var se_DeleteWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless_device_import_task/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteWirelessDeviceImportTaskCommand");
var se_DeleteWirelessGatewayCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteWirelessGatewayCommand");
var se_DeleteWirelessGatewayTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Id}/tasks");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteWirelessGatewayTaskCommand");
var se_DeleteWirelessGatewayTaskDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateway-task-definitions/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DeleteWirelessGatewayTaskDefinitionCommand");
var se_DeregisterWirelessDeviceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{Identifier}/deregister");
b.p("Identifier", () => input.Identifier, "{Identifier}", false);
const query = (0, import_smithy_client.map)({
[_WDT]: [, input[_WDT]],
});
let body;
b.m("PATCH").h(headers).q(query).b(body);
return b.build();
}, "se_DeregisterWirelessDeviceCommand");
var se_DisassociateAwsAccountFromPartnerAccountCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/partner-accounts/{PartnerAccountId}");
b.p("PartnerAccountId", () => input.PartnerAccountId, "{PartnerAccountId}", false);
const query = (0, import_smithy_client.map)({
[_pT]: [, (0, import_smithy_client.expectNonNull)(input[_PT], `PartnerType`)],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
}, "se_DisassociateAwsAccountFromPartnerAccountCommand");
var se_DisassociateMulticastGroupFromFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/fuota-tasks/{Id}/multicast-groups/{MulticastGroupId}");
b.p("Id", () => input.Id, "{Id}", false);
b.p("MulticastGroupId", () => input.MulticastGroupId, "{MulticastGroupId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DisassociateMulticastGroupFromFuotaTaskCommand");
var se_DisassociateWirelessDeviceFromFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/fuota-tasks/{Id}/wireless-devices/{WirelessDeviceId}");
b.p("Id", () => input.Id, "{Id}", false);
b.p("WirelessDeviceId", () => input.WirelessDeviceId, "{WirelessDeviceId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DisassociateWirelessDeviceFromFuotaTaskCommand");
var se_DisassociateWirelessDeviceFromMulticastGroupCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/multicast-groups/{Id}/wireless-devices/{WirelessDeviceId}");
b.p("Id", () => input.Id, "{Id}", false);
b.p("WirelessDeviceId", () => input.WirelessDeviceId, "{WirelessDeviceId}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DisassociateWirelessDeviceFromMulticastGroupCommand");
var se_DisassociateWirelessDeviceFromThingCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{Id}/thing");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DisassociateWirelessDeviceFromThingCommand");
var se_DisassociateWirelessGatewayFromCertificateCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Id}/certificate");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DisassociateWirelessGatewayFromCertificateCommand");
var se_DisassociateWirelessGatewayFromThingCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Id}/thing");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_DisassociateWirelessGatewayFromThingCommand");
var se_GetDestinationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/destinations/{Name}");
b.p("Name", () => input.Name, "{Name}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetDestinationCommand");
var se_GetDeviceProfileCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/device-profiles/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetDeviceProfileCommand");
var se_GetEventConfigurationByResourceTypesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/event-configurations-resource-types");
let body;
body = "";
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetEventConfigurationByResourceTypesCommand");
var se_GetFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/fuota-tasks/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetFuotaTaskCommand");
var se_GetLogLevelsByResourceTypesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/log-levels");
let body;
body = "";
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetLogLevelsByResourceTypesCommand");
var se_GetMetricConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/metric-configuration");
let body;
body = "";
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetMetricConfigurationCommand");
var se_GetMetricsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/metrics");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
SummaryMetricQueries: (_) => se_SummaryMetricQueries(_, context),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_GetMetricsCommand");
var se_GetMulticastGroupCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/multicast-groups/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetMulticastGroupCommand");
var se_GetMulticastGroupSessionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/multicast-groups/{Id}/session");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetMulticastGroupSessionCommand");
var se_GetNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/network-analyzer-configurations/{ConfigurationName}");
b.p("ConfigurationName", () => input.ConfigurationName, "{ConfigurationName}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetNetworkAnalyzerConfigurationCommand");
var se_GetPartnerAccountCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/partner-accounts/{PartnerAccountId}");
b.p("PartnerAccountId", () => input.PartnerAccountId, "{PartnerAccountId}", false);
const query = (0, import_smithy_client.map)({
[_pT]: [, (0, import_smithy_client.expectNonNull)(input[_PT], `PartnerType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetPartnerAccountCommand");
var se_GetPositionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/positions/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetPositionCommand");
var se_GetPositionConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/position-configurations/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetPositionConfigurationCommand");
var se_GetPositionEstimateCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/position-estimate");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
CellTowers: (_) => se_CellTowers(_, context),
Gnss: (_) => se_Gnss(_, context),
Ip: (_) => (0, import_smithy_client._json)(_),
Timestamp: (_) => _.getTime() / 1e3,
WiFiAccessPoints: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_GetPositionEstimateCommand");
var se_GetResourceEventConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/event-configurations/{Identifier}");
b.p("Identifier", () => input.Identifier, "{Identifier}", false);
const query = (0, import_smithy_client.map)({
[_iT]: [, (0, import_smithy_client.expectNonNull)(input[_IT], `IdentifierType`)],
[_pT]: [, input[_PT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetResourceEventConfigurationCommand");
var se_GetResourceLogLevelCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/log-levels/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetResourceLogLevelCommand");
var se_GetResourcePositionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/resource-positions/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetResourcePositionCommand");
var se_GetServiceEndpointCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/service-endpoint");
const query = (0, import_smithy_client.map)({
[_sT]: [, input[_ST]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetServiceEndpointCommand");
var se_GetServiceProfileCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/service-profiles/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetServiceProfileCommand");
var se_GetWirelessDeviceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{Identifier}");
b.p("Identifier", () => input.Identifier, "{Identifier}", false);
const query = (0, import_smithy_client.map)({
[_iT]: [, (0, import_smithy_client.expectNonNull)(input[_IT], `IdentifierType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetWirelessDeviceCommand");
var se_GetWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless_device_import_task/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetWirelessDeviceImportTaskCommand");
var se_GetWirelessDeviceStatisticsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{WirelessDeviceId}/statistics");
b.p("WirelessDeviceId", () => input.WirelessDeviceId, "{WirelessDeviceId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetWirelessDeviceStatisticsCommand");
var se_GetWirelessGatewayCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Identifier}");
b.p("Identifier", () => input.Identifier, "{Identifier}", false);
const query = (0, import_smithy_client.map)({
[_iT]: [, (0, import_smithy_client.expectNonNull)(input[_IT], `IdentifierType`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_GetWirelessGatewayCommand");
var se_GetWirelessGatewayCertificateCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Id}/certificate");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetWirelessGatewayCertificateCommand");
var se_GetWirelessGatewayFirmwareInformationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Id}/firmware-information");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetWirelessGatewayFirmwareInformationCommand");
var se_GetWirelessGatewayStatisticsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{WirelessGatewayId}/statistics");
b.p("WirelessGatewayId", () => input.WirelessGatewayId, "{WirelessGatewayId}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetWirelessGatewayStatisticsCommand");
var se_GetWirelessGatewayTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways/{Id}/tasks");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetWirelessGatewayTaskCommand");
var se_GetWirelessGatewayTaskDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateway-task-definitions/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("GET").h(headers).b(body);
return b.build();
}, "se_GetWirelessGatewayTaskDefinitionCommand");
var se_ListDestinationsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/destinations");
const query = (0, import_smithy_client.map)({
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListDestinationsCommand");
var se_ListDeviceProfilesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/device-profiles");
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_dPT]: [, input[_DPT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListDeviceProfilesCommand");
var se_ListDevicesForWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless_device_import_task");
const query = (0, import_smithy_client.map)({
[_i]: [, (0, import_smithy_client.expectNonNull)(input[_I], `Id`)],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
[_s]: [, input[_S]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListDevicesForWirelessDeviceImportTaskCommand");
var se_ListEventConfigurationsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/event-configurations");
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListEventConfigurationsCommand");
var se_ListFuotaTasksCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/fuota-tasks");
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListFuotaTasksCommand");
var se_ListMulticastGroupsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/multicast-groups");
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListMulticastGroupsCommand");
var se_ListMulticastGroupsByFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/fuota-tasks/{Id}/multicast-groups");
b.p("Id", () => input.Id, "{Id}", false);
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListMulticastGroupsByFuotaTaskCommand");
var se_ListNetworkAnalyzerConfigurationsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/network-analyzer-configurations");
const query = (0, import_smithy_client.map)({
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListNetworkAnalyzerConfigurationsCommand");
var se_ListPartnerAccountsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/partner-accounts");
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListPartnerAccountsCommand");
var se_ListPositionConfigurationsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/position-configurations");
const query = (0, import_smithy_client.map)({
[_rT]: [, input[_RT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListPositionConfigurationsCommand");
var se_ListQueuedMessagesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{Id}/data");
b.p("Id", () => input.Id, "{Id}", false);
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_WDT]: [, input[_WDT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListQueuedMessagesCommand");
var se_ListServiceProfilesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/service-profiles");
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListServiceProfilesCommand");
var se_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/tags");
const query = (0, import_smithy_client.map)({
[_rA]: [, (0, import_smithy_client.expectNonNull)(input[_RA], `ResourceArn`)],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListTagsForResourceCommand");
var se_ListWirelessDeviceImportTasksCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless_device_import_tasks");
const query = (0, import_smithy_client.map)({
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListWirelessDeviceImportTasksCommand");
var se_ListWirelessDevicesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices");
const query = (0, import_smithy_client.map)({
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
[_dN]: [, input[_DN]],
[_dPI]: [, input[_DPI]],
[_sPI]: [, input[_SPI]],
[_wDT]: [, input[_WDT]],
[_fTI]: [, input[_FTI]],
[_mGI]: [, input[_MGI]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListWirelessDevicesCommand");
var se_ListWirelessGatewaysCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateways");
const query = (0, import_smithy_client.map)({
[_nT]: [, input[_NT]],
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListWirelessGatewaysCommand");
var se_ListWirelessGatewayTaskDefinitionsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-gateway-task-definitions");
const query = (0, import_smithy_client.map)({
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
[_nT]: [, input[_NT]],
[_tDT]: [, input[_TDT]],
});
let body;
b.m("GET").h(headers).q(query).b(body);
return b.build();
}, "se_ListWirelessGatewayTaskDefinitionsCommand");
var se_PutPositionConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/position-configurations/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Destination: [],
Solvers: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PUT").h(headers).q(query).b(body);
return b.build();
}, "se_PutPositionConfigurationCommand");
var se_PutResourceLogLevelCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/log-levels/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
LogLevel: [],
})
);
b.m("PUT").h(headers).q(query).b(body);
return b.build();
}, "se_PutResourceLogLevelCommand");
var se_ResetAllResourceLogLevelsCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/log-levels");
let body;
body = "";
b.m("DELETE").h(headers).b(body);
return b.build();
}, "se_ResetAllResourceLogLevelsCommand");
var se_ResetResourceLogLevelCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/log-levels/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
}, "se_ResetResourceLogLevelCommand");
var se_SendDataToMulticastGroupCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/multicast-groups/{Id}/data");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
PayloadData: [],
WirelessMetadata: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_SendDataToMulticastGroupCommand");
var se_SendDataToWirelessDeviceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-devices/{Id}/data");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
PayloadData: [],
TransmitMode: [],
WirelessMetadata: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_SendDataToWirelessDeviceCommand");
var se_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand = /* @__PURE__ */ __name(
async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/multicast-groups/{Id}/bulk");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
QueryString: [],
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
},
"se_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand"
);
var se_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand = /* @__PURE__ */ __name(
async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/multicast-groups/{Id}/bulk");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
QueryString: [],
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
},
"se_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand"
);
var se_StartFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/fuota-tasks/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
LoRaWAN: (_) => se_LoRaWANStartFuotaTask(_, context),
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_StartFuotaTaskCommand");
var se_StartMulticastGroupSessionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/multicast-groups/{Id}/session");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
LoRaWAN: (_) => se_LoRaWANMulticastSession(_, context),
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_StartMulticastGroupSessionCommand");
var se_StartSingleWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless_single_device_import_task");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
DestinationName: [],
DeviceName: [],
Sidewalk: (_) => (0, import_smithy_client._json)(_),
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_StartSingleWirelessDeviceImportTaskCommand");
var se_StartWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless_device_import_task");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ClientRequestToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
DestinationName: [],
Sidewalk: (_) => (0, import_smithy_client._json)(_),
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_StartWirelessDeviceImportTaskCommand");
var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/tags");
const query = (0, import_smithy_client.map)({
[_rA]: [, (0, import_smithy_client.expectNonNull)(input[_RA], `ResourceArn`)],
});
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Tags: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).q(query).b(body);
return b.build();
}, "se_TagResourceCommand");
var se_TestWirelessDeviceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/wireless-devices/{Id}/test");
b.p("Id", () => input.Id, "{Id}", false);
let body;
b.m("POST").h(headers).b(body);
return b.build();
}, "se_TestWirelessDeviceCommand");
var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {};
b.bp("/tags");
const query = (0, import_smithy_client.map)({
[_rA]: [, (0, import_smithy_client.expectNonNull)(input[_RA], `ResourceArn`)],
[_tK]: [
(0, import_smithy_client.expectNonNull)(input.TagKeys, `TagKeys`) != null,
() => (input[_TK] || []).map((_entry) => _entry),
],
});
let body;
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
}, "se_UntagResourceCommand");
var se_UpdateDestinationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/destinations/{Name}");
b.p("Name", () => input.Name, "{Name}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Description: [],
Expression: [],
ExpressionType: [],
RoleArn: [],
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateDestinationCommand");
var se_UpdateEventConfigurationByResourceTypesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/event-configurations-resource-types");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ConnectionStatus: (_) => (0, import_smithy_client._json)(_),
DeviceRegistrationState: (_) => (0, import_smithy_client._json)(_),
Join: (_) => (0, import_smithy_client._json)(_),
MessageDeliveryStatus: (_) => (0, import_smithy_client._json)(_),
Proximity: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateEventConfigurationByResourceTypesCommand");
var se_UpdateFuotaTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/fuota-tasks/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Description: [],
FirmwareUpdateImage: [],
FirmwareUpdateRole: [],
FragmentIntervalMS: [],
FragmentSizeBytes: [],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
RedundancyPercent: [],
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateFuotaTaskCommand");
var se_UpdateLogLevelsByResourceTypesCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/log-levels");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
DefaultLogLevel: [],
WirelessDeviceLogOptions: (_) => (0, import_smithy_client._json)(_),
WirelessGatewayLogOptions: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("POST").h(headers).b(body);
return b.build();
}, "se_UpdateLogLevelsByResourceTypesCommand");
var se_UpdateMetricConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/metric-configuration");
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
SummaryMetric: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PUT").h(headers).b(body);
return b.build();
}, "se_UpdateMetricConfigurationCommand");
var se_UpdateMulticastGroupCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/multicast-groups/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Description: [],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateMulticastGroupCommand");
var se_UpdateNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/network-analyzer-configurations/{ConfigurationName}");
b.p("ConfigurationName", () => input.ConfigurationName, "{ConfigurationName}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Description: [],
MulticastGroupsToAdd: (_) => (0, import_smithy_client._json)(_),
MulticastGroupsToRemove: (_) => (0, import_smithy_client._json)(_),
TraceContent: (_) => (0, import_smithy_client._json)(_),
WirelessDevicesToAdd: (_) => (0, import_smithy_client._json)(_),
WirelessDevicesToRemove: (_) => (0, import_smithy_client._json)(_),
WirelessGatewaysToAdd: (_) => (0, import_smithy_client._json)(_),
WirelessGatewaysToRemove: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateNetworkAnalyzerConfigurationCommand");
var se_UpdatePartnerAccountCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/partner-accounts/{PartnerAccountId}");
b.p("PartnerAccountId", () => input.PartnerAccountId, "{PartnerAccountId}", false);
const query = (0, import_smithy_client.map)({
[_pT]: [, (0, import_smithy_client.expectNonNull)(input[_PT], `PartnerType`)],
});
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Sidewalk: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PATCH").h(headers).q(query).b(body);
return b.build();
}, "se_UpdatePartnerAccountCommand");
var se_UpdatePositionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/positions/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Position: (_) => se_PositionCoordinate(_, context),
})
);
b.m("PATCH").h(headers).q(query).b(body);
return b.build();
}, "se_UpdatePositionCommand");
var se_UpdateResourceEventConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/event-configurations/{Identifier}");
b.p("Identifier", () => input.Identifier, "{Identifier}", false);
const query = (0, import_smithy_client.map)({
[_iT]: [, (0, import_smithy_client.expectNonNull)(input[_IT], `IdentifierType`)],
[_pT]: [, input[_PT]],
});
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
ConnectionStatus: (_) => (0, import_smithy_client._json)(_),
DeviceRegistrationState: (_) => (0, import_smithy_client._json)(_),
Join: (_) => (0, import_smithy_client._json)(_),
MessageDeliveryStatus: (_) => (0, import_smithy_client._json)(_),
Proximity: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PATCH").h(headers).q(query).b(body);
return b.build();
}, "se_UpdateResourceEventConfigurationCommand");
var se_UpdateResourcePositionCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/octet-stream",
};
b.bp("/resource-positions/{ResourceIdentifier}");
b.p("ResourceIdentifier", () => input.ResourceIdentifier, "{ResourceIdentifier}", false);
const query = (0, import_smithy_client.map)({
[_rT]: [, (0, import_smithy_client.expectNonNull)(input[_RT], `ResourceType`)],
});
let body;
if (input.GeoJsonPayload !== void 0) {
body = input.GeoJsonPayload;
}
b.m("PATCH").h(headers).q(query).b(body);
return b.build();
}, "se_UpdateResourcePositionCommand");
var se_UpdateWirelessDeviceCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-devices/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Description: [],
DestinationName: [],
LoRaWAN: (_) => (0, import_smithy_client._json)(_),
Name: [],
Positioning: [],
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateWirelessDeviceCommand");
var se_UpdateWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless_device_import_task/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Sidewalk: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateWirelessDeviceImportTaskCommand");
var se_UpdateWirelessGatewayCommand = /* @__PURE__ */ __name(async (input, context) => {
const b = (0, import_core.requestBuilder)(input, context);
const headers = {
"content-type": "application/json",
};
b.bp("/wireless-gateways/{Id}");
b.p("Id", () => input.Id, "{Id}", false);
let body;
body = JSON.stringify(
(0, import_smithy_client.take)(input, {
Description: [],
JoinEuiFilters: (_) => (0, import_smithy_client._json)(_),
MaxEirp: (_) => (0, import_smithy_client.serializeFloat)(_),
Name: [],
NetIdFilters: (_) => (0, import_smithy_client._json)(_),
})
);
b.m("PATCH").h(headers).b(body);
return b.build();
}, "se_UpdateWirelessGatewayCommand");
var de_AssociateAwsAccountWithPartnerAccountCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Sidewalk: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_AssociateAwsAccountWithPartnerAccountCommand");
var de_AssociateMulticastGroupWithFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_AssociateMulticastGroupWithFuotaTaskCommand");
var de_AssociateWirelessDeviceWithFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_AssociateWirelessDeviceWithFuotaTaskCommand");
var de_AssociateWirelessDeviceWithMulticastGroupCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_AssociateWirelessDeviceWithMulticastGroupCommand");
var de_AssociateWirelessDeviceWithThingCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_AssociateWirelessDeviceWithThingCommand");
var de_AssociateWirelessGatewayWithCertificateCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
IotCertificateId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_AssociateWirelessGatewayWithCertificateCommand");
var de_AssociateWirelessGatewayWithThingCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_AssociateWirelessGatewayWithThingCommand");
var de_CancelMulticastGroupSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_CancelMulticastGroupSessionCommand");
var de_CreateDestinationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Name: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateDestinationCommand");
var de_CreateDeviceProfileCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateDeviceProfileCommand");
var de_CreateFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateFuotaTaskCommand");
var de_CreateMulticastGroupCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateMulticastGroupCommand");
var de_CreateNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Name: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateNetworkAnalyzerConfigurationCommand");
var de_CreateServiceProfileCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateServiceProfileCommand");
var de_CreateWirelessDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateWirelessDeviceCommand");
var de_CreateWirelessGatewayCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateWirelessGatewayCommand");
var de_CreateWirelessGatewayTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Status: import_smithy_client.expectString,
WirelessGatewayTaskDefinitionId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateWirelessGatewayTaskCommand");
var de_CreateWirelessGatewayTaskDefinitionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_CreateWirelessGatewayTaskDefinitionCommand");
var de_DeleteDestinationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteDestinationCommand");
var de_DeleteDeviceProfileCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteDeviceProfileCommand");
var de_DeleteFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteFuotaTaskCommand");
var de_DeleteMulticastGroupCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteMulticastGroupCommand");
var de_DeleteNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteNetworkAnalyzerConfigurationCommand");
var de_DeleteQueuedMessagesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteQueuedMessagesCommand");
var de_DeleteServiceProfileCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteServiceProfileCommand");
var de_DeleteWirelessDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteWirelessDeviceCommand");
var de_DeleteWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteWirelessDeviceImportTaskCommand");
var de_DeleteWirelessGatewayCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteWirelessGatewayCommand");
var de_DeleteWirelessGatewayTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteWirelessGatewayTaskCommand");
var de_DeleteWirelessGatewayTaskDefinitionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeleteWirelessGatewayTaskDefinitionCommand");
var de_DeregisterWirelessDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DeregisterWirelessDeviceCommand");
var de_DisassociateAwsAccountFromPartnerAccountCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisassociateAwsAccountFromPartnerAccountCommand");
var de_DisassociateMulticastGroupFromFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisassociateMulticastGroupFromFuotaTaskCommand");
var de_DisassociateWirelessDeviceFromFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisassociateWirelessDeviceFromFuotaTaskCommand");
var de_DisassociateWirelessDeviceFromMulticastGroupCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisassociateWirelessDeviceFromMulticastGroupCommand");
var de_DisassociateWirelessDeviceFromThingCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisassociateWirelessDeviceFromThingCommand");
var de_DisassociateWirelessGatewayFromCertificateCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisassociateWirelessGatewayFromCertificateCommand");
var de_DisassociateWirelessGatewayFromThingCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_DisassociateWirelessGatewayFromThingCommand");
var de_GetDestinationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Description: import_smithy_client.expectString,
Expression: import_smithy_client.expectString,
ExpressionType: import_smithy_client.expectString,
Name: import_smithy_client.expectString,
RoleArn: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetDestinationCommand");
var de_GetDeviceProfileCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
LoRaWAN: import_smithy_client._json,
Name: import_smithy_client.expectString,
Sidewalk: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetDeviceProfileCommand");
var de_GetEventConfigurationByResourceTypesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
ConnectionStatus: import_smithy_client._json,
DeviceRegistrationState: import_smithy_client._json,
Join: import_smithy_client._json,
MessageDeliveryStatus: import_smithy_client._json,
Proximity: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetEventConfigurationByResourceTypesCommand");
var de_GetFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
CreatedAt: (_) =>
(0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))
),
Description: import_smithy_client.expectString,
FirmwareUpdateImage: import_smithy_client.expectString,
FirmwareUpdateRole: import_smithy_client.expectString,
FragmentIntervalMS: import_smithy_client.expectInt32,
FragmentSizeBytes: import_smithy_client.expectInt32,
Id: import_smithy_client.expectString,
LoRaWAN: (_) => de_LoRaWANFuotaTaskGetInfo(_, context),
Name: import_smithy_client.expectString,
RedundancyPercent: import_smithy_client.expectInt32,
Status: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetFuotaTaskCommand");
var de_GetLogLevelsByResourceTypesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
DefaultLogLevel: import_smithy_client.expectString,
WirelessDeviceLogOptions: import_smithy_client._json,
WirelessGatewayLogOptions: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetLogLevelsByResourceTypesCommand");
var de_GetMetricConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
SummaryMetric: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetMetricConfigurationCommand");
var de_GetMetricsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
SummaryMetricQueryResults: (_) => de_SummaryMetricQueryResults(_, context),
});
Object.assign(contents, doc);
return contents;
}, "de_GetMetricsCommand");
var de_GetMulticastGroupCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
CreatedAt: (_) =>
(0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))
),
Description: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
LoRaWAN: import_smithy_client._json,
Name: import_smithy_client.expectString,
Status: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetMulticastGroupCommand");
var de_GetMulticastGroupSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
LoRaWAN: (_) => de_LoRaWANMulticastSession(_, context),
});
Object.assign(contents, doc);
return contents;
}, "de_GetMulticastGroupSessionCommand");
var de_GetNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Description: import_smithy_client.expectString,
MulticastGroups: import_smithy_client._json,
Name: import_smithy_client.expectString,
TraceContent: import_smithy_client._json,
WirelessDevices: import_smithy_client._json,
WirelessGateways: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetNetworkAnalyzerConfigurationCommand");
var de_GetPartnerAccountCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
AccountLinked: import_smithy_client.expectBoolean,
Sidewalk: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetPartnerAccountCommand");
var de_GetPositionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Accuracy: (_) => de_Accuracy(_, context),
Position: (_) => de_PositionCoordinate(_, context),
SolverProvider: import_smithy_client.expectString,
SolverType: import_smithy_client.expectString,
SolverVersion: import_smithy_client.expectString,
Timestamp: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetPositionCommand");
var de_GetPositionConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Destination: import_smithy_client.expectString,
Solvers: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetPositionConfigurationCommand");
var de_GetPositionEstimateCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = await (0, import_smithy_client.collectBody)(output.body, context);
contents.GeoJsonPayload = data;
return contents;
}, "de_GetPositionEstimateCommand");
var de_GetResourceEventConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
ConnectionStatus: import_smithy_client._json,
DeviceRegistrationState: import_smithy_client._json,
Join: import_smithy_client._json,
MessageDeliveryStatus: import_smithy_client._json,
Proximity: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetResourceEventConfigurationCommand");
var de_GetResourceLogLevelCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
LogLevel: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetResourceLogLevelCommand");
var de_GetResourcePositionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = await (0, import_smithy_client.collectBody)(output.body, context);
contents.GeoJsonPayload = data;
return contents;
}, "de_GetResourcePositionCommand");
var de_GetServiceEndpointCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
ServerTrust: import_smithy_client.expectString,
ServiceEndpoint: import_smithy_client.expectString,
ServiceType: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetServiceEndpointCommand");
var de_GetServiceProfileCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
LoRaWAN: import_smithy_client._json,
Name: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetServiceProfileCommand");
var de_GetWirelessDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Description: import_smithy_client.expectString,
DestinationName: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
LoRaWAN: import_smithy_client._json,
Name: import_smithy_client.expectString,
Positioning: import_smithy_client.expectString,
Sidewalk: import_smithy_client._json,
ThingArn: import_smithy_client.expectString,
ThingName: import_smithy_client.expectString,
Type: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessDeviceCommand");
var de_GetWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
CreationTime: (_) =>
(0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
DestinationName: import_smithy_client.expectString,
FailedImportedDeviceCount: import_smithy_client.expectLong,
Id: import_smithy_client.expectString,
InitializedImportedDeviceCount: import_smithy_client.expectLong,
OnboardedImportedDeviceCount: import_smithy_client.expectLong,
PendingImportedDeviceCount: import_smithy_client.expectLong,
Sidewalk: import_smithy_client._json,
Status: import_smithy_client.expectString,
StatusReason: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessDeviceImportTaskCommand");
var de_GetWirelessDeviceStatisticsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
LastUplinkReceivedAt: import_smithy_client.expectString,
LoRaWAN: (_) => de_LoRaWANDeviceMetadata(_, context),
Sidewalk: import_smithy_client._json,
WirelessDeviceId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessDeviceStatisticsCommand");
var de_GetWirelessGatewayCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Description: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
LoRaWAN: (_) => de_LoRaWANGateway(_, context),
Name: import_smithy_client.expectString,
ThingArn: import_smithy_client.expectString,
ThingName: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessGatewayCommand");
var de_GetWirelessGatewayCertificateCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
IotCertificateId: import_smithy_client.expectString,
LoRaWANNetworkServerCertificateId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessGatewayCertificateCommand");
var de_GetWirelessGatewayFirmwareInformationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
LoRaWAN: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessGatewayFirmwareInformationCommand");
var de_GetWirelessGatewayStatisticsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
ConnectionStatus: import_smithy_client.expectString,
LastUplinkReceivedAt: import_smithy_client.expectString,
WirelessGatewayId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessGatewayStatisticsCommand");
var de_GetWirelessGatewayTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
LastUplinkReceivedAt: import_smithy_client.expectString,
Status: import_smithy_client.expectString,
TaskCreatedAt: import_smithy_client.expectString,
WirelessGatewayId: import_smithy_client.expectString,
WirelessGatewayTaskDefinitionId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessGatewayTaskCommand");
var de_GetWirelessGatewayTaskDefinitionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
AutoCreateTasks: import_smithy_client.expectBoolean,
Name: import_smithy_client.expectString,
Update: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_GetWirelessGatewayTaskDefinitionCommand");
var de_ListDestinationsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
DestinationList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListDestinationsCommand");
var de_ListDeviceProfilesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
DeviceProfileList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListDeviceProfilesCommand");
var de_ListDevicesForWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
DestinationName: import_smithy_client.expectString,
ImportedWirelessDeviceList: (_) => de_ImportedWirelessDeviceList(_, context),
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListDevicesForWirelessDeviceImportTaskCommand");
var de_ListEventConfigurationsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
EventConfigurationsList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListEventConfigurationsCommand");
var de_ListFuotaTasksCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
FuotaTaskList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListFuotaTasksCommand");
var de_ListMulticastGroupsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
MulticastGroupList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListMulticastGroupsCommand");
var de_ListMulticastGroupsByFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
MulticastGroupList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListMulticastGroupsByFuotaTaskCommand");
var de_ListNetworkAnalyzerConfigurationsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NetworkAnalyzerConfigurationList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListNetworkAnalyzerConfigurationsCommand");
var de_ListPartnerAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
Sidewalk: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_ListPartnerAccountsCommand");
var de_ListPositionConfigurationsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
PositionConfigurationList: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_ListPositionConfigurationsCommand");
var de_ListQueuedMessagesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
DownlinkQueueMessagesList: import_smithy_client._json,
NextToken: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_ListQueuedMessagesCommand");
var de_ListServiceProfilesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
ServiceProfileList: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_ListServiceProfilesCommand");
var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Tags: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_ListTagsForResourceCommand");
var de_ListWirelessDeviceImportTasksCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
WirelessDeviceImportTaskList: (_) => de_WirelessDeviceImportTaskList(_, context),
});
Object.assign(contents, doc);
return contents;
}, "de_ListWirelessDeviceImportTasksCommand");
var de_ListWirelessDevicesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
WirelessDeviceList: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_ListWirelessDevicesCommand");
var de_ListWirelessGatewaysCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
WirelessGatewayList: (_) => de_WirelessGatewayStatisticsList(_, context),
});
Object.assign(contents, doc);
return contents;
}, "de_ListWirelessGatewaysCommand");
var de_ListWirelessGatewayTaskDefinitionsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
NextToken: import_smithy_client.expectString,
TaskDefinitions: import_smithy_client._json,
});
Object.assign(contents, doc);
return contents;
}, "de_ListWirelessGatewayTaskDefinitionsCommand");
var de_PutPositionConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_PutPositionConfigurationCommand");
var de_PutResourceLogLevelCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_PutResourceLogLevelCommand");
var de_ResetAllResourceLogLevelsCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_ResetAllResourceLogLevelsCommand");
var de_ResetResourceLogLevelCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_ResetResourceLogLevelCommand");
var de_SendDataToMulticastGroupCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
MessageId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_SendDataToMulticastGroupCommand");
var de_SendDataToWirelessDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 202 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
MessageId: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_SendDataToWirelessDeviceCommand");
var de_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand = /* @__PURE__ */ __name(
async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
},
"de_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand"
);
var de_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand = /* @__PURE__ */ __name(
async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
},
"de_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand"
);
var de_StartFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_StartFuotaTaskCommand");
var de_StartMulticastGroupSessionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_StartMulticastGroupSessionCommand");
var de_StartSingleWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_StartSingleWirelessDeviceImportTaskCommand");
var de_StartWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 201 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Arn: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_StartWirelessDeviceImportTaskCommand");
var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_TagResourceCommand");
var de_TestWirelessDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
const data = (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)),
"body"
);
const doc = (0, import_smithy_client.take)(data, {
Result: import_smithy_client.expectString,
});
Object.assign(contents, doc);
return contents;
}, "de_TestWirelessDeviceCommand");
var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UntagResourceCommand");
var de_UpdateDestinationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateDestinationCommand");
var de_UpdateEventConfigurationByResourceTypesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateEventConfigurationByResourceTypesCommand");
var de_UpdateFuotaTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateFuotaTaskCommand");
var de_UpdateLogLevelsByResourceTypesCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateLogLevelsByResourceTypesCommand");
var de_UpdateMetricConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateMetricConfigurationCommand");
var de_UpdateMulticastGroupCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateMulticastGroupCommand");
var de_UpdateNetworkAnalyzerConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateNetworkAnalyzerConfigurationCommand");
var de_UpdatePartnerAccountCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdatePartnerAccountCommand");
var de_UpdatePositionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdatePositionCommand");
var de_UpdateResourceEventConfigurationCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateResourceEventConfigurationCommand");
var de_UpdateResourcePositionCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateResourcePositionCommand");
var de_UpdateWirelessDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateWirelessDeviceCommand");
var de_UpdateWirelessDeviceImportTaskCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateWirelessDeviceImportTaskCommand");
var de_UpdateWirelessGatewayCommand = /* @__PURE__ */ __name(async (output, context) => {
if (output.statusCode !== 204 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
const contents = (0, import_smithy_client.map)({
$metadata: deserializeMetadata(output),
});
await (0, import_smithy_client.collectBody)(output.body, context);
return contents;
}, "de_UpdateWirelessGatewayCommand");
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
const parsedOutput = {
...output,
body: await (0, import_core2.parseJsonErrorBody)(output.body, context),
};
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
switch (errorCode) {
case "AccessDeniedException":
case "com.amazonaws.iotwireless#AccessDeniedException":
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
case "ConflictException":
case "com.amazonaws.iotwireless#ConflictException":
throw await de_ConflictExceptionRes(parsedOutput, context);
case "InternalServerException":
case "com.amazonaws.iotwireless#InternalServerException":
throw await de_InternalServerExceptionRes(parsedOutput, context);
case "ResourceNotFoundException":
case "com.amazonaws.iotwireless#ResourceNotFoundException":
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
case "ThrottlingException":
case "com.amazonaws.iotwireless#ThrottlingException":
throw await de_ThrottlingExceptionRes(parsedOutput, context);
case "ValidationException":
case "com.amazonaws.iotwireless#ValidationException":
throw await de_ValidationExceptionRes(parsedOutput, context);
case "TooManyTagsException":
case "com.amazonaws.iotwireless#TooManyTagsException":
throw await de_TooManyTagsExceptionRes(parsedOutput, context);
default: {
const parsedBody = parsedOutput.body;
return throwDefaultError({
output,
parsedBody,
errorCode,
});
}
}
}, "de_CommandError");
var throwDefaultError = (0, import_smithy_client.withBaseException)(IoTWirelessServiceException);
var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
Message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new AccessDeniedException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_AccessDeniedExceptionRes");
var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
Message: import_smithy_client.expectString,
ResourceId: import_smithy_client.expectString,
ResourceType: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new ConflictException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ConflictExceptionRes");
var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
Message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new InternalServerException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_InternalServerExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
Message: import_smithy_client.expectString,
ResourceId: import_smithy_client.expectString,
ResourceType: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new ResourceNotFoundException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
Message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new ThrottlingException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ThrottlingExceptionRes");
var de_TooManyTagsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
Message: import_smithy_client.expectString,
ResourceName: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new TooManyTagsException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_TooManyTagsExceptionRes");
var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
const contents = (0, import_smithy_client.map)({});
const data = parsedOutput.body;
const doc = (0, import_smithy_client.take)(data, {
Message: import_smithy_client.expectString,
});
Object.assign(contents, doc);
const exception = new ValidationException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
}, "de_ValidationExceptionRes");
var se_AssistPosition = /* @__PURE__ */ __name((input, context) => {
return input
.filter((e) => e != null)
.map((entry) => {
return (0, import_smithy_client.serializeFloat)(entry);
});
}, "se_AssistPosition");
var se_CdmaList = /* @__PURE__ */ __name((input, context) => {
return input
.filter((e) => e != null)
.map((entry) => {
return se_CdmaObj(entry, context);
});
}, "se_CdmaList");
var se_CdmaObj = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
BaseLat: import_smithy_client.serializeFloat,
BaseLng: import_smithy_client.serializeFloat,
BaseStationId: [],
CdmaLocalId: import_smithy_client._json,
CdmaNmr: import_smithy_client._json,
NetworkId: [],
PilotPower: [],
RegistrationZone: [],
SystemId: [],
});
}, "se_CdmaObj");
var se_CellTowers = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
Cdma: (_) => se_CdmaList(_, context),
Gsm: import_smithy_client._json,
Lte: (_) => se_LteList(_, context),
Tdscdma: import_smithy_client._json,
Wcdma: import_smithy_client._json,
});
}, "se_CellTowers");
var se_Gnss = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
AssistAltitude: import_smithy_client.serializeFloat,
AssistPosition: (_) => se_AssistPosition(_, context),
CaptureTime: import_smithy_client.serializeFloat,
CaptureTimeAccuracy: import_smithy_client.serializeFloat,
Payload: [],
Use2DSolver: [],
});
}, "se_Gnss");
var se_LoRaWANGateway = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
Beaconing: import_smithy_client._json,
GatewayEui: [],
JoinEuiFilters: import_smithy_client._json,
MaxEirp: import_smithy_client.serializeFloat,
NetIdFilters: import_smithy_client._json,
RfRegion: [],
SubBands: import_smithy_client._json,
});
}, "se_LoRaWANGateway");
var se_LoRaWANMulticastSession = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
DlDr: [],
DlFreq: [],
PingSlotPeriod: [],
SessionStartTime: import_smithy_client.serializeDateTime,
SessionTimeout: [],
});
}, "se_LoRaWANMulticastSession");
var se_LoRaWANStartFuotaTask = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
StartTime: import_smithy_client.serializeDateTime,
});
}, "se_LoRaWANStartFuotaTask");
var se_LteList = /* @__PURE__ */ __name((input, context) => {
return input
.filter((e) => e != null)
.map((entry) => {
return se_LteObj(entry, context);
});
}, "se_LteList");
var se_LteNmrList = /* @__PURE__ */ __name((input, context) => {
return input
.filter((e) => e != null)
.map((entry) => {
return se_LteNmrObj(entry, context);
});
}, "se_LteNmrList");
var se_LteNmrObj = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
Earfcn: [],
EutranCid: [],
Pci: [],
Rsrp: [],
Rsrq: import_smithy_client.serializeFloat,
});
}, "se_LteNmrObj");
var se_LteObj = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
EutranCid: [],
LteLocalId: import_smithy_client._json,
LteNmr: (_) => se_LteNmrList(_, context),
LteTimingAdvance: [],
Mcc: [],
Mnc: [],
NrCapable: [],
Rsrp: [],
Rsrq: import_smithy_client.serializeFloat,
Tac: [],
});
}, "se_LteObj");
var se_PositionCoordinate = /* @__PURE__ */ __name((input, context) => {
return input
.filter((e) => e != null)
.map((entry) => {
return (0, import_smithy_client.serializeFloat)(entry);
});
}, "se_PositionCoordinate");
var se_SummaryMetricQueries = /* @__PURE__ */ __name((input, context) => {
return input
.filter((e) => e != null)
.map((entry) => {
return se_SummaryMetricQuery(entry, context);
});
}, "se_SummaryMetricQueries");
var se_SummaryMetricQuery = /* @__PURE__ */ __name((input, context) => {
return (0, import_smithy_client.take)(input, {
AggregationPeriod: [],
Dimensions: import_smithy_client._json,
EndTimestamp: (_) => _.getTime() / 1e3,
MetricName: [],
QueryId: [],
StartTimestamp: (_) => _.getTime() / 1e3,
});
}, "se_SummaryMetricQuery");
var de_Accuracy = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
HorizontalAccuracy: import_smithy_client.limitedParseFloat32,
VerticalAccuracy: import_smithy_client.limitedParseFloat32,
});
}, "de_Accuracy");
var de_ImportedSidewalkDevice = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
LastUpdateTime: (_) =>
(0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
OnboardingStatus: import_smithy_client.expectString,
OnboardingStatusReason: import_smithy_client.expectString,
SidewalkManufacturingSn: import_smithy_client.expectString,
});
}, "de_ImportedSidewalkDevice");
var de_ImportedWirelessDevice = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
Sidewalk: (_) => de_ImportedSidewalkDevice(_, context),
});
}, "de_ImportedWirelessDevice");
var de_ImportedWirelessDeviceList = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return de_ImportedWirelessDevice(entry, context);
});
return retVal;
}, "de_ImportedWirelessDeviceList");
var de_LoRaWANDeviceMetadata = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
DataRate: import_smithy_client.expectInt32,
DevEui: import_smithy_client.expectString,
FPort: import_smithy_client.expectInt32,
Frequency: import_smithy_client.expectInt32,
Gateways: (_) => de_LoRaWANGatewayMetadataList(_, context),
PublicGateways: (_) => de_LoRaWANPublicGatewayMetadataList(_, context),
Timestamp: import_smithy_client.expectString,
});
}, "de_LoRaWANDeviceMetadata");
var de_LoRaWANFuotaTaskGetInfo = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
RfRegion: import_smithy_client.expectString,
StartTime: (_) =>
(0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
});
}, "de_LoRaWANFuotaTaskGetInfo");
var de_LoRaWANGateway = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
Beaconing: import_smithy_client._json,
GatewayEui: import_smithy_client.expectString,
JoinEuiFilters: import_smithy_client._json,
MaxEirp: import_smithy_client.limitedParseFloat32,
NetIdFilters: import_smithy_client._json,
RfRegion: import_smithy_client.expectString,
SubBands: import_smithy_client._json,
});
}, "de_LoRaWANGateway");
var de_LoRaWANGatewayMetadata = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
GatewayEui: import_smithy_client.expectString,
Rssi: import_smithy_client.limitedParseDouble,
Snr: import_smithy_client.limitedParseDouble,
});
}, "de_LoRaWANGatewayMetadata");
var de_LoRaWANGatewayMetadataList = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return de_LoRaWANGatewayMetadata(entry, context);
});
return retVal;
}, "de_LoRaWANGatewayMetadataList");
var de_LoRaWANMulticastSession = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
DlDr: import_smithy_client.expectInt32,
DlFreq: import_smithy_client.expectInt32,
PingSlotPeriod: import_smithy_client.expectInt32,
SessionStartTime: (_) =>
(0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
SessionTimeout: import_smithy_client.expectInt32,
});
}, "de_LoRaWANMulticastSession");
var de_LoRaWANPublicGatewayMetadata = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
DlAllowed: import_smithy_client.expectBoolean,
Id: import_smithy_client.expectString,
ProviderNetId: import_smithy_client.expectString,
RfRegion: import_smithy_client.expectString,
Rssi: import_smithy_client.limitedParseDouble,
Snr: import_smithy_client.limitedParseDouble,
});
}, "de_LoRaWANPublicGatewayMetadata");
var de_LoRaWANPublicGatewayMetadataList = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return de_LoRaWANPublicGatewayMetadata(entry, context);
});
return retVal;
}, "de_LoRaWANPublicGatewayMetadataList");
var de_MetricQueryTimestamps = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return (0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(entry))
);
});
return retVal;
}, "de_MetricQueryTimestamps");
var de_MetricQueryValue = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
Avg: import_smithy_client.limitedParseDouble,
Max: import_smithy_client.limitedParseDouble,
Min: import_smithy_client.limitedParseDouble,
P90: import_smithy_client.limitedParseDouble,
Std: import_smithy_client.limitedParseDouble,
Sum: import_smithy_client.limitedParseDouble,
});
}, "de_MetricQueryValue");
var de_MetricQueryValues = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return de_MetricQueryValue(entry, context);
});
return retVal;
}, "de_MetricQueryValues");
var de_PositionCoordinate = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return (0, import_smithy_client.limitedParseFloat32)(entry);
});
return retVal;
}, "de_PositionCoordinate");
var de_SummaryMetricQueryResult = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
AggregationPeriod: import_smithy_client.expectString,
Dimensions: import_smithy_client._json,
EndTimestamp: (_) =>
(0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))
),
Error: import_smithy_client.expectString,
MetricName: import_smithy_client.expectString,
QueryId: import_smithy_client.expectString,
QueryStatus: import_smithy_client.expectString,
StartTimestamp: (_) =>
(0, import_smithy_client.expectNonNull)(
(0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))
),
Timestamps: (_) => de_MetricQueryTimestamps(_, context),
Unit: import_smithy_client.expectString,
Values: (_) => de_MetricQueryValues(_, context),
});
}, "de_SummaryMetricQueryResult");
var de_SummaryMetricQueryResults = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return de_SummaryMetricQueryResult(entry, context);
});
return retVal;
}, "de_SummaryMetricQueryResults");
var de_WirelessDeviceImportTask = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
Arn: import_smithy_client.expectString,
CreationTime: (_) =>
(0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
DestinationName: import_smithy_client.expectString,
FailedImportedDeviceCount: import_smithy_client.expectLong,
Id: import_smithy_client.expectString,
InitializedImportedDeviceCount: import_smithy_client.expectLong,
OnboardedImportedDeviceCount: import_smithy_client.expectLong,
PendingImportedDeviceCount: import_smithy_client.expectLong,
Sidewalk: import_smithy_client._json,
Status: import_smithy_client.expectString,
StatusReason: import_smithy_client.expectString,
});
}, "de_WirelessDeviceImportTask");
var de_WirelessDeviceImportTaskList = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return de_WirelessDeviceImportTask(entry, context);
});
return retVal;
}, "de_WirelessDeviceImportTaskList");
var de_WirelessGatewayStatistics = /* @__PURE__ */ __name((output, context) => {
return (0, import_smithy_client.take)(output, {
Arn: import_smithy_client.expectString,
Description: import_smithy_client.expectString,
Id: import_smithy_client.expectString,
LastUplinkReceivedAt: import_smithy_client.expectString,
LoRaWAN: (_) => de_LoRaWANGateway(_, context),
Name: import_smithy_client.expectString,
});
}, "de_WirelessGatewayStatistics");
var de_WirelessGatewayStatisticsList = /* @__PURE__ */ __name((output, context) => {
const retVal = (output || [])
.filter((e) => e != null)
.map((entry) => {
return de_WirelessGatewayStatistics(entry, context);
});
return retVal;
}, "de_WirelessGatewayStatisticsList");
var deserializeMetadata = /* @__PURE__ */ __name(
(output) => ({
httpStatusCode: output.statusCode,
requestId:
output.headers["x-amzn-requestid"] ??
output.headers["x-amzn-request-id"] ??
output.headers["x-amz-request-id"],
extendedRequestId: output.headers["x-amz-id-2"],
cfId: output.headers["x-amz-cf-id"],
}),
"deserializeMetadata"
);
var _DN = "DestinationName";
var _DPI = "DeviceProfileId";
var _DPT = "DeviceProfileType";
var _FTI = "FuotaTaskId";
var _I = "Id";
var _IT = "IdentifierType";
var _MGI = "MulticastGroupId";
var _MI = "MessageId";
var _MR = "MaxResults";
var _NT = "NextToken";
var _PT = "PartnerType";
var _RA = "ResourceArn";
var _RT = "ResourceType";
var _S = "Status";
var _SPI = "ServiceProfileId";
var _ST = "ServiceType";
var _TDT = "TaskDefinitionType";
var _TK = "TagKeys";
var _WDT = "WirelessDeviceType";
var _dN = "destinationName";
var _dPI = "deviceProfileId";
var _dPT = "deviceProfileType";
var _fTI = "fuotaTaskId";
var _i = "id";
var _iT = "identifierType";
var _mGI = "multicastGroupId";
var _mI = "messageId";
var _mR = "maxResults";
var _nT = "nextToken";
var _pT = "partnerType";
var _rA = "resourceArn";
var _rT = "resourceType";
var _s = "status";
var _sPI = "serviceProfileId";
var _sT = "serviceType";
var _tDT = "taskDefinitionType";
var _tK = "tagKeys";
var _wDT = "wirelessDeviceType";
var _AssociateAwsAccountWithPartnerAccountCommand = class _AssociateAwsAccountWithPartnerAccountCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "AssociateAwsAccountWithPartnerAccount", {})
.n("IoTWirelessClient", "AssociateAwsAccountWithPartnerAccountCommand")
.f(
AssociateAwsAccountWithPartnerAccountRequestFilterSensitiveLog,
AssociateAwsAccountWithPartnerAccountResponseFilterSensitiveLog
)
.ser(se_AssociateAwsAccountWithPartnerAccountCommand)
.de(de_AssociateAwsAccountWithPartnerAccountCommand)
.build() {};
__name(_AssociateAwsAccountWithPartnerAccountCommand, "AssociateAwsAccountWithPartnerAccountCommand");
var AssociateAwsAccountWithPartnerAccountCommand = _AssociateAwsAccountWithPartnerAccountCommand;
var _AssociateMulticastGroupWithFuotaTaskCommand = class _AssociateMulticastGroupWithFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "AssociateMulticastGroupWithFuotaTask", {})
.n("IoTWirelessClient", "AssociateMulticastGroupWithFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_AssociateMulticastGroupWithFuotaTaskCommand)
.de(de_AssociateMulticastGroupWithFuotaTaskCommand)
.build() {};
__name(_AssociateMulticastGroupWithFuotaTaskCommand, "AssociateMulticastGroupWithFuotaTaskCommand");
var AssociateMulticastGroupWithFuotaTaskCommand = _AssociateMulticastGroupWithFuotaTaskCommand;
var _AssociateWirelessDeviceWithFuotaTaskCommand = class _AssociateWirelessDeviceWithFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "AssociateWirelessDeviceWithFuotaTask", {})
.n("IoTWirelessClient", "AssociateWirelessDeviceWithFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_AssociateWirelessDeviceWithFuotaTaskCommand)
.de(de_AssociateWirelessDeviceWithFuotaTaskCommand)
.build() {};
__name(_AssociateWirelessDeviceWithFuotaTaskCommand, "AssociateWirelessDeviceWithFuotaTaskCommand");
var AssociateWirelessDeviceWithFuotaTaskCommand = _AssociateWirelessDeviceWithFuotaTaskCommand;
var _AssociateWirelessDeviceWithMulticastGroupCommand = class _AssociateWirelessDeviceWithMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "AssociateWirelessDeviceWithMulticastGroup", {})
.n("IoTWirelessClient", "AssociateWirelessDeviceWithMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_AssociateWirelessDeviceWithMulticastGroupCommand)
.de(de_AssociateWirelessDeviceWithMulticastGroupCommand)
.build() {};
__name(_AssociateWirelessDeviceWithMulticastGroupCommand, "AssociateWirelessDeviceWithMulticastGroupCommand");
var AssociateWirelessDeviceWithMulticastGroupCommand = _AssociateWirelessDeviceWithMulticastGroupCommand;
var _AssociateWirelessDeviceWithThingCommand = class _AssociateWirelessDeviceWithThingCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "AssociateWirelessDeviceWithThing", {})
.n("IoTWirelessClient", "AssociateWirelessDeviceWithThingCommand")
.f(void 0, void 0)
.ser(se_AssociateWirelessDeviceWithThingCommand)
.de(de_AssociateWirelessDeviceWithThingCommand)
.build() {};
__name(_AssociateWirelessDeviceWithThingCommand, "AssociateWirelessDeviceWithThingCommand");
var AssociateWirelessDeviceWithThingCommand = _AssociateWirelessDeviceWithThingCommand;
var _AssociateWirelessGatewayWithCertificateCommand = class _AssociateWirelessGatewayWithCertificateCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "AssociateWirelessGatewayWithCertificate", {})
.n("IoTWirelessClient", "AssociateWirelessGatewayWithCertificateCommand")
.f(void 0, void 0)
.ser(se_AssociateWirelessGatewayWithCertificateCommand)
.de(de_AssociateWirelessGatewayWithCertificateCommand)
.build() {};
__name(_AssociateWirelessGatewayWithCertificateCommand, "AssociateWirelessGatewayWithCertificateCommand");
var AssociateWirelessGatewayWithCertificateCommand = _AssociateWirelessGatewayWithCertificateCommand;
var _AssociateWirelessGatewayWithThingCommand = class _AssociateWirelessGatewayWithThingCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "AssociateWirelessGatewayWithThing", {})
.n("IoTWirelessClient", "AssociateWirelessGatewayWithThingCommand")
.f(void 0, void 0)
.ser(se_AssociateWirelessGatewayWithThingCommand)
.de(de_AssociateWirelessGatewayWithThingCommand)
.build() {};
__name(_AssociateWirelessGatewayWithThingCommand, "AssociateWirelessGatewayWithThingCommand");
var AssociateWirelessGatewayWithThingCommand = _AssociateWirelessGatewayWithThingCommand;
var _CancelMulticastGroupSessionCommand = class _CancelMulticastGroupSessionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CancelMulticastGroupSession", {})
.n("IoTWirelessClient", "CancelMulticastGroupSessionCommand")
.f(void 0, void 0)
.ser(se_CancelMulticastGroupSessionCommand)
.de(de_CancelMulticastGroupSessionCommand)
.build() {};
__name(_CancelMulticastGroupSessionCommand, "CancelMulticastGroupSessionCommand");
var CancelMulticastGroupSessionCommand = _CancelMulticastGroupSessionCommand;
var _CreateDestinationCommand = class _CreateDestinationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateDestination", {})
.n("IoTWirelessClient", "CreateDestinationCommand")
.f(void 0, void 0)
.ser(se_CreateDestinationCommand)
.de(de_CreateDestinationCommand)
.build() {};
__name(_CreateDestinationCommand, "CreateDestinationCommand");
var CreateDestinationCommand = _CreateDestinationCommand;
var _CreateDeviceProfileCommand = class _CreateDeviceProfileCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateDeviceProfile", {})
.n("IoTWirelessClient", "CreateDeviceProfileCommand")
.f(void 0, void 0)
.ser(se_CreateDeviceProfileCommand)
.de(de_CreateDeviceProfileCommand)
.build() {};
__name(_CreateDeviceProfileCommand, "CreateDeviceProfileCommand");
var CreateDeviceProfileCommand = _CreateDeviceProfileCommand;
var _CreateFuotaTaskCommand = class _CreateFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateFuotaTask", {})
.n("IoTWirelessClient", "CreateFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_CreateFuotaTaskCommand)
.de(de_CreateFuotaTaskCommand)
.build() {};
__name(_CreateFuotaTaskCommand, "CreateFuotaTaskCommand");
var CreateFuotaTaskCommand = _CreateFuotaTaskCommand;
var _CreateMulticastGroupCommand = class _CreateMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateMulticastGroup", {})
.n("IoTWirelessClient", "CreateMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_CreateMulticastGroupCommand)
.de(de_CreateMulticastGroupCommand)
.build() {};
__name(_CreateMulticastGroupCommand, "CreateMulticastGroupCommand");
var CreateMulticastGroupCommand = _CreateMulticastGroupCommand;
var _CreateNetworkAnalyzerConfigurationCommand = class _CreateNetworkAnalyzerConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateNetworkAnalyzerConfiguration", {})
.n("IoTWirelessClient", "CreateNetworkAnalyzerConfigurationCommand")
.f(void 0, void 0)
.ser(se_CreateNetworkAnalyzerConfigurationCommand)
.de(de_CreateNetworkAnalyzerConfigurationCommand)
.build() {};
__name(_CreateNetworkAnalyzerConfigurationCommand, "CreateNetworkAnalyzerConfigurationCommand");
var CreateNetworkAnalyzerConfigurationCommand = _CreateNetworkAnalyzerConfigurationCommand;
var _CreateServiceProfileCommand = class _CreateServiceProfileCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateServiceProfile", {})
.n("IoTWirelessClient", "CreateServiceProfileCommand")
.f(void 0, void 0)
.ser(se_CreateServiceProfileCommand)
.de(de_CreateServiceProfileCommand)
.build() {};
__name(_CreateServiceProfileCommand, "CreateServiceProfileCommand");
var CreateServiceProfileCommand = _CreateServiceProfileCommand;
var _CreateWirelessDeviceCommand = class _CreateWirelessDeviceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateWirelessDevice", {})
.n("IoTWirelessClient", "CreateWirelessDeviceCommand")
.f(void 0, void 0)
.ser(se_CreateWirelessDeviceCommand)
.de(de_CreateWirelessDeviceCommand)
.build() {};
__name(_CreateWirelessDeviceCommand, "CreateWirelessDeviceCommand");
var CreateWirelessDeviceCommand = _CreateWirelessDeviceCommand;
var _CreateWirelessGatewayCommand = class _CreateWirelessGatewayCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateWirelessGateway", {})
.n("IoTWirelessClient", "CreateWirelessGatewayCommand")
.f(void 0, void 0)
.ser(se_CreateWirelessGatewayCommand)
.de(de_CreateWirelessGatewayCommand)
.build() {};
__name(_CreateWirelessGatewayCommand, "CreateWirelessGatewayCommand");
var CreateWirelessGatewayCommand = _CreateWirelessGatewayCommand;
var _CreateWirelessGatewayTaskCommand = class _CreateWirelessGatewayTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateWirelessGatewayTask", {})
.n("IoTWirelessClient", "CreateWirelessGatewayTaskCommand")
.f(void 0, void 0)
.ser(se_CreateWirelessGatewayTaskCommand)
.de(de_CreateWirelessGatewayTaskCommand)
.build() {};
__name(_CreateWirelessGatewayTaskCommand, "CreateWirelessGatewayTaskCommand");
var CreateWirelessGatewayTaskCommand = _CreateWirelessGatewayTaskCommand;
var _CreateWirelessGatewayTaskDefinitionCommand = class _CreateWirelessGatewayTaskDefinitionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "CreateWirelessGatewayTaskDefinition", {})
.n("IoTWirelessClient", "CreateWirelessGatewayTaskDefinitionCommand")
.f(void 0, void 0)
.ser(se_CreateWirelessGatewayTaskDefinitionCommand)
.de(de_CreateWirelessGatewayTaskDefinitionCommand)
.build() {};
__name(_CreateWirelessGatewayTaskDefinitionCommand, "CreateWirelessGatewayTaskDefinitionCommand");
var CreateWirelessGatewayTaskDefinitionCommand = _CreateWirelessGatewayTaskDefinitionCommand;
var _DeleteDestinationCommand = class _DeleteDestinationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteDestination", {})
.n("IoTWirelessClient", "DeleteDestinationCommand")
.f(void 0, void 0)
.ser(se_DeleteDestinationCommand)
.de(de_DeleteDestinationCommand)
.build() {};
__name(_DeleteDestinationCommand, "DeleteDestinationCommand");
var DeleteDestinationCommand = _DeleteDestinationCommand;
var _DeleteDeviceProfileCommand = class _DeleteDeviceProfileCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteDeviceProfile", {})
.n("IoTWirelessClient", "DeleteDeviceProfileCommand")
.f(void 0, void 0)
.ser(se_DeleteDeviceProfileCommand)
.de(de_DeleteDeviceProfileCommand)
.build() {};
__name(_DeleteDeviceProfileCommand, "DeleteDeviceProfileCommand");
var DeleteDeviceProfileCommand = _DeleteDeviceProfileCommand;
var _DeleteFuotaTaskCommand = class _DeleteFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteFuotaTask", {})
.n("IoTWirelessClient", "DeleteFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_DeleteFuotaTaskCommand)
.de(de_DeleteFuotaTaskCommand)
.build() {};
__name(_DeleteFuotaTaskCommand, "DeleteFuotaTaskCommand");
var DeleteFuotaTaskCommand = _DeleteFuotaTaskCommand;
var _DeleteMulticastGroupCommand = class _DeleteMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteMulticastGroup", {})
.n("IoTWirelessClient", "DeleteMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_DeleteMulticastGroupCommand)
.de(de_DeleteMulticastGroupCommand)
.build() {};
__name(_DeleteMulticastGroupCommand, "DeleteMulticastGroupCommand");
var DeleteMulticastGroupCommand = _DeleteMulticastGroupCommand;
var _DeleteNetworkAnalyzerConfigurationCommand = class _DeleteNetworkAnalyzerConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteNetworkAnalyzerConfiguration", {})
.n("IoTWirelessClient", "DeleteNetworkAnalyzerConfigurationCommand")
.f(void 0, void 0)
.ser(se_DeleteNetworkAnalyzerConfigurationCommand)
.de(de_DeleteNetworkAnalyzerConfigurationCommand)
.build() {};
__name(_DeleteNetworkAnalyzerConfigurationCommand, "DeleteNetworkAnalyzerConfigurationCommand");
var DeleteNetworkAnalyzerConfigurationCommand = _DeleteNetworkAnalyzerConfigurationCommand;
var _DeleteQueuedMessagesCommand = class _DeleteQueuedMessagesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteQueuedMessages", {})
.n("IoTWirelessClient", "DeleteQueuedMessagesCommand")
.f(void 0, void 0)
.ser(se_DeleteQueuedMessagesCommand)
.de(de_DeleteQueuedMessagesCommand)
.build() {};
__name(_DeleteQueuedMessagesCommand, "DeleteQueuedMessagesCommand");
var DeleteQueuedMessagesCommand = _DeleteQueuedMessagesCommand;
var _DeleteServiceProfileCommand = class _DeleteServiceProfileCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteServiceProfile", {})
.n("IoTWirelessClient", "DeleteServiceProfileCommand")
.f(void 0, void 0)
.ser(se_DeleteServiceProfileCommand)
.de(de_DeleteServiceProfileCommand)
.build() {};
__name(_DeleteServiceProfileCommand, "DeleteServiceProfileCommand");
var DeleteServiceProfileCommand = _DeleteServiceProfileCommand;
var _DeleteWirelessDeviceCommand = class _DeleteWirelessDeviceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteWirelessDevice", {})
.n("IoTWirelessClient", "DeleteWirelessDeviceCommand")
.f(void 0, void 0)
.ser(se_DeleteWirelessDeviceCommand)
.de(de_DeleteWirelessDeviceCommand)
.build() {};
__name(_DeleteWirelessDeviceCommand, "DeleteWirelessDeviceCommand");
var DeleteWirelessDeviceCommand = _DeleteWirelessDeviceCommand;
var _DeleteWirelessDeviceImportTaskCommand = class _DeleteWirelessDeviceImportTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteWirelessDeviceImportTask", {})
.n("IoTWirelessClient", "DeleteWirelessDeviceImportTaskCommand")
.f(void 0, void 0)
.ser(se_DeleteWirelessDeviceImportTaskCommand)
.de(de_DeleteWirelessDeviceImportTaskCommand)
.build() {};
__name(_DeleteWirelessDeviceImportTaskCommand, "DeleteWirelessDeviceImportTaskCommand");
var DeleteWirelessDeviceImportTaskCommand = _DeleteWirelessDeviceImportTaskCommand;
var _DeleteWirelessGatewayCommand = class _DeleteWirelessGatewayCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteWirelessGateway", {})
.n("IoTWirelessClient", "DeleteWirelessGatewayCommand")
.f(void 0, void 0)
.ser(se_DeleteWirelessGatewayCommand)
.de(de_DeleteWirelessGatewayCommand)
.build() {};
__name(_DeleteWirelessGatewayCommand, "DeleteWirelessGatewayCommand");
var DeleteWirelessGatewayCommand = _DeleteWirelessGatewayCommand;
var _DeleteWirelessGatewayTaskCommand = class _DeleteWirelessGatewayTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteWirelessGatewayTask", {})
.n("IoTWirelessClient", "DeleteWirelessGatewayTaskCommand")
.f(void 0, void 0)
.ser(se_DeleteWirelessGatewayTaskCommand)
.de(de_DeleteWirelessGatewayTaskCommand)
.build() {};
__name(_DeleteWirelessGatewayTaskCommand, "DeleteWirelessGatewayTaskCommand");
var DeleteWirelessGatewayTaskCommand = _DeleteWirelessGatewayTaskCommand;
var _DeleteWirelessGatewayTaskDefinitionCommand = class _DeleteWirelessGatewayTaskDefinitionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeleteWirelessGatewayTaskDefinition", {})
.n("IoTWirelessClient", "DeleteWirelessGatewayTaskDefinitionCommand")
.f(void 0, void 0)
.ser(se_DeleteWirelessGatewayTaskDefinitionCommand)
.de(de_DeleteWirelessGatewayTaskDefinitionCommand)
.build() {};
__name(_DeleteWirelessGatewayTaskDefinitionCommand, "DeleteWirelessGatewayTaskDefinitionCommand");
var DeleteWirelessGatewayTaskDefinitionCommand = _DeleteWirelessGatewayTaskDefinitionCommand;
var _DeregisterWirelessDeviceCommand = class _DeregisterWirelessDeviceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DeregisterWirelessDevice", {})
.n("IoTWirelessClient", "DeregisterWirelessDeviceCommand")
.f(void 0, void 0)
.ser(se_DeregisterWirelessDeviceCommand)
.de(de_DeregisterWirelessDeviceCommand)
.build() {};
__name(_DeregisterWirelessDeviceCommand, "DeregisterWirelessDeviceCommand");
var DeregisterWirelessDeviceCommand = _DeregisterWirelessDeviceCommand;
var _DisassociateAwsAccountFromPartnerAccountCommand = class _DisassociateAwsAccountFromPartnerAccountCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DisassociateAwsAccountFromPartnerAccount", {})
.n("IoTWirelessClient", "DisassociateAwsAccountFromPartnerAccountCommand")
.f(void 0, void 0)
.ser(se_DisassociateAwsAccountFromPartnerAccountCommand)
.de(de_DisassociateAwsAccountFromPartnerAccountCommand)
.build() {};
__name(_DisassociateAwsAccountFromPartnerAccountCommand, "DisassociateAwsAccountFromPartnerAccountCommand");
var DisassociateAwsAccountFromPartnerAccountCommand = _DisassociateAwsAccountFromPartnerAccountCommand;
var _DisassociateMulticastGroupFromFuotaTaskCommand = class _DisassociateMulticastGroupFromFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DisassociateMulticastGroupFromFuotaTask", {})
.n("IoTWirelessClient", "DisassociateMulticastGroupFromFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_DisassociateMulticastGroupFromFuotaTaskCommand)
.de(de_DisassociateMulticastGroupFromFuotaTaskCommand)
.build() {};
__name(_DisassociateMulticastGroupFromFuotaTaskCommand, "DisassociateMulticastGroupFromFuotaTaskCommand");
var DisassociateMulticastGroupFromFuotaTaskCommand = _DisassociateMulticastGroupFromFuotaTaskCommand;
var _DisassociateWirelessDeviceFromFuotaTaskCommand = class _DisassociateWirelessDeviceFromFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DisassociateWirelessDeviceFromFuotaTask", {})
.n("IoTWirelessClient", "DisassociateWirelessDeviceFromFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_DisassociateWirelessDeviceFromFuotaTaskCommand)
.de(de_DisassociateWirelessDeviceFromFuotaTaskCommand)
.build() {};
__name(_DisassociateWirelessDeviceFromFuotaTaskCommand, "DisassociateWirelessDeviceFromFuotaTaskCommand");
var DisassociateWirelessDeviceFromFuotaTaskCommand = _DisassociateWirelessDeviceFromFuotaTaskCommand;
var _DisassociateWirelessDeviceFromMulticastGroupCommand = class _DisassociateWirelessDeviceFromMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DisassociateWirelessDeviceFromMulticastGroup", {})
.n("IoTWirelessClient", "DisassociateWirelessDeviceFromMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_DisassociateWirelessDeviceFromMulticastGroupCommand)
.de(de_DisassociateWirelessDeviceFromMulticastGroupCommand)
.build() {};
__name(_DisassociateWirelessDeviceFromMulticastGroupCommand, "DisassociateWirelessDeviceFromMulticastGroupCommand");
var DisassociateWirelessDeviceFromMulticastGroupCommand = _DisassociateWirelessDeviceFromMulticastGroupCommand;
var _DisassociateWirelessDeviceFromThingCommand = class _DisassociateWirelessDeviceFromThingCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DisassociateWirelessDeviceFromThing", {})
.n("IoTWirelessClient", "DisassociateWirelessDeviceFromThingCommand")
.f(void 0, void 0)
.ser(se_DisassociateWirelessDeviceFromThingCommand)
.de(de_DisassociateWirelessDeviceFromThingCommand)
.build() {};
__name(_DisassociateWirelessDeviceFromThingCommand, "DisassociateWirelessDeviceFromThingCommand");
var DisassociateWirelessDeviceFromThingCommand = _DisassociateWirelessDeviceFromThingCommand;
var _DisassociateWirelessGatewayFromCertificateCommand = class _DisassociateWirelessGatewayFromCertificateCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DisassociateWirelessGatewayFromCertificate", {})
.n("IoTWirelessClient", "DisassociateWirelessGatewayFromCertificateCommand")
.f(void 0, void 0)
.ser(se_DisassociateWirelessGatewayFromCertificateCommand)
.de(de_DisassociateWirelessGatewayFromCertificateCommand)
.build() {};
__name(_DisassociateWirelessGatewayFromCertificateCommand, "DisassociateWirelessGatewayFromCertificateCommand");
var DisassociateWirelessGatewayFromCertificateCommand = _DisassociateWirelessGatewayFromCertificateCommand;
var _DisassociateWirelessGatewayFromThingCommand = class _DisassociateWirelessGatewayFromThingCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "DisassociateWirelessGatewayFromThing", {})
.n("IoTWirelessClient", "DisassociateWirelessGatewayFromThingCommand")
.f(void 0, void 0)
.ser(se_DisassociateWirelessGatewayFromThingCommand)
.de(de_DisassociateWirelessGatewayFromThingCommand)
.build() {};
__name(_DisassociateWirelessGatewayFromThingCommand, "DisassociateWirelessGatewayFromThingCommand");
var DisassociateWirelessGatewayFromThingCommand = _DisassociateWirelessGatewayFromThingCommand;
var _GetDestinationCommand = class _GetDestinationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetDestination", {})
.n("IoTWirelessClient", "GetDestinationCommand")
.f(void 0, void 0)
.ser(se_GetDestinationCommand)
.de(de_GetDestinationCommand)
.build() {};
__name(_GetDestinationCommand, "GetDestinationCommand");
var GetDestinationCommand = _GetDestinationCommand;
var _GetDeviceProfileCommand = class _GetDeviceProfileCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetDeviceProfile", {})
.n("IoTWirelessClient", "GetDeviceProfileCommand")
.f(void 0, GetDeviceProfileResponseFilterSensitiveLog)
.ser(se_GetDeviceProfileCommand)
.de(de_GetDeviceProfileCommand)
.build() {};
__name(_GetDeviceProfileCommand, "GetDeviceProfileCommand");
var GetDeviceProfileCommand = _GetDeviceProfileCommand;
var _GetEventConfigurationByResourceTypesCommand = class _GetEventConfigurationByResourceTypesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetEventConfigurationByResourceTypes", {})
.n("IoTWirelessClient", "GetEventConfigurationByResourceTypesCommand")
.f(void 0, void 0)
.ser(se_GetEventConfigurationByResourceTypesCommand)
.de(de_GetEventConfigurationByResourceTypesCommand)
.build() {};
__name(_GetEventConfigurationByResourceTypesCommand, "GetEventConfigurationByResourceTypesCommand");
var GetEventConfigurationByResourceTypesCommand = _GetEventConfigurationByResourceTypesCommand;
var _GetFuotaTaskCommand = class _GetFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetFuotaTask", {})
.n("IoTWirelessClient", "GetFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_GetFuotaTaskCommand)
.de(de_GetFuotaTaskCommand)
.build() {};
__name(_GetFuotaTaskCommand, "GetFuotaTaskCommand");
var GetFuotaTaskCommand = _GetFuotaTaskCommand;
var _GetLogLevelsByResourceTypesCommand = class _GetLogLevelsByResourceTypesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetLogLevelsByResourceTypes", {})
.n("IoTWirelessClient", "GetLogLevelsByResourceTypesCommand")
.f(void 0, void 0)
.ser(se_GetLogLevelsByResourceTypesCommand)
.de(de_GetLogLevelsByResourceTypesCommand)
.build() {};
__name(_GetLogLevelsByResourceTypesCommand, "GetLogLevelsByResourceTypesCommand");
var GetLogLevelsByResourceTypesCommand = _GetLogLevelsByResourceTypesCommand;
var _GetMetricConfigurationCommand = class _GetMetricConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetMetricConfiguration", {})
.n("IoTWirelessClient", "GetMetricConfigurationCommand")
.f(void 0, void 0)
.ser(se_GetMetricConfigurationCommand)
.de(de_GetMetricConfigurationCommand)
.build() {};
__name(_GetMetricConfigurationCommand, "GetMetricConfigurationCommand");
var GetMetricConfigurationCommand = _GetMetricConfigurationCommand;
var _GetMetricsCommand = class _GetMetricsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetMetrics", {})
.n("IoTWirelessClient", "GetMetricsCommand")
.f(void 0, void 0)
.ser(se_GetMetricsCommand)
.de(de_GetMetricsCommand)
.build() {};
__name(_GetMetricsCommand, "GetMetricsCommand");
var GetMetricsCommand = _GetMetricsCommand;
var _GetMulticastGroupCommand = class _GetMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetMulticastGroup", {})
.n("IoTWirelessClient", "GetMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_GetMulticastGroupCommand)
.de(de_GetMulticastGroupCommand)
.build() {};
__name(_GetMulticastGroupCommand, "GetMulticastGroupCommand");
var GetMulticastGroupCommand = _GetMulticastGroupCommand;
var _GetMulticastGroupSessionCommand = class _GetMulticastGroupSessionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetMulticastGroupSession", {})
.n("IoTWirelessClient", "GetMulticastGroupSessionCommand")
.f(void 0, void 0)
.ser(se_GetMulticastGroupSessionCommand)
.de(de_GetMulticastGroupSessionCommand)
.build() {};
__name(_GetMulticastGroupSessionCommand, "GetMulticastGroupSessionCommand");
var GetMulticastGroupSessionCommand = _GetMulticastGroupSessionCommand;
var _GetNetworkAnalyzerConfigurationCommand = class _GetNetworkAnalyzerConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetNetworkAnalyzerConfiguration", {})
.n("IoTWirelessClient", "GetNetworkAnalyzerConfigurationCommand")
.f(void 0, void 0)
.ser(se_GetNetworkAnalyzerConfigurationCommand)
.de(de_GetNetworkAnalyzerConfigurationCommand)
.build() {};
__name(_GetNetworkAnalyzerConfigurationCommand, "GetNetworkAnalyzerConfigurationCommand");
var GetNetworkAnalyzerConfigurationCommand = _GetNetworkAnalyzerConfigurationCommand;
var _GetPartnerAccountCommand = class _GetPartnerAccountCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetPartnerAccount", {})
.n("IoTWirelessClient", "GetPartnerAccountCommand")
.f(void 0, GetPartnerAccountResponseFilterSensitiveLog)
.ser(se_GetPartnerAccountCommand)
.de(de_GetPartnerAccountCommand)
.build() {};
__name(_GetPartnerAccountCommand, "GetPartnerAccountCommand");
var GetPartnerAccountCommand = _GetPartnerAccountCommand;
var _GetPositionCommand = class _GetPositionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetPosition", {})
.n("IoTWirelessClient", "GetPositionCommand")
.f(void 0, void 0)
.ser(se_GetPositionCommand)
.de(de_GetPositionCommand)
.build() {};
__name(_GetPositionCommand, "GetPositionCommand");
var GetPositionCommand = _GetPositionCommand;
var _GetPositionConfigurationCommand = class _GetPositionConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetPositionConfiguration", {})
.n("IoTWirelessClient", "GetPositionConfigurationCommand")
.f(void 0, void 0)
.ser(se_GetPositionConfigurationCommand)
.de(de_GetPositionConfigurationCommand)
.build() {};
__name(_GetPositionConfigurationCommand, "GetPositionConfigurationCommand");
var GetPositionConfigurationCommand = _GetPositionConfigurationCommand;
var _GetPositionEstimateCommand = class _GetPositionEstimateCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetPositionEstimate", {})
.n("IoTWirelessClient", "GetPositionEstimateCommand")
.f(void 0, void 0)
.ser(se_GetPositionEstimateCommand)
.de(de_GetPositionEstimateCommand)
.build() {};
__name(_GetPositionEstimateCommand, "GetPositionEstimateCommand");
var GetPositionEstimateCommand2 = _GetPositionEstimateCommand;
var _GetResourceEventConfigurationCommand = class _GetResourceEventConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetResourceEventConfiguration", {})
.n("IoTWirelessClient", "GetResourceEventConfigurationCommand")
.f(void 0, void 0)
.ser(se_GetResourceEventConfigurationCommand)
.de(de_GetResourceEventConfigurationCommand)
.build() {};
__name(_GetResourceEventConfigurationCommand, "GetResourceEventConfigurationCommand");
var GetResourceEventConfigurationCommand = _GetResourceEventConfigurationCommand;
var _GetResourceLogLevelCommand = class _GetResourceLogLevelCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetResourceLogLevel", {})
.n("IoTWirelessClient", "GetResourceLogLevelCommand")
.f(void 0, void 0)
.ser(se_GetResourceLogLevelCommand)
.de(de_GetResourceLogLevelCommand)
.build() {};
__name(_GetResourceLogLevelCommand, "GetResourceLogLevelCommand");
var GetResourceLogLevelCommand = _GetResourceLogLevelCommand;
var _GetResourcePositionCommand = class _GetResourcePositionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetResourcePosition", {})
.n("IoTWirelessClient", "GetResourcePositionCommand")
.f(void 0, void 0)
.ser(se_GetResourcePositionCommand)
.de(de_GetResourcePositionCommand)
.build() {};
__name(_GetResourcePositionCommand, "GetResourcePositionCommand");
var GetResourcePositionCommand = _GetResourcePositionCommand;
var _GetServiceEndpointCommand = class _GetServiceEndpointCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetServiceEndpoint", {})
.n("IoTWirelessClient", "GetServiceEndpointCommand")
.f(void 0, void 0)
.ser(se_GetServiceEndpointCommand)
.de(de_GetServiceEndpointCommand)
.build() {};
__name(_GetServiceEndpointCommand, "GetServiceEndpointCommand");
var GetServiceEndpointCommand = _GetServiceEndpointCommand;
var _GetServiceProfileCommand = class _GetServiceProfileCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetServiceProfile", {})
.n("IoTWirelessClient", "GetServiceProfileCommand")
.f(void 0, void 0)
.ser(se_GetServiceProfileCommand)
.de(de_GetServiceProfileCommand)
.build() {};
__name(_GetServiceProfileCommand, "GetServiceProfileCommand");
var GetServiceProfileCommand = _GetServiceProfileCommand;
var _GetWirelessDeviceCommand = class _GetWirelessDeviceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessDevice", {})
.n("IoTWirelessClient", "GetWirelessDeviceCommand")
.f(void 0, void 0)
.ser(se_GetWirelessDeviceCommand)
.de(de_GetWirelessDeviceCommand)
.build() {};
__name(_GetWirelessDeviceCommand, "GetWirelessDeviceCommand");
var GetWirelessDeviceCommand = _GetWirelessDeviceCommand;
var _GetWirelessDeviceImportTaskCommand = class _GetWirelessDeviceImportTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessDeviceImportTask", {})
.n("IoTWirelessClient", "GetWirelessDeviceImportTaskCommand")
.f(void 0, void 0)
.ser(se_GetWirelessDeviceImportTaskCommand)
.de(de_GetWirelessDeviceImportTaskCommand)
.build() {};
__name(_GetWirelessDeviceImportTaskCommand, "GetWirelessDeviceImportTaskCommand");
var GetWirelessDeviceImportTaskCommand = _GetWirelessDeviceImportTaskCommand;
var _GetWirelessDeviceStatisticsCommand = class _GetWirelessDeviceStatisticsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessDeviceStatistics", {})
.n("IoTWirelessClient", "GetWirelessDeviceStatisticsCommand")
.f(void 0, void 0)
.ser(se_GetWirelessDeviceStatisticsCommand)
.de(de_GetWirelessDeviceStatisticsCommand)
.build() {};
__name(_GetWirelessDeviceStatisticsCommand, "GetWirelessDeviceStatisticsCommand");
var GetWirelessDeviceStatisticsCommand = _GetWirelessDeviceStatisticsCommand;
var _GetWirelessGatewayCertificateCommand = class _GetWirelessGatewayCertificateCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessGatewayCertificate", {})
.n("IoTWirelessClient", "GetWirelessGatewayCertificateCommand")
.f(void 0, void 0)
.ser(se_GetWirelessGatewayCertificateCommand)
.de(de_GetWirelessGatewayCertificateCommand)
.build() {};
__name(_GetWirelessGatewayCertificateCommand, "GetWirelessGatewayCertificateCommand");
var GetWirelessGatewayCertificateCommand = _GetWirelessGatewayCertificateCommand;
var _GetWirelessGatewayCommand = class _GetWirelessGatewayCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessGateway", {})
.n("IoTWirelessClient", "GetWirelessGatewayCommand")
.f(void 0, void 0)
.ser(se_GetWirelessGatewayCommand)
.de(de_GetWirelessGatewayCommand)
.build() {};
__name(_GetWirelessGatewayCommand, "GetWirelessGatewayCommand");
var GetWirelessGatewayCommand = _GetWirelessGatewayCommand;
var _GetWirelessGatewayFirmwareInformationCommand = class _GetWirelessGatewayFirmwareInformationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessGatewayFirmwareInformation", {})
.n("IoTWirelessClient", "GetWirelessGatewayFirmwareInformationCommand")
.f(void 0, void 0)
.ser(se_GetWirelessGatewayFirmwareInformationCommand)
.de(de_GetWirelessGatewayFirmwareInformationCommand)
.build() {};
__name(_GetWirelessGatewayFirmwareInformationCommand, "GetWirelessGatewayFirmwareInformationCommand");
var GetWirelessGatewayFirmwareInformationCommand = _GetWirelessGatewayFirmwareInformationCommand;
var _GetWirelessGatewayStatisticsCommand = class _GetWirelessGatewayStatisticsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessGatewayStatistics", {})
.n("IoTWirelessClient", "GetWirelessGatewayStatisticsCommand")
.f(void 0, void 0)
.ser(se_GetWirelessGatewayStatisticsCommand)
.de(de_GetWirelessGatewayStatisticsCommand)
.build() {};
__name(_GetWirelessGatewayStatisticsCommand, "GetWirelessGatewayStatisticsCommand");
var GetWirelessGatewayStatisticsCommand = _GetWirelessGatewayStatisticsCommand;
var _GetWirelessGatewayTaskCommand = class _GetWirelessGatewayTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessGatewayTask", {})
.n("IoTWirelessClient", "GetWirelessGatewayTaskCommand")
.f(void 0, void 0)
.ser(se_GetWirelessGatewayTaskCommand)
.de(de_GetWirelessGatewayTaskCommand)
.build() {};
__name(_GetWirelessGatewayTaskCommand, "GetWirelessGatewayTaskCommand");
var GetWirelessGatewayTaskCommand = _GetWirelessGatewayTaskCommand;
var _GetWirelessGatewayTaskDefinitionCommand = class _GetWirelessGatewayTaskDefinitionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "GetWirelessGatewayTaskDefinition", {})
.n("IoTWirelessClient", "GetWirelessGatewayTaskDefinitionCommand")
.f(void 0, void 0)
.ser(se_GetWirelessGatewayTaskDefinitionCommand)
.de(de_GetWirelessGatewayTaskDefinitionCommand)
.build() {};
__name(_GetWirelessGatewayTaskDefinitionCommand, "GetWirelessGatewayTaskDefinitionCommand");
var GetWirelessGatewayTaskDefinitionCommand = _GetWirelessGatewayTaskDefinitionCommand;
var _ListDestinationsCommand = class _ListDestinationsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListDestinations", {})
.n("IoTWirelessClient", "ListDestinationsCommand")
.f(void 0, void 0)
.ser(se_ListDestinationsCommand)
.de(de_ListDestinationsCommand)
.build() {};
__name(_ListDestinationsCommand, "ListDestinationsCommand");
var ListDestinationsCommand = _ListDestinationsCommand;
var _ListDeviceProfilesCommand = class _ListDeviceProfilesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListDeviceProfiles", {})
.n("IoTWirelessClient", "ListDeviceProfilesCommand")
.f(void 0, void 0)
.ser(se_ListDeviceProfilesCommand)
.de(de_ListDeviceProfilesCommand)
.build() {};
__name(_ListDeviceProfilesCommand, "ListDeviceProfilesCommand");
var ListDeviceProfilesCommand = _ListDeviceProfilesCommand;
var _ListDevicesForWirelessDeviceImportTaskCommand = class _ListDevicesForWirelessDeviceImportTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListDevicesForWirelessDeviceImportTask", {})
.n("IoTWirelessClient", "ListDevicesForWirelessDeviceImportTaskCommand")
.f(void 0, void 0)
.ser(se_ListDevicesForWirelessDeviceImportTaskCommand)
.de(de_ListDevicesForWirelessDeviceImportTaskCommand)
.build() {};
__name(_ListDevicesForWirelessDeviceImportTaskCommand, "ListDevicesForWirelessDeviceImportTaskCommand");
var ListDevicesForWirelessDeviceImportTaskCommand = _ListDevicesForWirelessDeviceImportTaskCommand;
var _ListEventConfigurationsCommand = class _ListEventConfigurationsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListEventConfigurations", {})
.n("IoTWirelessClient", "ListEventConfigurationsCommand")
.f(void 0, void 0)
.ser(se_ListEventConfigurationsCommand)
.de(de_ListEventConfigurationsCommand)
.build() {};
__name(_ListEventConfigurationsCommand, "ListEventConfigurationsCommand");
var ListEventConfigurationsCommand = _ListEventConfigurationsCommand;
var _ListFuotaTasksCommand = class _ListFuotaTasksCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListFuotaTasks", {})
.n("IoTWirelessClient", "ListFuotaTasksCommand")
.f(void 0, void 0)
.ser(se_ListFuotaTasksCommand)
.de(de_ListFuotaTasksCommand)
.build() {};
__name(_ListFuotaTasksCommand, "ListFuotaTasksCommand");
var ListFuotaTasksCommand = _ListFuotaTasksCommand;
var _ListMulticastGroupsByFuotaTaskCommand = class _ListMulticastGroupsByFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListMulticastGroupsByFuotaTask", {})
.n("IoTWirelessClient", "ListMulticastGroupsByFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_ListMulticastGroupsByFuotaTaskCommand)
.de(de_ListMulticastGroupsByFuotaTaskCommand)
.build() {};
__name(_ListMulticastGroupsByFuotaTaskCommand, "ListMulticastGroupsByFuotaTaskCommand");
var ListMulticastGroupsByFuotaTaskCommand = _ListMulticastGroupsByFuotaTaskCommand;
var _ListMulticastGroupsCommand = class _ListMulticastGroupsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListMulticastGroups", {})
.n("IoTWirelessClient", "ListMulticastGroupsCommand")
.f(void 0, void 0)
.ser(se_ListMulticastGroupsCommand)
.de(de_ListMulticastGroupsCommand)
.build() {};
__name(_ListMulticastGroupsCommand, "ListMulticastGroupsCommand");
var ListMulticastGroupsCommand = _ListMulticastGroupsCommand;
var _ListNetworkAnalyzerConfigurationsCommand = class _ListNetworkAnalyzerConfigurationsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListNetworkAnalyzerConfigurations", {})
.n("IoTWirelessClient", "ListNetworkAnalyzerConfigurationsCommand")
.f(void 0, void 0)
.ser(se_ListNetworkAnalyzerConfigurationsCommand)
.de(de_ListNetworkAnalyzerConfigurationsCommand)
.build() {};
__name(_ListNetworkAnalyzerConfigurationsCommand, "ListNetworkAnalyzerConfigurationsCommand");
var ListNetworkAnalyzerConfigurationsCommand = _ListNetworkAnalyzerConfigurationsCommand;
var _ListPartnerAccountsCommand = class _ListPartnerAccountsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListPartnerAccounts", {})
.n("IoTWirelessClient", "ListPartnerAccountsCommand")
.f(void 0, ListPartnerAccountsResponseFilterSensitiveLog)
.ser(se_ListPartnerAccountsCommand)
.de(de_ListPartnerAccountsCommand)
.build() {};
__name(_ListPartnerAccountsCommand, "ListPartnerAccountsCommand");
var ListPartnerAccountsCommand = _ListPartnerAccountsCommand;
var _ListPositionConfigurationsCommand = class _ListPositionConfigurationsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListPositionConfigurations", {})
.n("IoTWirelessClient", "ListPositionConfigurationsCommand")
.f(void 0, void 0)
.ser(se_ListPositionConfigurationsCommand)
.de(de_ListPositionConfigurationsCommand)
.build() {};
__name(_ListPositionConfigurationsCommand, "ListPositionConfigurationsCommand");
var ListPositionConfigurationsCommand = _ListPositionConfigurationsCommand;
var _ListQueuedMessagesCommand = class _ListQueuedMessagesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListQueuedMessages", {})
.n("IoTWirelessClient", "ListQueuedMessagesCommand")
.f(void 0, void 0)
.ser(se_ListQueuedMessagesCommand)
.de(de_ListQueuedMessagesCommand)
.build() {};
__name(_ListQueuedMessagesCommand, "ListQueuedMessagesCommand");
var ListQueuedMessagesCommand = _ListQueuedMessagesCommand;
var _ListServiceProfilesCommand = class _ListServiceProfilesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListServiceProfiles", {})
.n("IoTWirelessClient", "ListServiceProfilesCommand")
.f(void 0, void 0)
.ser(se_ListServiceProfilesCommand)
.de(de_ListServiceProfilesCommand)
.build() {};
__name(_ListServiceProfilesCommand, "ListServiceProfilesCommand");
var ListServiceProfilesCommand = _ListServiceProfilesCommand;
var _ListTagsForResourceCommand = class _ListTagsForResourceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListTagsForResource", {})
.n("IoTWirelessClient", "ListTagsForResourceCommand")
.f(void 0, void 0)
.ser(se_ListTagsForResourceCommand)
.de(de_ListTagsForResourceCommand)
.build() {};
__name(_ListTagsForResourceCommand, "ListTagsForResourceCommand");
var ListTagsForResourceCommand = _ListTagsForResourceCommand;
var _ListWirelessDeviceImportTasksCommand = class _ListWirelessDeviceImportTasksCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListWirelessDeviceImportTasks", {})
.n("IoTWirelessClient", "ListWirelessDeviceImportTasksCommand")
.f(void 0, void 0)
.ser(se_ListWirelessDeviceImportTasksCommand)
.de(de_ListWirelessDeviceImportTasksCommand)
.build() {};
__name(_ListWirelessDeviceImportTasksCommand, "ListWirelessDeviceImportTasksCommand");
var ListWirelessDeviceImportTasksCommand = _ListWirelessDeviceImportTasksCommand;
var _ListWirelessDevicesCommand = class _ListWirelessDevicesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListWirelessDevices", {})
.n("IoTWirelessClient", "ListWirelessDevicesCommand")
.f(void 0, void 0)
.ser(se_ListWirelessDevicesCommand)
.de(de_ListWirelessDevicesCommand)
.build() {};
__name(_ListWirelessDevicesCommand, "ListWirelessDevicesCommand");
var ListWirelessDevicesCommand = _ListWirelessDevicesCommand;
var _ListWirelessGatewaysCommand = class _ListWirelessGatewaysCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListWirelessGateways", {})
.n("IoTWirelessClient", "ListWirelessGatewaysCommand")
.f(void 0, void 0)
.ser(se_ListWirelessGatewaysCommand)
.de(de_ListWirelessGatewaysCommand)
.build() {};
__name(_ListWirelessGatewaysCommand, "ListWirelessGatewaysCommand");
var ListWirelessGatewaysCommand = _ListWirelessGatewaysCommand;
var _ListWirelessGatewayTaskDefinitionsCommand = class _ListWirelessGatewayTaskDefinitionsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ListWirelessGatewayTaskDefinitions", {})
.n("IoTWirelessClient", "ListWirelessGatewayTaskDefinitionsCommand")
.f(void 0, void 0)
.ser(se_ListWirelessGatewayTaskDefinitionsCommand)
.de(de_ListWirelessGatewayTaskDefinitionsCommand)
.build() {};
__name(_ListWirelessGatewayTaskDefinitionsCommand, "ListWirelessGatewayTaskDefinitionsCommand");
var ListWirelessGatewayTaskDefinitionsCommand = _ListWirelessGatewayTaskDefinitionsCommand;
var _PutPositionConfigurationCommand = class _PutPositionConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "PutPositionConfiguration", {})
.n("IoTWirelessClient", "PutPositionConfigurationCommand")
.f(void 0, void 0)
.ser(se_PutPositionConfigurationCommand)
.de(de_PutPositionConfigurationCommand)
.build() {};
__name(_PutPositionConfigurationCommand, "PutPositionConfigurationCommand");
var PutPositionConfigurationCommand = _PutPositionConfigurationCommand;
var _PutResourceLogLevelCommand = class _PutResourceLogLevelCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "PutResourceLogLevel", {})
.n("IoTWirelessClient", "PutResourceLogLevelCommand")
.f(void 0, void 0)
.ser(se_PutResourceLogLevelCommand)
.de(de_PutResourceLogLevelCommand)
.build() {};
__name(_PutResourceLogLevelCommand, "PutResourceLogLevelCommand");
var PutResourceLogLevelCommand = _PutResourceLogLevelCommand;
var _ResetAllResourceLogLevelsCommand = class _ResetAllResourceLogLevelsCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ResetAllResourceLogLevels", {})
.n("IoTWirelessClient", "ResetAllResourceLogLevelsCommand")
.f(void 0, void 0)
.ser(se_ResetAllResourceLogLevelsCommand)
.de(de_ResetAllResourceLogLevelsCommand)
.build() {};
__name(_ResetAllResourceLogLevelsCommand, "ResetAllResourceLogLevelsCommand");
var ResetAllResourceLogLevelsCommand = _ResetAllResourceLogLevelsCommand;
var _ResetResourceLogLevelCommand = class _ResetResourceLogLevelCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "ResetResourceLogLevel", {})
.n("IoTWirelessClient", "ResetResourceLogLevelCommand")
.f(void 0, void 0)
.ser(se_ResetResourceLogLevelCommand)
.de(de_ResetResourceLogLevelCommand)
.build() {};
__name(_ResetResourceLogLevelCommand, "ResetResourceLogLevelCommand");
var ResetResourceLogLevelCommand = _ResetResourceLogLevelCommand;
var _SendDataToMulticastGroupCommand = class _SendDataToMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "SendDataToMulticastGroup", {})
.n("IoTWirelessClient", "SendDataToMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_SendDataToMulticastGroupCommand)
.de(de_SendDataToMulticastGroupCommand)
.build() {};
__name(_SendDataToMulticastGroupCommand, "SendDataToMulticastGroupCommand");
var SendDataToMulticastGroupCommand = _SendDataToMulticastGroupCommand;
var _SendDataToWirelessDeviceCommand = class _SendDataToWirelessDeviceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "SendDataToWirelessDevice", {})
.n("IoTWirelessClient", "SendDataToWirelessDeviceCommand")
.f(void 0, void 0)
.ser(se_SendDataToWirelessDeviceCommand)
.de(de_SendDataToWirelessDeviceCommand)
.build() {};
__name(_SendDataToWirelessDeviceCommand, "SendDataToWirelessDeviceCommand");
var SendDataToWirelessDeviceCommand = _SendDataToWirelessDeviceCommand;
var _StartBulkAssociateWirelessDeviceWithMulticastGroupCommand = class _StartBulkAssociateWirelessDeviceWithMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "StartBulkAssociateWirelessDeviceWithMulticastGroup", {})
.n("IoTWirelessClient", "StartBulkAssociateWirelessDeviceWithMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand)
.de(de_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand)
.build() {};
__name(
_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand,
"StartBulkAssociateWirelessDeviceWithMulticastGroupCommand"
);
var StartBulkAssociateWirelessDeviceWithMulticastGroupCommand =
_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand;
var _StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand = class _StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "StartBulkDisassociateWirelessDeviceFromMulticastGroup", {})
.n("IoTWirelessClient", "StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand)
.de(de_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand)
.build() {};
__name(
_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand,
"StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand"
);
var StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand =
_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand;
var _StartFuotaTaskCommand = class _StartFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "StartFuotaTask", {})
.n("IoTWirelessClient", "StartFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_StartFuotaTaskCommand)
.de(de_StartFuotaTaskCommand)
.build() {};
__name(_StartFuotaTaskCommand, "StartFuotaTaskCommand");
var StartFuotaTaskCommand = _StartFuotaTaskCommand;
var _StartMulticastGroupSessionCommand = class _StartMulticastGroupSessionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "StartMulticastGroupSession", {})
.n("IoTWirelessClient", "StartMulticastGroupSessionCommand")
.f(void 0, void 0)
.ser(se_StartMulticastGroupSessionCommand)
.de(de_StartMulticastGroupSessionCommand)
.build() {};
__name(_StartMulticastGroupSessionCommand, "StartMulticastGroupSessionCommand");
var StartMulticastGroupSessionCommand = _StartMulticastGroupSessionCommand;
var _StartSingleWirelessDeviceImportTaskCommand = class _StartSingleWirelessDeviceImportTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "StartSingleWirelessDeviceImportTask", {})
.n("IoTWirelessClient", "StartSingleWirelessDeviceImportTaskCommand")
.f(void 0, void 0)
.ser(se_StartSingleWirelessDeviceImportTaskCommand)
.de(de_StartSingleWirelessDeviceImportTaskCommand)
.build() {};
__name(_StartSingleWirelessDeviceImportTaskCommand, "StartSingleWirelessDeviceImportTaskCommand");
var StartSingleWirelessDeviceImportTaskCommand = _StartSingleWirelessDeviceImportTaskCommand;
var _StartWirelessDeviceImportTaskCommand = class _StartWirelessDeviceImportTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "StartWirelessDeviceImportTask", {})
.n("IoTWirelessClient", "StartWirelessDeviceImportTaskCommand")
.f(void 0, void 0)
.ser(se_StartWirelessDeviceImportTaskCommand)
.de(de_StartWirelessDeviceImportTaskCommand)
.build() {};
__name(_StartWirelessDeviceImportTaskCommand, "StartWirelessDeviceImportTaskCommand");
var StartWirelessDeviceImportTaskCommand = _StartWirelessDeviceImportTaskCommand;
var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "TagResource", {})
.n("IoTWirelessClient", "TagResourceCommand")
.f(void 0, void 0)
.ser(se_TagResourceCommand)
.de(de_TagResourceCommand)
.build() {};
__name(_TagResourceCommand, "TagResourceCommand");
var TagResourceCommand = _TagResourceCommand;
var _TestWirelessDeviceCommand = class _TestWirelessDeviceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "TestWirelessDevice", {})
.n("IoTWirelessClient", "TestWirelessDeviceCommand")
.f(void 0, void 0)
.ser(se_TestWirelessDeviceCommand)
.de(de_TestWirelessDeviceCommand)
.build() {};
__name(_TestWirelessDeviceCommand, "TestWirelessDeviceCommand");
var TestWirelessDeviceCommand = _TestWirelessDeviceCommand;
var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UntagResource", {})
.n("IoTWirelessClient", "UntagResourceCommand")
.f(void 0, void 0)
.ser(se_UntagResourceCommand)
.de(de_UntagResourceCommand)
.build() {};
__name(_UntagResourceCommand, "UntagResourceCommand");
var UntagResourceCommand = _UntagResourceCommand;
var _UpdateDestinationCommand = class _UpdateDestinationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateDestination", {})
.n("IoTWirelessClient", "UpdateDestinationCommand")
.f(void 0, void 0)
.ser(se_UpdateDestinationCommand)
.de(de_UpdateDestinationCommand)
.build() {};
__name(_UpdateDestinationCommand, "UpdateDestinationCommand");
var UpdateDestinationCommand = _UpdateDestinationCommand;
var _UpdateEventConfigurationByResourceTypesCommand = class _UpdateEventConfigurationByResourceTypesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateEventConfigurationByResourceTypes", {})
.n("IoTWirelessClient", "UpdateEventConfigurationByResourceTypesCommand")
.f(void 0, void 0)
.ser(se_UpdateEventConfigurationByResourceTypesCommand)
.de(de_UpdateEventConfigurationByResourceTypesCommand)
.build() {};
__name(_UpdateEventConfigurationByResourceTypesCommand, "UpdateEventConfigurationByResourceTypesCommand");
var UpdateEventConfigurationByResourceTypesCommand = _UpdateEventConfigurationByResourceTypesCommand;
var _UpdateFuotaTaskCommand = class _UpdateFuotaTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateFuotaTask", {})
.n("IoTWirelessClient", "UpdateFuotaTaskCommand")
.f(void 0, void 0)
.ser(se_UpdateFuotaTaskCommand)
.de(de_UpdateFuotaTaskCommand)
.build() {};
__name(_UpdateFuotaTaskCommand, "UpdateFuotaTaskCommand");
var UpdateFuotaTaskCommand = _UpdateFuotaTaskCommand;
var _UpdateLogLevelsByResourceTypesCommand = class _UpdateLogLevelsByResourceTypesCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateLogLevelsByResourceTypes", {})
.n("IoTWirelessClient", "UpdateLogLevelsByResourceTypesCommand")
.f(void 0, void 0)
.ser(se_UpdateLogLevelsByResourceTypesCommand)
.de(de_UpdateLogLevelsByResourceTypesCommand)
.build() {};
__name(_UpdateLogLevelsByResourceTypesCommand, "UpdateLogLevelsByResourceTypesCommand");
var UpdateLogLevelsByResourceTypesCommand = _UpdateLogLevelsByResourceTypesCommand;
var _UpdateMetricConfigurationCommand = class _UpdateMetricConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateMetricConfiguration", {})
.n("IoTWirelessClient", "UpdateMetricConfigurationCommand")
.f(void 0, void 0)
.ser(se_UpdateMetricConfigurationCommand)
.de(de_UpdateMetricConfigurationCommand)
.build() {};
__name(_UpdateMetricConfigurationCommand, "UpdateMetricConfigurationCommand");
var UpdateMetricConfigurationCommand = _UpdateMetricConfigurationCommand;
var _UpdateMulticastGroupCommand = class _UpdateMulticastGroupCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateMulticastGroup", {})
.n("IoTWirelessClient", "UpdateMulticastGroupCommand")
.f(void 0, void 0)
.ser(se_UpdateMulticastGroupCommand)
.de(de_UpdateMulticastGroupCommand)
.build() {};
__name(_UpdateMulticastGroupCommand, "UpdateMulticastGroupCommand");
var UpdateMulticastGroupCommand = _UpdateMulticastGroupCommand;
var _UpdateNetworkAnalyzerConfigurationCommand = class _UpdateNetworkAnalyzerConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateNetworkAnalyzerConfiguration", {})
.n("IoTWirelessClient", "UpdateNetworkAnalyzerConfigurationCommand")
.f(void 0, void 0)
.ser(se_UpdateNetworkAnalyzerConfigurationCommand)
.de(de_UpdateNetworkAnalyzerConfigurationCommand)
.build() {};
__name(_UpdateNetworkAnalyzerConfigurationCommand, "UpdateNetworkAnalyzerConfigurationCommand");
var UpdateNetworkAnalyzerConfigurationCommand = _UpdateNetworkAnalyzerConfigurationCommand;
var _UpdatePartnerAccountCommand = class _UpdatePartnerAccountCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdatePartnerAccount", {})
.n("IoTWirelessClient", "UpdatePartnerAccountCommand")
.f(UpdatePartnerAccountRequestFilterSensitiveLog, void 0)
.ser(se_UpdatePartnerAccountCommand)
.de(de_UpdatePartnerAccountCommand)
.build() {};
__name(_UpdatePartnerAccountCommand, "UpdatePartnerAccountCommand");
var UpdatePartnerAccountCommand = _UpdatePartnerAccountCommand;
var _UpdatePositionCommand = class _UpdatePositionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdatePosition", {})
.n("IoTWirelessClient", "UpdatePositionCommand")
.f(void 0, void 0)
.ser(se_UpdatePositionCommand)
.de(de_UpdatePositionCommand)
.build() {};
__name(_UpdatePositionCommand, "UpdatePositionCommand");
var UpdatePositionCommand = _UpdatePositionCommand;
var _UpdateResourceEventConfigurationCommand = class _UpdateResourceEventConfigurationCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateResourceEventConfiguration", {})
.n("IoTWirelessClient", "UpdateResourceEventConfigurationCommand")
.f(void 0, void 0)
.ser(se_UpdateResourceEventConfigurationCommand)
.de(de_UpdateResourceEventConfigurationCommand)
.build() {};
__name(_UpdateResourceEventConfigurationCommand, "UpdateResourceEventConfigurationCommand");
var UpdateResourceEventConfigurationCommand = _UpdateResourceEventConfigurationCommand;
var _UpdateResourcePositionCommand = class _UpdateResourcePositionCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateResourcePosition", {})
.n("IoTWirelessClient", "UpdateResourcePositionCommand")
.f(void 0, void 0)
.ser(se_UpdateResourcePositionCommand)
.de(de_UpdateResourcePositionCommand)
.build() {};
__name(_UpdateResourcePositionCommand, "UpdateResourcePositionCommand");
var UpdateResourcePositionCommand = _UpdateResourcePositionCommand;
var _UpdateWirelessDeviceCommand = class _UpdateWirelessDeviceCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateWirelessDevice", {})
.n("IoTWirelessClient", "UpdateWirelessDeviceCommand")
.f(void 0, void 0)
.ser(se_UpdateWirelessDeviceCommand)
.de(de_UpdateWirelessDeviceCommand)
.build() {};
__name(_UpdateWirelessDeviceCommand, "UpdateWirelessDeviceCommand");
var UpdateWirelessDeviceCommand = _UpdateWirelessDeviceCommand;
var _UpdateWirelessDeviceImportTaskCommand = class _UpdateWirelessDeviceImportTaskCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateWirelessDeviceImportTask", {})
.n("IoTWirelessClient", "UpdateWirelessDeviceImportTaskCommand")
.f(void 0, void 0)
.ser(se_UpdateWirelessDeviceImportTaskCommand)
.de(de_UpdateWirelessDeviceImportTaskCommand)
.build() {};
__name(_UpdateWirelessDeviceImportTaskCommand, "UpdateWirelessDeviceImportTaskCommand");
var UpdateWirelessDeviceImportTaskCommand = _UpdateWirelessDeviceImportTaskCommand;
var _UpdateWirelessGatewayCommand = class _UpdateWirelessGatewayCommand extends import_smithy_client.Command.classBuilder()
.ep({
...commonParams,
})
.m(function (Command, cs, config, o) {
return [
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
];
})
.s("iotwireless", "UpdateWirelessGateway", {})
.n("IoTWirelessClient", "UpdateWirelessGatewayCommand")
.f(void 0, void 0)
.ser(se_UpdateWirelessGatewayCommand)
.de(de_UpdateWirelessGatewayCommand)
.build() {};
__name(_UpdateWirelessGatewayCommand, "UpdateWirelessGatewayCommand");
var UpdateWirelessGatewayCommand = _UpdateWirelessGatewayCommand;
var commands = {
AssociateAwsAccountWithPartnerAccountCommand,
AssociateMulticastGroupWithFuotaTaskCommand,
AssociateWirelessDeviceWithFuotaTaskCommand,
AssociateWirelessDeviceWithMulticastGroupCommand,
AssociateWirelessDeviceWithThingCommand,
AssociateWirelessGatewayWithCertificateCommand,
AssociateWirelessGatewayWithThingCommand,
CancelMulticastGroupSessionCommand,
CreateDestinationCommand,
CreateDeviceProfileCommand,
CreateFuotaTaskCommand,
CreateMulticastGroupCommand,
CreateNetworkAnalyzerConfigurationCommand,
CreateServiceProfileCommand,
CreateWirelessDeviceCommand,
CreateWirelessGatewayCommand,
CreateWirelessGatewayTaskCommand,
CreateWirelessGatewayTaskDefinitionCommand,
DeleteDestinationCommand,
DeleteDeviceProfileCommand,
DeleteFuotaTaskCommand,
DeleteMulticastGroupCommand,
DeleteNetworkAnalyzerConfigurationCommand,
DeleteQueuedMessagesCommand,
DeleteServiceProfileCommand,
DeleteWirelessDeviceCommand,
DeleteWirelessDeviceImportTaskCommand,
DeleteWirelessGatewayCommand,
DeleteWirelessGatewayTaskCommand,
DeleteWirelessGatewayTaskDefinitionCommand,
DeregisterWirelessDeviceCommand,
DisassociateAwsAccountFromPartnerAccountCommand,
DisassociateMulticastGroupFromFuotaTaskCommand,
DisassociateWirelessDeviceFromFuotaTaskCommand,
DisassociateWirelessDeviceFromMulticastGroupCommand,
DisassociateWirelessDeviceFromThingCommand,
DisassociateWirelessGatewayFromCertificateCommand,
DisassociateWirelessGatewayFromThingCommand,
GetDestinationCommand,
GetDeviceProfileCommand,
GetEventConfigurationByResourceTypesCommand,
GetFuotaTaskCommand,
GetLogLevelsByResourceTypesCommand,
GetMetricConfigurationCommand,
GetMetricsCommand,
GetMulticastGroupCommand,
GetMulticastGroupSessionCommand,
GetNetworkAnalyzerConfigurationCommand,
GetPartnerAccountCommand,
GetPositionCommand,
GetPositionConfigurationCommand,
GetPositionEstimateCommand: GetPositionEstimateCommand2,
GetResourceEventConfigurationCommand,
GetResourceLogLevelCommand,
GetResourcePositionCommand,
GetServiceEndpointCommand,
GetServiceProfileCommand,
GetWirelessDeviceCommand,
GetWirelessDeviceImportTaskCommand,
GetWirelessDeviceStatisticsCommand,
GetWirelessGatewayCommand,
GetWirelessGatewayCertificateCommand,
GetWirelessGatewayFirmwareInformationCommand,
GetWirelessGatewayStatisticsCommand,
GetWirelessGatewayTaskCommand,
GetWirelessGatewayTaskDefinitionCommand,
ListDestinationsCommand,
ListDeviceProfilesCommand,
ListDevicesForWirelessDeviceImportTaskCommand,
ListEventConfigurationsCommand,
ListFuotaTasksCommand,
ListMulticastGroupsCommand,
ListMulticastGroupsByFuotaTaskCommand,
ListNetworkAnalyzerConfigurationsCommand,
ListPartnerAccountsCommand,
ListPositionConfigurationsCommand,
ListQueuedMessagesCommand,
ListServiceProfilesCommand,
ListTagsForResourceCommand,
ListWirelessDeviceImportTasksCommand,
ListWirelessDevicesCommand,
ListWirelessGatewaysCommand,
ListWirelessGatewayTaskDefinitionsCommand,
PutPositionConfigurationCommand,
PutResourceLogLevelCommand,
ResetAllResourceLogLevelsCommand,
ResetResourceLogLevelCommand,
SendDataToMulticastGroupCommand,
SendDataToWirelessDeviceCommand,
StartBulkAssociateWirelessDeviceWithMulticastGroupCommand,
StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand,
StartFuotaTaskCommand,
StartMulticastGroupSessionCommand,
StartSingleWirelessDeviceImportTaskCommand,
StartWirelessDeviceImportTaskCommand,
TagResourceCommand,
TestWirelessDeviceCommand,
UntagResourceCommand,
UpdateDestinationCommand,
UpdateEventConfigurationByResourceTypesCommand,
UpdateFuotaTaskCommand,
UpdateLogLevelsByResourceTypesCommand,
UpdateMetricConfigurationCommand,
UpdateMulticastGroupCommand,
UpdateNetworkAnalyzerConfigurationCommand,
UpdatePartnerAccountCommand,
UpdatePositionCommand,
UpdateResourceEventConfigurationCommand,
UpdateResourcePositionCommand,
UpdateWirelessDeviceCommand,
UpdateWirelessDeviceImportTaskCommand,
UpdateWirelessGatewayCommand,
};
var _IoTWireless = class _IoTWireless extends IoTWirelessClient2 {};
__name(_IoTWireless, "IoTWireless");
var IoTWireless = _IoTWireless;
(0, import_smithy_client.createAggregatedClient)(commands, IoTWireless);
var paginateListDestinations = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListDestinationsCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListDeviceProfiles = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListDeviceProfilesCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListFuotaTasks = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListFuotaTasksCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListMulticastGroupsByFuotaTask = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListMulticastGroupsByFuotaTaskCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListMulticastGroups = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListMulticastGroupsCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListNetworkAnalyzerConfigurations = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListNetworkAnalyzerConfigurationsCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListPositionConfigurations = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListPositionConfigurationsCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListQueuedMessages = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListQueuedMessagesCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListServiceProfiles = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListServiceProfilesCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListWirelessDevices = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListWirelessDevicesCommand,
"NextToken",
"NextToken",
"MaxResults"
);
var paginateListWirelessGateways = (0, import_core.createPaginator)(
IoTWirelessClient2,
ListWirelessGatewaysCommand,
"NextToken",
"NextToken",
"MaxResults"
);
},
});
// analysis/analysis.ts
var analysis_exports = {};
__export(analysis_exports, {
_createAWSPayload: () => _createAWSPayload,
_createDataForDevice: () => _createDataForDevice,
_getConfiguration: () => _getConfiguration,
_getEstimatedLocation: () => _getEstimatedLocation,
});
module.exports = __toCommonJS(analysis_exports);
var import_client_iot_wireless = __toESM(require_dist_cjs55());
var import_sdk = require("@tago-io/sdk");
function _getEstimatedLocation(response) {
var _a;
if (!response) {
throw new Error("No response from AWS");
}
const estimatedLocation = JSON.parse(
((_a = response.GeoJsonPayload) == null ? void 0 : _a.transformToString()) ?? ""
);
if (!estimatedLocation) {
throw new Error("No estimated location found");
}
return estimatedLocation;
}
function _getConfiguration(context) {
var _a, _b, _c, _d;
const configuration = {
awsAccessKeyId: (_a = context.environment.find((x) => x.key === "AWS_ACCESSKEYID")) == null ? void 0 : _a.value,
awsSecretAccessKey:
(_b = context.environment.find((x) => x.key === "AWS_SECRETACCESSKEY")) == null ? void 0 : _b.value,
awsRegion: (_c = context.environment.find((x) => x.key === "AWS_REGION")) == null ? void 0 : _c.value,
desireableAccuracyPercent:
((_d = context.environment.find((x) => x.key === "DESIREABLE_ACCURACY_PERCENT")) == null ? void 0 : _d.value) ||
"0",
};
if (!configuration.awsRegion || !configuration.awsAccessKeyId || !configuration.awsSecretAccessKey) {
let missing = "";
if (!configuration.awsRegion) {
missing += "AWS_REGION ";
}
if (!configuration.awsAccessKeyId) {
missing += "AWS_ACCESSKEYID ";
}
if (!configuration.awsSecretAccessKey) {
missing += "AWS_SECRETACCESSKEY ";
}
throw new Error(missing + "not found in the environment variables");
}
if (
!parseFloat(configuration.desireableAccuracyPercent) &&
parseFloat(configuration.desireableAccuracyPercent) !== 0
) {
throw new Error("DESIREABLE_ACCURACY_PERCENT must be a numeric value");
}
return configuration;
}
function _createAWSPayload(gnssValue, ipAddress, wifiAddresses) {
if (!gnssValue && !ipAddress && !wifiAddresses) {
throw new Error("No data to create the payload");
}
let payload = { Timestamp: new Date() };
if (gnssValue) {
payload = { ...payload, Gnss: { Payload: gnssValue } };
}
if (ipAddress) {
payload = { ...payload, Ip: { IpAddress: ipAddress } };
}
if (wifiAddresses) {
if (Object.keys(wifiAddresses).length < 2) {
throw new Error("Wifi Addresses must have at least 2 addresses");
}
payload = {
...payload,
WiFiAccessPoints: [
{
MacAddress: Object.keys(wifiAddresses)[0],
Rss: Object.values(wifiAddresses)[0],
},
{
MacAddress: Object.keys(wifiAddresses)[1],
Rss: Object.values(wifiAddresses)[1],
},
],
};
}
return payload;
}
function _createDataForDevice(scope, desireableAccuracy, estimatedLocation) {
const lat = estimatedLocation.coordinates[1];
const lng = estimatedLocation.coordinates[0];
const horizontalAccuracy = estimatedLocation.properties.horizontalConfidenceLevel;
const verticalAccuracy = estimatedLocation.properties.verticalConfidenceLevel;
const accuracy =
horizontalAccuracy >= parseFloat(desireableAccuracy) || verticalAccuracy >= parseFloat(desireableAccuracy);
const dataReturn = {
variable: "estimated_location",
value: lat + ";" + lng,
location: {
lat,
lng,
},
metadata: {
horizontalAccuracy,
verticalAccuracy,
color: accuracy ? "green" : "red",
},
group: scope.group,
time: scope.time,
};
return dataReturn;
}
async function getEstimatedDeviceLocation(context, scope) {
var _a, _b, _c, _d, _e, _f, _g;
console.log("Starting Analysis");
let configuration;
try {
configuration = _getConfiguration(context);
} catch (error) {
console.error(error.message);
return;
}
const gnssSolverVariable =
((_a = context.environment.find((x) => x.key === "GNSS_SOLVER_VARIABLE")) == null ? void 0 : _a.value) ||
"gnss_solver";
const ipAddressVariable =
((_b = context.environment.find((x) => x.key === "IP_ADDRESS_VARIABLE")) == null ? void 0 : _b.value) ||
"ip_addresses";
const wifiAdressesVariable =
((_c = context.environment.find((x) => x.key === "WIFI_ADDRESSES_VARIABLE")) == null ? void 0 : _c.value) ||
"wifi_addresses";
const gnssValue = (_d = scope.find((x) => x.variable === gnssSolverVariable)) == null ? void 0 : _d.value;
const ipAddress =
(_f = (_e = scope.find((x) => x.variable === ipAddressVariable)) == null ? void 0 : _e.value) == null
? void 0
: _f.split(";");
const wifiAddresses = (_g = scope.find((x) => x.variable === wifiAdressesVariable)) == null ? void 0 : _g.metadata;
try {
const payload = _createAWSPayload(gnssValue, ipAddress[0], wifiAddresses);
const client = new import_client_iot_wireless.IoTWirelessClient({
credentials: {
accessKeyId: configuration.awsAccessKeyId,
secretAccessKey: configuration.awsSecretAccessKey,
},
region: configuration.awsRegion,
});
const command = new import_client_iot_wireless.GetPositionEstimateCommand(payload);
const response = await client.send(command);
const estimatedLocation = _getEstimatedLocation(response);
await import_sdk.Resources.devices.sendDeviceData(
scope[0].device,
_createDataForDevice(scope[0], configuration.desireableAccuracyPercent, estimatedLocation)
);
console.log("Analysis Finished");
} catch (error) {
console.error(error.message);
}
}
if (process.env.NODE_ENV !== "test") {
import_sdk.Analysis.use(getEstimatedDeviceLocation, {
token: process.env.T_ANALYSIS_TOKEN || "Your-Analysis-Token",
});
}
// Annotate the CommonJS export names for ESM import in node:
0 &&
(module.exports = {
_createAWSPayload,
_createDataForDevice,
_getConfiguration,
_getEstimatedLocation,
});