diff --git a/.github/spot-runner-action/dist/index.js b/.github/spot-runner-action/dist/index.js index 7f72f808e4f..422a423df1d 100644 --- a/.github/spot-runner-action/dist/index.js +++ b/.github/spot-runner-action/dist/index.js @@ -281,8 +281,8 @@ class Ec2Instance { Ebs: { VolumeSize: 64, VolumeType: 'gp3', - Throughput: 250, - Iops: 3000 + Throughput: 1000, + Iops: 5000 }, }, ], @@ -1578,7 +1578,7 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__nccwpck_require__(57147)); const os = __importStar(__nccwpck_require__(22037)); -const uuid_1 = __nccwpck_require__(75840); +const uuid_1 = __nccwpck_require__(78974); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -2098,2296 +2098,1841 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 74087: +/***/ 78974: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Context = void 0; -const fs_1 = __nccwpck_require__(57147); -const os_1 = __nccwpck_require__(22037); -class Context { - /** - * Hydrate the context from the environment - */ - constructor() { - var _a, _b, _c; - this.payload = {}; - if (process.env.GITHUB_EVENT_PATH) { - if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { - this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); - } - else { - const path = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); - } - } - this.eventName = process.env.GITHUB_EVENT_NAME; - this.sha = process.env.GITHUB_SHA; - this.ref = process.env.GITHUB_REF; - this.workflow = process.env.GITHUB_WORKFLOW; - this.action = process.env.GITHUB_ACTION; - this.actor = process.env.GITHUB_ACTOR; - this.job = process.env.GITHUB_JOB; - this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); - this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; - this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; - this.graphqlUrl = - (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; - } - get issue() { - const payload = this.payload; - return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); - } - get repo() { - if (process.env.GITHUB_REPOSITORY) { - const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); - return { owner, repo }; - } - if (this.payload.repository) { - return { - owner: this.payload.repository.owner.login, - repo: this.payload.repository.name - }; - } - throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); - } -} -exports.Context = Context; -//# sourceMappingURL=context.js.map + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "v1", ({ + enumerable: true, + get: function () { + return _v.default; + } +})); +Object.defineProperty(exports, "v3", ({ + enumerable: true, + get: function () { + return _v2.default; + } +})); +Object.defineProperty(exports, "v4", ({ + enumerable: true, + get: function () { + return _v3.default; + } +})); +Object.defineProperty(exports, "v5", ({ + enumerable: true, + get: function () { + return _v4.default; + } +})); +Object.defineProperty(exports, "NIL", ({ + enumerable: true, + get: function () { + return _nil.default; + } +})); +Object.defineProperty(exports, "version", ({ + enumerable: true, + get: function () { + return _version.default; + } +})); +Object.defineProperty(exports, "validate", ({ + enumerable: true, + get: function () { + return _validate.default; + } +})); +Object.defineProperty(exports, "stringify", ({ + enumerable: true, + get: function () { + return _stringify.default; + } +})); +Object.defineProperty(exports, "parse", ({ + enumerable: true, + get: function () { + return _parse.default; + } +})); + +var _v = _interopRequireDefault(__nccwpck_require__(81595)); + +var _v2 = _interopRequireDefault(__nccwpck_require__(26993)); + +var _v3 = _interopRequireDefault(__nccwpck_require__(51472)); + +var _v4 = _interopRequireDefault(__nccwpck_require__(16217)); + +var _nil = _interopRequireDefault(__nccwpck_require__(32381)); + +var _version = _interopRequireDefault(__nccwpck_require__(40427)); + +var _validate = _interopRequireDefault(__nccwpck_require__(92609)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(61458)); + +var _parse = _interopRequireDefault(__nccwpck_require__(26385)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 95438: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 5842: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOctokit = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(74087)); -const utils_1 = __nccwpck_require__(73030); -exports.context = new Context.Context(); -/** - * Returns a hydrated octokit ready to use for GitHub Actions - * - * @param token the repo PAT or GITHUB_TOKEN - * @param options other options to set - */ -function getOctokit(token, options, ...additionalPlugins) { - const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins); - return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options)); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +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(); } -exports.getOctokit = getOctokit; -//# sourceMappingURL=github.js.map + +var _default = md5; +exports["default"] = _default; /***/ }), -/***/ 47914: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 32381: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (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()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__nccwpck_require__(96255)); -const undici_1 = __nccwpck_require__(41773); -function getAuthString(token, options) { - if (!token && !options.auth) { - throw new Error('Parameter token or opts.auth is required'); - } - else if (token && options.auth) { - throw new Error('Parameters token and opts.auth may not both be specified'); - } - return typeof options.auth === 'string' ? options.auth : `token ${token}`; -} -exports.getAuthString = getAuthString; -function getProxyAgent(destinationUrl) { - const hc = new httpClient.HttpClient(); - return hc.getAgent(destinationUrl); -} -exports.getProxyAgent = getProxyAgent; -function getProxyAgentDispatcher(destinationUrl) { - const hc = new httpClient.HttpClient(); - return hc.getAgentDispatcher(destinationUrl); -} -exports.getProxyAgentDispatcher = getProxyAgentDispatcher; -function getProxyFetch(destinationUrl) { - const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () { - return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); - }); - return proxyFetch; -} -exports.getProxyFetch = getProxyFetch; -function getApiBaseUrl() { - return process.env['GITHUB_API_URL'] || 'https://api.github.com'; -} -exports.getApiBaseUrl = getApiBaseUrl; -//# sourceMappingURL=utils.js.map +exports["default"] = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports["default"] = _default; /***/ }), -/***/ 73030: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 26385: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(74087)); -const Utils = __importStar(__nccwpck_require__(47914)); -// octokit + plugins -const core_1 = __nccwpck_require__(76762); -const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044); -const plugin_paginate_rest_1 = __nccwpck_require__(64193); -exports.context = new Context.Context(); -const baseUrl = Utils.getApiBaseUrl(); -exports.defaults = { - baseUrl, - request: { - agent: Utils.getProxyAgent(baseUrl), - fetch: Utils.getProxyFetch(baseUrl) - } -}; -exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults); -/** - * Convience function to correctly format Octokit Options to pass into the constructor. - * - * @param token the repo PAT or GITHUB_TOKEN - * @param options other options to set - */ -function getOctokitOptions(token, options) { - const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller - // Auth - const auth = Utils.getAuthString(token, opts); - if (auth) { - opts.auth = auth; - } - return opts; +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(92609)); + +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); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; } -exports.getOctokitOptions = getOctokitOptions; -//# sourceMappingURL=utils.js.map + +var _default = parse; +exports["default"] = _default; /***/ }), -/***/ 35526: -/***/ (function(__unused_webpack_module, exports) { +/***/ 86230: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (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()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; -class BasicCredentialHandler { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); - } - options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); - } -} -exports.BasicCredentialHandler = BasicCredentialHandler; -class BearerCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); - } - options.headers['Authorization'] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); - } -} -exports.BearerCredentialHandler = BearerCredentialHandler; -class PersonalAccessTokenCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); - } - options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); - } + +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; + +/***/ }), + +/***/ 9784: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = rng; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + +let poolPtr = rnds8Pool.length; + +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); } -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; -//# sourceMappingURL=auth.js.map /***/ }), -/***/ 96255: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 38844: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; + +Object.defineProperty(exports, "__esModule", ({ + value: true })); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (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()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(13685)); -const https = __importStar(__nccwpck_require__(95687)); -const pm = __importStar(__nccwpck_require__(19835)); -const tunnel = __importStar(__nccwpck_require__(74294)); -const undici_1 = __nccwpck_require__(41773); -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); -var Headers; -(function (Headers) { - Headers["Accept"] = "accept"; - Headers["ContentType"] = "content-type"; -})(Headers || (exports.Headers = Headers = {})); -var MediaTypes; -(function (MediaTypes) { - MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes || (exports.MediaTypes = MediaTypes = {})); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +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; + +/***/ }), + +/***/ 61458: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(92609)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** - * Returns the proxy URL, depending upon the supplied url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ -function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ''; +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); } -exports.getProxyUrl = getProxyUrl; -const HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -const HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = 'HttpClientError'; - this.statusCode = statusCode; - Object.setPrototypeOf(this, HttpClientError.prototype); - } + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (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]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; } -exports.HttpClientError = HttpClientError; -class HttpClientResponse { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { - let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on('end', () => { - resolve(output.toString()); - }); - })); - }); + +var _default = stringify; +exports["default"] = _default; + +/***/ }), + +/***/ 81595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(9784)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(61458)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +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 !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; } - readBodyBuffer() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { - const chunks = []; - this.message.on('data', (chunk) => { - chunks.push(chunk); - }); - this.message.on('end', () => { - resolve(Buffer.concat(chunks)); - }); - })); - }); + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.default)(b); } -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === 'https:'; + +var _default = v1; +exports["default"] = _default; + +/***/ }), + +/***/ 26993: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(65920)); + +var _md = _interopRequireDefault(__nccwpck_require__(5842)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports["default"] = _default; + +/***/ }), + +/***/ 65920: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = _default; +exports.URL = exports.DNS = void 0; + +var _stringify = _interopRequireDefault(__nccwpck_require__(61458)); + +var _parse = _interopRequireDefault(__nccwpck_require__(26385)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; } -exports.isHttps = isHttps; -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; - } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; - } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - }); + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error('Client has already been disposed.'); - } - const parsedUrl = new URL(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) - ? this._maxRetries + 1 - : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && - HttpRedirectCodes.includes(response.message.statusCode) && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === 'https:' && - parsedUrl.protocol !== parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - yield response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } - } - } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info, data); - redirectsRemaining--; - } - if (!response.message.statusCode || - !HttpResponseRetryCodes.includes(response.message.statusCode)) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } - else if (!res) { - // If `err` is not passed, then `res` must be passed. - reject(new Error('Unknown error')); - } - else { - resolve(res); - } - } - this.requestRawWithCallback(info, data, callbackForResult); - }); - }); + + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} + +/***/ }), + +/***/ 51472: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(9784)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(61458)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function v4(options, buf, offset) { + options = options || {}; + + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; } + + return buf; + } + + return (0, _stringify.default)(rnds); +} + +var _default = v4; +exports["default"] = _default; + +/***/ }), + +/***/ 16217: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(65920)); + +var _sha = _interopRequireDefault(__nccwpck_require__(38844)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v5 = (0, _v.default)('v5', 0x50, _sha.default); +var _default = v5; +exports["default"] = _default; + +/***/ }), + +/***/ 92609: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _regex = _interopRequireDefault(__nccwpck_require__(86230)); + +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; + +/***/ }), + +/***/ 40427: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(92609)); + +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.substr(14, 1), 16); +} + +var _default = version; +exports["default"] = _default; + +/***/ }), + +/***/ 74087: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Context = void 0; +const fs_1 = __nccwpck_require__(57147); +const os_1 = __nccwpck_require__(22037); +class Context { /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * Hydrate the context from the environment */ - requestRawWithCallback(info, data, onResult) { - if (typeof data === 'string') { - if (!info.options.headers) { - info.options.headers = {}; - } - info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info.httpModule.request(info.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(undefined, res); - }); - let socket; - req.on('socket', sock => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.end(); + constructor() { + var _a, _b, _c; + this.payload = {}; + if (process.env.GITHUB_EVENT_PATH) { + if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { + this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' })); } - handleResult(new Error(`Request timeout: ${info.options.path}`)); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err); - }); - if (data && typeof data === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof data !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - getAgentDispatcher(serverUrl) { - const parsedUrl = new URL(serverUrl); - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (!useProxy) { - return; - } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port - ? parseInt(info.parsedUrl.port) - : defaultPort; - info.options.path = - (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers['user-agent'] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info.options); + else { + const path = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`); } } - return info; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + this.eventName = process.env.GITHUB_EVENT_NAME; + this.sha = process.env.GITHUB_SHA; + this.ref = process.env.GITHUB_REF; + this.workflow = process.env.GITHUB_WORKFLOW; + this.action = process.env.GITHUB_ACTION; + this.actor = process.env.GITHUB_ACTOR; + this.job = process.env.GITHUB_JOB; + this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); + this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); + this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; + this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; + this.graphqlUrl = + (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; + get issue() { + const payload = this.payload; + return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + get repo() { + if (process.env.GITHUB_REPOSITORY) { + const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); + return { owner, repo }; } - // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - })), { host: proxyUrl.hostname, port: proxyUrl.port }) + if (this.payload.repository) { + return { + owner: this.payload.repository.owner.login, + repo: this.payload.repository.name }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - // if agent is already assigned use that agent. - if (proxyAgent) { - return proxyAgent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { - token: `${proxyUrl.username}:${proxyUrl.password}` - }))); - this._proxyAgentDispatcher = proxyAgent; - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { - rejectUnauthorized: false - }); } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode === HttpCodes.NotFound) { - resolve(response); - } - // get the result from the body - function dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } - catch (err) { - // Invalid resource (contents not json); leaving result obj null - } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; - } - else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } - else { - resolve(response); - } - })); - }); + throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); } } -exports.HttpClient = HttpClient; -const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); -//# sourceMappingURL=index.js.map +exports.Context = Context; +//# sourceMappingURL=context.js.map /***/ }), -/***/ 19835: -/***/ ((__unused_webpack_module, exports) => { - +/***/ 95438: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.checkBypass = exports.getProxyUrl = void 0; -function getProxyUrl(reqUrl) { - const usingSsl = reqUrl.protocol === 'https:'; - if (checkBypass(reqUrl)) { - return undefined; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env['https_proxy'] || process.env['HTTPS_PROXY']; - } - else { - return process.env['http_proxy'] || process.env['HTTP_PROXY']; - } - })(); - if (proxyVar) { - try { - return new URL(proxyVar); - } - catch (_a) { - if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) - return new URL(`http://${proxyVar}`); - } - } - else { - return undefined; - } -} -exports.getProxyUrl = getProxyUrl; -function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; - if (!noProxy) { - return false; - } - // Determine the request port - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } - else if (reqUrl.protocol === 'http:') { - reqPort = 80; - } - else if (reqUrl.protocol === 'https:') { - reqPort = 443; - } - // Format the request hostname and hostname with port - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === 'number') { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - // Compare request host against noproxy - for (const upperNoProxyItem of noProxy - .split(',') - .map(x => x.trim().toUpperCase()) - .filter(x => x)) { - if (upperNoProxyItem === '*' || - upperReqHosts.some(x => x === upperNoProxyItem || - x.endsWith(`.${upperNoProxyItem}`) || - (upperNoProxyItem.startsWith('.') && - x.endsWith(`${upperNoProxyItem}`)))) { - return true; - } +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - return false; -} -exports.checkBypass = checkBypass; -function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return (hostLower === 'localhost' || - hostLower.startsWith('127.') || - hostLower.startsWith('[::1]') || - hostLower.startsWith('[0:0:0:0:0:0:0:1]')); + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getOctokit = exports.context = void 0; +const Context = __importStar(__nccwpck_require__(74087)); +const utils_1 = __nccwpck_require__(73030); +exports.context = new Context.Context(); +/** + * Returns a hydrated octokit ready to use for GitHub Actions + * + * @param token the repo PAT or GITHUB_TOKEN + * @param options other options to set + */ +function getOctokit(token, options, ...additionalPlugins) { + const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins); + return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options)); } -//# sourceMappingURL=proxy.js.map +exports.getOctokit = getOctokit; +//# sourceMappingURL=github.js.map /***/ }), -/***/ 40334: -/***/ ((module) => { +/***/ 47914: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let 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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (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()); + }); }; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - createTokenAuth: () => createTokenAuth -}); -module.exports = __toCommonJS(dist_src_exports); - -// pkg/dist-src/auth.js -var REGEX_IS_INSTALLATION_LEGACY = /^v1\./; -var REGEX_IS_INSTALLATION = /^ghs_/; -var REGEX_IS_USER_TO_SERVER = /^ghu_/; -async function auth(token) { - const isApp = token.split(/\./).length === 3; - const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); - const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); - const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; - return { - type: "token", - token, - tokenType - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0; +const httpClient = __importStar(__nccwpck_require__(96255)); +const undici_1 = __nccwpck_require__(41773); +function getAuthString(token, options) { + if (!token && !options.auth) { + throw new Error('Parameter token or opts.auth is required'); + } + else if (token && options.auth) { + throw new Error('Parameters token and opts.auth may not both be specified'); + } + return typeof options.auth === 'string' ? options.auth : `token ${token}`; } - -// pkg/dist-src/with-authorization-prefix.js -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - return `token ${token}`; +exports.getAuthString = getAuthString; +function getProxyAgent(destinationUrl) { + const hc = new httpClient.HttpClient(); + return hc.getAgent(destinationUrl); } - -// pkg/dist-src/hook.js -async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge( - route, - parameters - ); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); +exports.getProxyAgent = getProxyAgent; +function getProxyAgentDispatcher(destinationUrl) { + const hc = new httpClient.HttpClient(); + return hc.getAgentDispatcher(destinationUrl); } - -// pkg/dist-src/index.js -var createTokenAuth = function createTokenAuth2(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } - if (typeof token !== "string") { - throw new Error( - "[@octokit/auth-token] Token passed to createTokenAuth is not a string" - ); - } - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - +exports.getProxyAgentDispatcher = getProxyAgentDispatcher; +function getProxyFetch(destinationUrl) { + const httpDispatcher = getProxyAgentDispatcher(destinationUrl); + const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () { + return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); + }); + return proxyFetch; +} +exports.getProxyFetch = getProxyFetch; +function getApiBaseUrl() { + return process.env['GITHUB_API_URL'] || 'https://api.github.com'; +} +exports.getApiBaseUrl = getApiBaseUrl; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 76762: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 73030: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; }; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let 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; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0; +const Context = __importStar(__nccwpck_require__(74087)); +const Utils = __importStar(__nccwpck_require__(47914)); +// octokit + plugins +const core_1 = __nccwpck_require__(76762); +const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044); +const plugin_paginate_rest_1 = __nccwpck_require__(64193); +exports.context = new Context.Context(); +const baseUrl = Utils.getApiBaseUrl(); +exports.defaults = { + baseUrl, + request: { + agent: Utils.getProxyAgent(baseUrl), + fetch: Utils.getProxyFetch(baseUrl) + } }; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults); +/** + * Convience function to correctly format Octokit Options to pass into the constructor. + * + * @param token the repo PAT or GITHUB_TOKEN + * @param options other options to set + */ +function getOctokitOptions(token, options) { + const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller + // Auth + const auth = Utils.getAuthString(token, opts); + if (auth) { + opts.auth = auth; + } + return opts; +} +exports.getOctokitOptions = getOctokitOptions; +//# sourceMappingURL=utils.js.map -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - Octokit: () => Octokit -}); -module.exports = __toCommonJS(dist_src_exports); -var import_universal_user_agent = __nccwpck_require__(45030); -var import_before_after_hook = __nccwpck_require__(83682); -var import_request = __nccwpck_require__(36234); -var import_graphql = __nccwpck_require__(88467); -var import_auth_token = __nccwpck_require__(40334); +/***/ }), -// pkg/dist-src/version.js -var VERSION = "5.0.2"; +/***/ 35526: +/***/ (function(__unused_webpack_module, exports) { -// pkg/dist-src/index.js -var noop = () => { +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (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()); + }); }; -var consoleWarn = console.warn.bind(console); -var consoleError = console.error.bind(console); -var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; -var Octokit = class { - static { - this.VERSION = VERSION; - } - static defaults(defaults) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - if (typeof defaults === "function") { - super(defaults(options)); - return; - } - super( - Object.assign( - {}, - defaults, - options, - options.userAgent && defaults.userAgent ? { - userAgent: `${options.userAgent} ${defaults.userAgent}` - } : null - ) - ); - } - }; - return OctokitWithDefaults; - } - static { - this.plugins = []; - } - /** - * Attach a plugin (or many) to your Octokit instance. - * - * @example - * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) - */ - static plugin(...newPlugins) { - const currentPlugins = this.plugins; - const NewOctokit = class extends this { - static { - this.plugins = currentPlugins.concat( - newPlugins.filter((plugin) => !currentPlugins.includes(plugin)) - ); - } - }; - return NewOctokit; - } - constructor(options = {}) { - const hook = new import_before_after_hook.Collection(); - const requestDefaults = { - baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - // @ts-ignore internal usage only, no need to type - hook: hook.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; - requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail; - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; } - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; } - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - this.request = import_request.request.defaults(requestDefaults); - this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults); - this.log = Object.assign( - { - debug: noop, - info: noop, - warn: consoleWarn, - error: consoleError - }, - options.log - ); - this.hook = hook; - if (!options.authStrategy) { - if (!options.auth) { - this.auth = async () => ({ - type: "unauthenticated" + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); }); - } else { - const auth = (0, import_auth_token.createTokenAuth)(options.auth); - hook.wrap("request", auth.hook); - this.auth = auth; - } - } else { - const { authStrategy, ...otherOptions } = options; - const auth = authStrategy( - Object.assign( - { - request: this.request, - log: this.log, - // we pass the current octokit instance as well as its constructor options - // to allow for authentication strategies that return a new octokit instance - // that shares the same internal state as the current one. The original - // requirement for this was the "event-octokit" authentication strategy - // of https://github.com/probot/octokit-auth-probot. - octokit: this, - octokitOptions: otherOptions - }, - options.auth - ) - ); - hook.wrap("request", auth.hook); - this.auth = auth; } - const classConstructor = this.constructor; - for (let i = 0; i < classConstructor.plugins.length; ++i) { - Object.assign(this, classConstructor.plugins[i](this, options)); +} +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; } - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), - -/***/ 59440: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - endpoint: () => endpoint -}); -module.exports = __toCommonJS(dist_src_exports); - -// pkg/dist-src/defaults.js -var import_universal_user_agent = __nccwpck_require__(45030); - -// pkg/dist-src/version.js -var VERSION = "9.0.4"; - -// pkg/dist-src/defaults.js -var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; -var DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "" - } -}; - -// pkg/dist-src/util/lowercase-keys.js -function lowercaseKeys(object) { - if (!object) { - return {}; - } - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[key]; - return newObj; - }, {}); -} - -// pkg/dist-src/util/is-plain-object.js -function isPlainObject(value) { - if (typeof value !== "object" || value === null) - return false; - if (Object.prototype.toString.call(value) !== "[object Object]") - return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); -} - -// pkg/dist-src/util/merge-deep.js -function mergeDeep(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach((key) => { - if (isPlainObject(options[key])) { - if (!(key in defaults)) - Object.assign(result, { [key]: options[key] }); - else - result[key] = mergeDeep(defaults[key], options[key]); - } else { - Object.assign(result, { [key]: options[key] }); + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Bearer ${this.token}`; } - }); - return result; -} - -// pkg/dist-src/util/remove-undefined-properties.js -function removeUndefinedProperties(obj) { - for (const key in obj) { - if (obj[key] === void 0) { - delete obj[key]; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } - return obj; -} - -// pkg/dist-src/merge.js -function merge(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { method, url } : { url: method }, options); - } else { - options = Object.assign({}, route); - } - options.headers = lowercaseKeys(options.headers); - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); - if (options.url === "/graphql") { - if (defaults && defaults.mediaType.previews?.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter( - (preview) => !mergedOptions.mediaType.previews.includes(preview) - ).concat(mergedOptions.mediaType.previews); + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); } - mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); - } - return mergedOptions; } - -// pkg/dist-src/util/add-query-parameters.js -function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url; - } - return url + separator + names.map((name) => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); } +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +//# sourceMappingURL=auth.js.map -// pkg/dist-src/util/extract-url-variable-names.js -var urlVariableRegex = /\{[^}]+\}/g; -function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); -} -function extractUrlVariableNames(url) { - const matches = url.match(urlVariableRegex); - if (!matches) { - return []; - } - return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); -} +/***/ }), -// pkg/dist-src/util/omit.js -function omit(object, keysToOmit) { - const result = { __proto__: null }; - for (const key of Object.keys(object)) { - if (keysToOmit.indexOf(key) === -1) { - result[key] = object[key]; - } - } - return result; -} +/***/ 96255: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -// pkg/dist-src/util/url-template.js -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - return part; - }).join(""); -} -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (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()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; +const http = __importStar(__nccwpck_require__(13685)); +const https = __importStar(__nccwpck_require__(95687)); +const pm = __importStar(__nccwpck_require__(19835)); +const tunnel = __importStar(__nccwpck_require__(74294)); +const undici_1 = __nccwpck_require__(41773); +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers || (exports.Headers = Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes || (exports.MediaTypes = MediaTypes = {})); +/** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ +function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; } -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } } -function isDefined(value) { - return value !== void 0 && value !== null; +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } } -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; } -function getValues(context, operator, key, modifier) { - var value = context[key], result = []; - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } - result.push( - encodeValue(operator, value, isKeyOperator(operator) ? key : "") - ); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { - result.push( - encodeValue(operator, value2, isKeyOperator(operator) ? key : "") - ); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - }); - } - } else { - const tmp = []; - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { - tmp.push(encodeValue(operator, value2)); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; } - }); - } - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); } - } } - } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); } - } - return result; -} -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; -} -function expand(template, context) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - template = template.replace( - /\{([^\{\}]+)\}|([^\{\}]+)/g, - function(_, expression, literal) { - if (expression) { - let operator = ""; - const values = []; - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } - expression.split(/,/g).forEach(function(variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); }); - if (operator && operator !== "+") { - var separator = ","; - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); - } } - ); - if (template === "/") { - return template; - } else { - return template.replace(/\/$/, ""); - } -} - -// pkg/dist-src/parse.js -function parse(options) { - let method = options.method.toUpperCase(); - let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit(options, [ - "method", - "baseUrl", - "url", - "headers", - "request", - "mediaType" - ]); - const urlVariableNames = extractUrlVariableNames(url); - url = parseUrl(url).expand(parameters); - if (!/^http/.test(url)) { - url = options.baseUrl + url; - } - const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit(parameters, omittedParameters); - const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); - if (!isBinaryRequest) { - if (options.mediaType.format) { - headers.accept = headers.accept.split(/,/).map( - (format) => format.replace( - /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, - `application/vnd$1$2.${options.mediaType.format}` - ) - ).join(","); + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); } - if (url.endsWith("/graphql")) { - if (options.mediaType.previews?.length) { - const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; - headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); } - } - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); } - } - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } - return Object.assign( - { method, url, headers }, - typeof body !== "undefined" ? { body } : null, - options.request ? { request: options.request } : null - ); -} - -// pkg/dist-src/endpoint-with-defaults.js -function endpointWithDefaults(defaults, route, options) { - return parse(merge(defaults, route, options)); -} - -// pkg/dist-src/with-defaults.js -function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS2 = merge(oldDefaults, newDefaults); - const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); - return Object.assign(endpoint2, { - DEFAULTS: DEFAULTS2, - defaults: withDefaults.bind(null, DEFAULTS2), - merge: merge.bind(null, DEFAULTS2), - parse - }); -} - -// pkg/dist-src/index.js -var endpoint = withDefaults(null, DEFAULTS); -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), - -/***/ 88467: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - GraphqlResponseError: () => GraphqlResponseError, - graphql: () => graphql2, - withCustomRequest: () => withCustomRequest -}); -module.exports = __toCommonJS(dist_src_exports); -var import_request3 = __nccwpck_require__(36234); -var import_universal_user_agent = __nccwpck_require__(45030); - -// pkg/dist-src/version.js -var VERSION = "7.0.2"; - -// pkg/dist-src/with-defaults.js -var import_request2 = __nccwpck_require__(36234); - -// pkg/dist-src/graphql.js -var import_request = __nccwpck_require__(36234); - -// pkg/dist-src/error.js -function _buildMessageForResponseErrors(data) { - return `Request failed due to following response errors: -` + data.errors.map((e) => ` - ${e.message}`).join("\n"); -} -var GraphqlResponseError = class extends Error { - constructor(request2, headers, response) { - super(_buildMessageForResponseErrors(response)); - this.request = request2; - this.headers = headers; - this.response = response; - this.name = "GraphqlResponseError"; - this.errors = response.errors; - this.data = response.data; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); } - } -}; - -// pkg/dist-src/graphql.js -var NON_VARIABLE_OPTIONS = [ - "method", - "baseUrl", - "url", - "headers", - "request", - "query", - "mediaType" -]; -var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; -var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(request2, query, options) { - if (options) { - if (typeof query === "string" && "query" in options) { - return Promise.reject( - new Error(`[@octokit/graphql] "query" cannot be used as variable name`) - ); + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); } - for (const key in options) { - if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) - continue; - return Promise.reject( - new Error( - `[@octokit/graphql] "${key}" cannot be used as variable name` - ) - ); + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - } - const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; - const requestOptions = Object.keys( - parsedOptions - ).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS.includes(key)) { - result[key] = parsedOptions[key]; - return result; + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } - if (!result.variables) { - result.variables = {}; + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } - result.variables[key] = parsedOptions[key]; - return result; - }, {}); - const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl; - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); - } - return request2(requestOptions).then((response) => { - if (response.data.errors) { - const headers = {}; - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - throw new GraphqlResponseError( - requestOptions, - headers, - response.data - ); + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } - return response.data.data; - }); -} - -// pkg/dist-src/with-defaults.js -function withDefaults(request2, newDefaults) { - const newRequest = request2.defaults(newDefaults); - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; - return Object.assign(newApi, { - defaults: withDefaults.bind(null, newRequest), - endpoint: newRequest.endpoint - }); -} - -// pkg/dist-src/index.js -var graphql2 = withDefaults(import_request3.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` - }, - method: "POST", - url: "/graphql" -}); -function withCustomRequest(customRequest) { - return withDefaults(customRequest, { - method: "POST", - url: "/graphql" - }); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), - -/***/ 64193: -/***/ ((module) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - composePaginateRest: () => composePaginateRest, - isPaginatingEndpoint: () => isPaginatingEndpoint, - paginateRest: () => paginateRest, - paginatingEndpoints: () => paginatingEndpoints -}); -module.exports = __toCommonJS(dist_src_exports); - -// pkg/dist-src/version.js -var VERSION = "9.1.5"; - -// pkg/dist-src/normalize-paginated-list-response.js -function normalizePaginatedListResponse(response) { - if (!response.data) { - return { - ...response, - data: [] - }; - } - const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); - if (!responseNeedsNormalization) - return response; - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } - response.data.total_count = totalCount; - return response; -} - -// pkg/dist-src/iterator.js -function iterator(octokit, route, parameters) { - const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); - const requestMethod = typeof route === "function" ? route : octokit.request; - const method = options.method; - const headers = options.headers; - let url = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url) - return { done: true }; - try { - const response = await requestMethod({ method, url, headers }); - const normalizedResponse = normalizePaginatedListResponse(response); - url = ((normalizedResponse.headers.link || "").match( - /<([^>]+)>;\s*rel="next"/ - ) || [])[1]; - return { value: normalizedResponse }; - } catch (error) { - if (error.status !== 409) - throw error; - url = ""; - return { - value: { - status: 200, - headers: {}, - data: [] + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); } - }; + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === 'https:' && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode)) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } - } - }) - }; -} - -// pkg/dist-src/paginate.js -function paginate(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = void 0; - } - return gather( - octokit, - [], - iterator(octokit, route, parameters)[Symbol.asyncIterator](), - mapFn - ); -} -function gather(octokit, results, iterator2, mapFn) { - return iterator2.next().then((result) => { - if (result.done) { - return results; + this._disposed = true; } - let earlyExit = false; - function done() { - earlyExit = true; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } + else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error('Unknown error')); + } + else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); } - results = results.concat( - mapFn ? mapFn(result.value, done) : result.value.data - ); - if (earlyExit) { - return results; + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; + } + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(undefined, res); + }); + let socket; + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info.options.path}`)); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; + } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info.options); + } + } + return info; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (!useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + })), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if tunneling agent isn't assigned create a new agent + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; + } + // if agent is already assigned use that agent. + if (proxyAgent) { + return proxyAgent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { + token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` + }))); + this._proxyAgentDispatcher = proxyAgent; + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + // get the result from the body + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } + else { + resolve(response); + } + })); + }); } - return gather(octokit, results, iterator2, mapFn); - }); } +exports.HttpClient = HttpClient; +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); +//# sourceMappingURL=index.js.map -// pkg/dist-src/compose-paginate.js -var composePaginateRest = Object.assign(paginate, { - iterator -}); +/***/ }), -// pkg/dist-src/generated/paginating-endpoints.js -var paginatingEndpoints = [ - "GET /advisories", - "GET /app/hook/deliveries", - "GET /app/installation-requests", - "GET /app/installations", - "GET /assignments/{assignment_id}/accepted_assignments", - "GET /classrooms", - "GET /classrooms/{classroom_id}/assignments", - "GET /enterprises/{enterprise}/dependabot/alerts", - "GET /enterprises/{enterprise}/secret-scanning/alerts", - "GET /events", - "GET /gists", - "GET /gists/public", - "GET /gists/starred", - "GET /gists/{gist_id}/comments", - "GET /gists/{gist_id}/commits", - "GET /gists/{gist_id}/forks", - "GET /installation/repositories", - "GET /issues", - "GET /licenses", - "GET /marketplace_listing/plans", - "GET /marketplace_listing/plans/{plan_id}/accounts", - "GET /marketplace_listing/stubbed/plans", - "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", - "GET /networks/{owner}/{repo}/events", - "GET /notifications", - "GET /organizations", - "GET /orgs/{org}/actions/cache/usage-by-repository", - "GET /orgs/{org}/actions/permissions/repositories", - "GET /orgs/{org}/actions/runners", - "GET /orgs/{org}/actions/secrets", - "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", - "GET /orgs/{org}/actions/variables", - "GET /orgs/{org}/actions/variables/{name}/repositories", - "GET /orgs/{org}/blocks", - "GET /orgs/{org}/code-scanning/alerts", - "GET /orgs/{org}/codespaces", - "GET /orgs/{org}/codespaces/secrets", - "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories", - "GET /orgs/{org}/copilot/billing/seats", - "GET /orgs/{org}/dependabot/alerts", - "GET /orgs/{org}/dependabot/secrets", - "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", - "GET /orgs/{org}/events", - "GET /orgs/{org}/failed_invitations", - "GET /orgs/{org}/hooks", - "GET /orgs/{org}/hooks/{hook_id}/deliveries", - "GET /orgs/{org}/installations", - "GET /orgs/{org}/invitations", - "GET /orgs/{org}/invitations/{invitation_id}/teams", - "GET /orgs/{org}/issues", - "GET /orgs/{org}/members", - "GET /orgs/{org}/members/{username}/codespaces", - "GET /orgs/{org}/migrations", - "GET /orgs/{org}/migrations/{migration_id}/repositories", - "GET /orgs/{org}/outside_collaborators", - "GET /orgs/{org}/packages", - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", - "GET /orgs/{org}/personal-access-token-requests", - "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories", - "GET /orgs/{org}/personal-access-tokens", - "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories", - "GET /orgs/{org}/projects", - "GET /orgs/{org}/properties/values", - "GET /orgs/{org}/public_members", - "GET /orgs/{org}/repos", - "GET /orgs/{org}/rulesets", - "GET /orgs/{org}/rulesets/rule-suites", - "GET /orgs/{org}/secret-scanning/alerts", - "GET /orgs/{org}/security-advisories", - "GET /orgs/{org}/teams", - "GET /orgs/{org}/teams/{team_slug}/discussions", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", - "GET /orgs/{org}/teams/{team_slug}/invitations", - "GET /orgs/{org}/teams/{team_slug}/members", - "GET /orgs/{org}/teams/{team_slug}/projects", - "GET /orgs/{org}/teams/{team_slug}/repos", - "GET /orgs/{org}/teams/{team_slug}/teams", - "GET /projects/columns/{column_id}/cards", - "GET /projects/{project_id}/collaborators", - "GET /projects/{project_id}/columns", - "GET /repos/{owner}/{repo}/actions/artifacts", - "GET /repos/{owner}/{repo}/actions/caches", - "GET /repos/{owner}/{repo}/actions/organization-secrets", - "GET /repos/{owner}/{repo}/actions/organization-variables", - "GET /repos/{owner}/{repo}/actions/runners", - "GET /repos/{owner}/{repo}/actions/runs", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", - "GET /repos/{owner}/{repo}/actions/secrets", - "GET /repos/{owner}/{repo}/actions/variables", - "GET /repos/{owner}/{repo}/actions/workflows", - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", - "GET /repos/{owner}/{repo}/activity", - "GET /repos/{owner}/{repo}/assignees", - "GET /repos/{owner}/{repo}/branches", - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", - "GET /repos/{owner}/{repo}/code-scanning/alerts", - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", - "GET /repos/{owner}/{repo}/code-scanning/analyses", - "GET /repos/{owner}/{repo}/codespaces", - "GET /repos/{owner}/{repo}/codespaces/devcontainers", - "GET /repos/{owner}/{repo}/codespaces/secrets", - "GET /repos/{owner}/{repo}/collaborators", - "GET /repos/{owner}/{repo}/comments", - "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/commits", - "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", - "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", - "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", - "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", - "GET /repos/{owner}/{repo}/commits/{ref}/status", - "GET /repos/{owner}/{repo}/commits/{ref}/statuses", - "GET /repos/{owner}/{repo}/contributors", - "GET /repos/{owner}/{repo}/dependabot/alerts", - "GET /repos/{owner}/{repo}/dependabot/secrets", - "GET /repos/{owner}/{repo}/deployments", - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", - "GET /repos/{owner}/{repo}/environments", - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps", - "GET /repos/{owner}/{repo}/events", - "GET /repos/{owner}/{repo}/forks", - "GET /repos/{owner}/{repo}/hooks", - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", - "GET /repos/{owner}/{repo}/invitations", - "GET /repos/{owner}/{repo}/issues", - "GET /repos/{owner}/{repo}/issues/comments", - "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/issues/events", - "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", - "GET /repos/{owner}/{repo}/issues/{issue_number}/events", - "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", - "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", - "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", - "GET /repos/{owner}/{repo}/keys", - "GET /repos/{owner}/{repo}/labels", - "GET /repos/{owner}/{repo}/milestones", - "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", - "GET /repos/{owner}/{repo}/notifications", - "GET /repos/{owner}/{repo}/pages/builds", - "GET /repos/{owner}/{repo}/projects", - "GET /repos/{owner}/{repo}/pulls", - "GET /repos/{owner}/{repo}/pulls/comments", - "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", - "GET /repos/{owner}/{repo}/releases", - "GET /repos/{owner}/{repo}/releases/{release_id}/assets", - "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", - "GET /repos/{owner}/{repo}/rules/branches/{branch}", - "GET /repos/{owner}/{repo}/rulesets", - "GET /repos/{owner}/{repo}/rulesets/rule-suites", - "GET /repos/{owner}/{repo}/secret-scanning/alerts", - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", - "GET /repos/{owner}/{repo}/security-advisories", - "GET /repos/{owner}/{repo}/stargazers", - "GET /repos/{owner}/{repo}/subscribers", - "GET /repos/{owner}/{repo}/tags", - "GET /repos/{owner}/{repo}/teams", - "GET /repos/{owner}/{repo}/topics", - "GET /repositories", - "GET /repositories/{repository_id}/environments/{environment_name}/secrets", - "GET /repositories/{repository_id}/environments/{environment_name}/variables", - "GET /search/code", - "GET /search/commits", - "GET /search/issues", - "GET /search/labels", - "GET /search/repositories", - "GET /search/topics", - "GET /search/users", - "GET /teams/{team_id}/discussions", - "GET /teams/{team_id}/discussions/{discussion_number}/comments", - "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", - "GET /teams/{team_id}/discussions/{discussion_number}/reactions", - "GET /teams/{team_id}/invitations", - "GET /teams/{team_id}/members", - "GET /teams/{team_id}/projects", - "GET /teams/{team_id}/repos", - "GET /teams/{team_id}/teams", - "GET /user/blocks", - "GET /user/codespaces", - "GET /user/codespaces/secrets", - "GET /user/emails", - "GET /user/followers", - "GET /user/following", - "GET /user/gpg_keys", - "GET /user/installations", - "GET /user/installations/{installation_id}/repositories", - "GET /user/issues", - "GET /user/keys", - "GET /user/marketplace_purchases", - "GET /user/marketplace_purchases/stubbed", - "GET /user/memberships/orgs", - "GET /user/migrations", - "GET /user/migrations/{migration_id}/repositories", - "GET /user/orgs", - "GET /user/packages", - "GET /user/packages/{package_type}/{package_name}/versions", - "GET /user/public_emails", - "GET /user/repos", - "GET /user/repository_invitations", - "GET /user/social_accounts", - "GET /user/ssh_signing_keys", - "GET /user/starred", - "GET /user/subscriptions", - "GET /user/teams", - "GET /users", - "GET /users/{username}/events", - "GET /users/{username}/events/orgs/{org}", - "GET /users/{username}/events/public", - "GET /users/{username}/followers", - "GET /users/{username}/following", - "GET /users/{username}/gists", - "GET /users/{username}/gpg_keys", - "GET /users/{username}/keys", - "GET /users/{username}/orgs", - "GET /users/{username}/packages", - "GET /users/{username}/projects", - "GET /users/{username}/received_events", - "GET /users/{username}/received_events/public", - "GET /users/{username}/repos", - "GET /users/{username}/social_accounts", - "GET /users/{username}/ssh_signing_keys", - "GET /users/{username}/starred", - "GET /users/{username}/subscriptions" -]; +/***/ 19835: +/***/ ((__unused_webpack_module, exports) => { -// pkg/dist-src/paginating-endpoints.js -function isPaginatingEndpoint(arg) { - if (typeof arg === "string") { - return paginatingEndpoints.includes(arg); - } else { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.checkBypass = exports.getProxyUrl = void 0; +function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === 'https:'; + if (checkBypass(reqUrl)) { + return undefined; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + try { + return new DecodedURL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new DecodedURL(`http://${proxyVar}`); + } + } + else { + return undefined; + } +} +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + // Format the request hostname and hostname with port + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (const upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { + return true; + } + } return false; - } } +exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} +class DecodedURL extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } +} +//# sourceMappingURL=proxy.js.map + +/***/ }), + +/***/ 40334: +/***/ ((module) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // pkg/dist-src/index.js -function paginateRest(octokit) { +var dist_src_exports = {}; +__export(dist_src_exports, { + createTokenAuth: () => createTokenAuth +}); +module.exports = __toCommonJS(dist_src_exports); + +// pkg/dist-src/auth.js +var REGEX_IS_INSTALLATION_LEGACY = /^v1\./; +var REGEX_IS_INSTALLATION = /^ghs_/; +var REGEX_IS_USER_TO_SERVER = /^ghu_/; +async function auth(token) { + const isApp = token.split(/\./).length === 3; + const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); + const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); + const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; return { - paginate: Object.assign(paginate.bind(null, octokit), { - iterator: iterator.bind(null, octokit) - }) + type: "token", + token, + tokenType }; } -paginateRest.VERSION = VERSION; + +// pkg/dist-src/with-authorization-prefix.js +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } + return `token ${token}`; +} + +// pkg/dist-src/hook.js +async function hook(token, request, route, parameters) { + const endpoint = request.endpoint.merge( + route, + parameters + ); + endpoint.headers.authorization = withAuthorizationPrefix(token); + return request(endpoint); +} + +// pkg/dist-src/index.js +var createTokenAuth = function createTokenAuth2(token) { + if (!token) { + throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); + } + if (typeof token !== "string") { + throw new Error( + "[@octokit/auth-token] Token passed to createTokenAuth is not a string" + ); + } + token = token.replace(/^(token|bearer) +/i, ""); + return Object.assign(auth.bind(null, token), { + hook: hook.bind(null, token) + }); +}; // Annotate the CommonJS export names for ESM import in node: 0 && (0); /***/ }), -/***/ 83044: -/***/ ((module) => { +/***/ 76762: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4412,2190 +3957,534 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru // pkg/dist-src/index.js var dist_src_exports = {}; __export(dist_src_exports, { - legacyRestEndpointMethods: () => legacyRestEndpointMethods, - restEndpointMethods: () => restEndpointMethods + Octokit: () => Octokit }); module.exports = __toCommonJS(dist_src_exports); +var import_universal_user_agent = __nccwpck_require__(45030); +var import_before_after_hook = __nccwpck_require__(83682); +var import_request = __nccwpck_require__(36234); +var import_graphql = __nccwpck_require__(88467); +var import_auth_token = __nccwpck_require__(40334); // pkg/dist-src/version.js -var VERSION = "10.2.0"; +var VERSION = "5.2.0"; -// pkg/dist-src/generated/endpoints.js -var Endpoints = { - actions: { - addCustomLabelsToSelfHostedRunnerForOrg: [ - "POST /orgs/{org}/actions/runners/{runner_id}/labels" - ], - addCustomLabelsToSelfHostedRunnerForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" - ], - addSelectedRepoToOrgVariable: [ - "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" - ], - approveWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve" - ], - cancelWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel" - ], - createEnvironmentVariable: [ - "POST /repositories/{repository_id}/environments/{environment_name}/variables" - ], - createOrUpdateEnvironmentSecret: [ - "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" - ], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" - ], - createOrgVariable: ["POST /orgs/{org}/actions/variables"], - createRegistrationTokenForOrg: [ - "POST /orgs/{org}/actions/runners/registration-token" - ], - createRegistrationTokenForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/registration-token" - ], - createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], - createRemoveTokenForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/remove-token" - ], - createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"], - createWorkflowDispatch: [ - "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" - ], - deleteActionsCacheById: [ - "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}" - ], - deleteActionsCacheByKey: [ - "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}" - ], - deleteArtifact: [ - "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}" - ], - deleteEnvironmentSecret: [ - "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" - ], - deleteEnvironmentVariable: [ - "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], - deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}" - ], - deleteRepoVariable: [ - "DELETE /repos/{owner}/{repo}/actions/variables/{name}" - ], - deleteSelfHostedRunnerFromOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}" - ], - deleteSelfHostedRunnerFromRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" - ], - deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], - deleteWorkflowRunLogs: [ - "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" - ], - disableSelectedRepositoryGithubActionsOrganization: [ - "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}" - ], - disableWorkflow: [ - "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable" - ], - downloadArtifact: [ - "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}" - ], - downloadJobLogsForWorkflowRun: [ - "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs" - ], - downloadWorkflowRunAttemptLogs: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs" - ], - downloadWorkflowRunLogs: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs" - ], - enableSelectedRepositoryGithubActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}" - ], - enableWorkflow: [ - "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable" - ], - forceCancelWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel" - ], - generateRunnerJitconfigForOrg: [ - "POST /orgs/{org}/actions/runners/generate-jitconfig" - ], - generateRunnerJitconfigForRepo: [ - "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig" - ], - getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], - getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], - getActionsCacheUsageByRepoForOrg: [ - "GET /orgs/{org}/actions/cache/usage-by-repository" - ], - getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], - getAllowedActionsOrganization: [ - "GET /orgs/{org}/actions/permissions/selected-actions" - ], - getAllowedActionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" - ], - getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getEnvironmentPublicKey: [ - "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" - ], - getEnvironmentSecret: [ - "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" - ], - getEnvironmentVariable: [ - "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}" - ], - getGithubActionsDefaultWorkflowPermissionsOrganization: [ - "GET /orgs/{org}/actions/permissions/workflow" - ], - getGithubActionsDefaultWorkflowPermissionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/workflow" - ], - getGithubActionsPermissionsOrganization: [ - "GET /orgs/{org}/actions/permissions" - ], - getGithubActionsPermissionsRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions" - ], - getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], - getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], - getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"], - getPendingDeploymentsForRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - ], - getRepoPermissions: [ - "GET /repos/{owner}/{repo}/actions/permissions", - {}, - { renamed: ["actions", "getGithubActionsPermissionsRepository"] } - ], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"], - getReviewsForRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals" - ], - getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], - getSelfHostedRunnerForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" - ], - getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], - getWorkflowAccessToRepository: [ - "GET /repos/{owner}/{repo}/actions/permissions/access" - ], - getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], - getWorkflowRunAttempt: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}" - ], - getWorkflowRunUsage: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing" - ], - getWorkflowUsage: [ - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing" - ], - listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], - listEnvironmentSecrets: [ - "GET /repositories/{repository_id}/environments/{environment_name}/secrets" - ], - listEnvironmentVariables: [ - "GET /repositories/{repository_id}/environments/{environment_name}/variables" - ], - listJobsForWorkflowRun: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs" - ], - listJobsForWorkflowRunAttempt: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs" - ], - listLabelsForSelfHostedRunnerForOrg: [ - "GET /orgs/{org}/actions/runners/{runner_id}/labels" - ], - listLabelsForSelfHostedRunnerForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], - listOrgVariables: ["GET /orgs/{org}/actions/variables"], - listRepoOrganizationSecrets: [ - "GET /repos/{owner}/{repo}/actions/organization-secrets" - ], - listRepoOrganizationVariables: [ - "GET /repos/{owner}/{repo}/actions/organization-variables" - ], - listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], - listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"], - listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], - listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], - listRunnerApplicationsForRepo: [ - "GET /repos/{owner}/{repo}/actions/runners/downloads" - ], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/actions/secrets/{secret_name}/repositories" - ], - listSelectedReposForOrgVariable: [ - "GET /orgs/{org}/actions/variables/{name}/repositories" - ], - listSelectedRepositoriesEnabledGithubActionsOrganization: [ - "GET /orgs/{org}/actions/permissions/repositories" - ], - listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], - listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], - listWorkflowRunArtifacts: [ - "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts" - ], - listWorkflowRuns: [ - "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" - ], - listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], - reRunJobForWorkflowRun: [ - "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" - ], - reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], - reRunWorkflowFailedJobs: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" - ], - removeAllCustomLabelsFromSelfHostedRunnerForOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}/labels" - ], - removeAllCustomLabelsFromSelfHostedRunnerForRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - removeCustomLabelFromSelfHostedRunnerForOrg: [ - "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}" - ], - removeCustomLabelFromSelfHostedRunnerForRepo: [ - "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" - ], - removeSelectedRepoFromOrgVariable: [ - "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" - ], - reviewCustomGatesForRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" - ], - reviewPendingDeploymentsForRun: [ - "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - ], - setAllowedActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/selected-actions" - ], - setAllowedActionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions" - ], - setCustomLabelsForSelfHostedRunnerForOrg: [ - "PUT /orgs/{org}/actions/runners/{runner_id}/labels" - ], - setCustomLabelsForSelfHostedRunnerForRepo: [ - "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - ], - setGithubActionsDefaultWorkflowPermissionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/workflow" - ], - setGithubActionsDefaultWorkflowPermissionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/workflow" - ], - setGithubActionsPermissionsOrganization: [ - "PUT /orgs/{org}/actions/permissions" - ], - setGithubActionsPermissionsRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories" - ], - setSelectedReposForOrgVariable: [ - "PUT /orgs/{org}/actions/variables/{name}/repositories" - ], - setSelectedRepositoriesEnabledGithubActionsOrganization: [ - "PUT /orgs/{org}/actions/permissions/repositories" - ], - setWorkflowAccessToRepository: [ - "PUT /repos/{owner}/{repo}/actions/permissions/access" - ], - updateEnvironmentVariable: [ - "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}" - ], - updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"], - updateRepoVariable: [ - "PATCH /repos/{owner}/{repo}/actions/variables/{name}" - ] - }, - activity: { - checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], - deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], - deleteThreadSubscription: [ - "DELETE /notifications/threads/{thread_id}/subscription" - ], - getFeeds: ["GET /feeds"], - getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], - getThread: ["GET /notifications/threads/{thread_id}"], - getThreadSubscriptionForAuthenticatedUser: [ - "GET /notifications/threads/{thread_id}/subscription" - ], - listEventsForAuthenticatedUser: ["GET /users/{username}/events"], - listNotificationsForAuthenticatedUser: ["GET /notifications"], - listOrgEventsForAuthenticatedUser: [ - "GET /users/{username}/events/orgs/{org}" - ], - listPublicEvents: ["GET /events"], - listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], - listPublicEventsForUser: ["GET /users/{username}/events/public"], - listPublicOrgEvents: ["GET /orgs/{org}/events"], - listReceivedEventsForUser: ["GET /users/{username}/received_events"], - listReceivedPublicEventsForUser: [ - "GET /users/{username}/received_events/public" - ], - listRepoEvents: ["GET /repos/{owner}/{repo}/events"], - listRepoNotificationsForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/notifications" - ], - listReposStarredByAuthenticatedUser: ["GET /user/starred"], - listReposStarredByUser: ["GET /users/{username}/starred"], - listReposWatchedByUser: ["GET /users/{username}/subscriptions"], - listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], - listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], - listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], - markNotificationsAsRead: ["PUT /notifications"], - markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], - markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], - setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], - setThreadSubscription: [ - "PUT /notifications/threads/{thread_id}/subscription" - ], - starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], - unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] - }, - apps: { - addRepoToInstallation: [ - "PUT /user/installations/{installation_id}/repositories/{repository_id}", - {}, - { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] } - ], - addRepoToInstallationForAuthenticatedUser: [ - "PUT /user/installations/{installation_id}/repositories/{repository_id}" - ], - checkToken: ["POST /applications/{client_id}/token"], - createFromManifest: ["POST /app-manifests/{code}/conversions"], - createInstallationAccessToken: [ - "POST /app/installations/{installation_id}/access_tokens" - ], - deleteAuthorization: ["DELETE /applications/{client_id}/grant"], - deleteInstallation: ["DELETE /app/installations/{installation_id}"], - deleteToken: ["DELETE /applications/{client_id}/token"], - getAuthenticated: ["GET /app"], - getBySlug: ["GET /apps/{app_slug}"], - getInstallation: ["GET /app/installations/{installation_id}"], - getOrgInstallation: ["GET /orgs/{org}/installation"], - getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], - getSubscriptionPlanForAccount: [ - "GET /marketplace_listing/accounts/{account_id}" - ], - getSubscriptionPlanForAccountStubbed: [ - "GET /marketplace_listing/stubbed/accounts/{account_id}" - ], - getUserInstallation: ["GET /users/{username}/installation"], - getWebhookConfigForApp: ["GET /app/hook/config"], - getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], - listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], - listAccountsForPlanStubbed: [ - "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts" - ], - listInstallationReposForAuthenticatedUser: [ - "GET /user/installations/{installation_id}/repositories" - ], - listInstallationRequestsForAuthenticatedApp: [ - "GET /app/installation-requests" - ], - listInstallations: ["GET /app/installations"], - listInstallationsForAuthenticatedUser: ["GET /user/installations"], - listPlans: ["GET /marketplace_listing/plans"], - listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], - listReposAccessibleToInstallation: ["GET /installation/repositories"], - listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], - listSubscriptionsForAuthenticatedUserStubbed: [ - "GET /user/marketplace_purchases/stubbed" - ], - listWebhookDeliveries: ["GET /app/hook/deliveries"], - redeliverWebhookDelivery: [ - "POST /app/hook/deliveries/{delivery_id}/attempts" - ], - removeRepoFromInstallation: [ - "DELETE /user/installations/{installation_id}/repositories/{repository_id}", - {}, - { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] } - ], - removeRepoFromInstallationForAuthenticatedUser: [ - "DELETE /user/installations/{installation_id}/repositories/{repository_id}" - ], - resetToken: ["PATCH /applications/{client_id}/token"], - revokeInstallationAccessToken: ["DELETE /installation/token"], - scopeToken: ["POST /applications/{client_id}/token/scoped"], - suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], - unsuspendInstallation: [ - "DELETE /app/installations/{installation_id}/suspended" - ], - updateWebhookConfigForApp: ["PATCH /app/hook/config"] - }, - billing: { - getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], - getGithubActionsBillingUser: [ - "GET /users/{username}/settings/billing/actions" - ], - getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], - getGithubPackagesBillingUser: [ - "GET /users/{username}/settings/billing/packages" - ], - getSharedStorageBillingOrg: [ - "GET /orgs/{org}/settings/billing/shared-storage" - ], - getSharedStorageBillingUser: [ - "GET /users/{username}/settings/billing/shared-storage" - ] - }, - checks: { - create: ["POST /repos/{owner}/{repo}/check-runs"], - createSuite: ["POST /repos/{owner}/{repo}/check-suites"], - get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], - getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], - listAnnotations: [ - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations" - ], - listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], - listForSuite: [ - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" - ], - listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], - rerequestRun: [ - "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" - ], - rerequestSuite: [ - "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest" - ], - setSuitesPreferences: [ - "PATCH /repos/{owner}/{repo}/check-suites/preferences" - ], - update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] - }, - codeScanning: { - deleteAnalysis: [ - "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}" - ], - getAlert: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", - {}, - { renamedParameters: { alert_id: "alert_number" } } - ], - getAnalysis: [ - "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}" - ], - getCodeqlDatabase: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" - ], - getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], - getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], - listAlertInstances: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" - ], - listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], - listAlertsInstances: [ - "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", - {}, - { renamed: ["codeScanning", "listAlertInstances"] } - ], - listCodeqlDatabases: [ - "GET /repos/{owner}/{repo}/code-scanning/codeql/databases" - ], - listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" - ], - updateDefaultSetup: [ - "PATCH /repos/{owner}/{repo}/code-scanning/default-setup" - ], - uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] - }, - codesOfConduct: { - getAllCodesOfConduct: ["GET /codes_of_conduct"], - getConductCode: ["GET /codes_of_conduct/{key}"] - }, - codespaces: { - addRepositoryForSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - checkPermissionsForDevcontainer: [ - "GET /repos/{owner}/{repo}/codespaces/permissions_check" - ], - codespaceMachinesForAuthenticatedUser: [ - "GET /user/codespaces/{codespace_name}/machines" - ], - createForAuthenticatedUser: ["POST /user/codespaces"], - createOrUpdateOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}" - ], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - createOrUpdateSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}" - ], - createWithPrForAuthenticatedUser: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces" - ], - createWithRepoForAuthenticatedUser: [ - "POST /repos/{owner}/{repo}/codespaces" - ], - deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], - deleteFromOrganization: [ - "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - deleteSecretForAuthenticatedUser: [ - "DELETE /user/codespaces/secrets/{secret_name}" - ], - exportForAuthenticatedUser: [ - "POST /user/codespaces/{codespace_name}/exports" - ], - getCodespacesForUserInOrg: [ - "GET /orgs/{org}/members/{username}/codespaces" - ], - getExportDetailsForAuthenticatedUser: [ - "GET /user/codespaces/{codespace_name}/exports/{export_id}" - ], - getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], - getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"], - getPublicKeyForAuthenticatedUser: [ - "GET /user/codespaces/secrets/public-key" - ], - getRepoPublicKey: [ - "GET /repos/{owner}/{repo}/codespaces/secrets/public-key" - ], - getRepoSecret: [ - "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - ], - getSecretForAuthenticatedUser: [ - "GET /user/codespaces/secrets/{secret_name}" - ], - listDevcontainersInRepositoryForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/devcontainers" - ], - listForAuthenticatedUser: ["GET /user/codespaces"], - listInOrganization: [ - "GET /orgs/{org}/codespaces", - {}, - { renamedParameters: { org_id: "org" } } - ], - listInRepositoryForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces" - ], - listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], - listRepositoriesForSecretForAuthenticatedUser: [ - "GET /user/codespaces/secrets/{secret_name}/repositories" - ], - listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories" - ], - preFlightWithRepoForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/new" - ], - publishForAuthenticatedUser: [ - "POST /user/codespaces/{codespace_name}/publish" - ], - removeRepositoryForSecretForAuthenticatedUser: [ - "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" - ], - repoMachinesForAuthenticatedUser: [ - "GET /repos/{owner}/{repo}/codespaces/machines" - ], - setRepositoriesForSecretForAuthenticatedUser: [ - "PUT /user/codespaces/secrets/{secret_name}/repositories" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories" - ], - startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], - stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], - stopInOrganization: [ - "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop" - ], - updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] - }, - copilot: { - addCopilotForBusinessSeatsForTeams: [ - "POST /orgs/{org}/copilot/billing/selected_teams" - ], - addCopilotForBusinessSeatsForUsers: [ - "POST /orgs/{org}/copilot/billing/selected_users" - ], - cancelCopilotSeatAssignmentForTeams: [ - "DELETE /orgs/{org}/copilot/billing/selected_teams" - ], - cancelCopilotSeatAssignmentForUsers: [ - "DELETE /orgs/{org}/copilot/billing/selected_users" - ], - getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], - getCopilotSeatDetailsForUser: [ - "GET /orgs/{org}/members/{username}/copilot" - ], - listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] - }, - dependabot: { - addSelectedRepoToOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" - ], - createOrUpdateOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}" - ], - createOrUpdateRepoSecret: [ - "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], - deleteRepoSecret: [ - "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], - getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], - getRepoPublicKey: [ - "GET /repos/{owner}/{repo}/dependabot/secrets/public-key" - ], - getRepoSecret: [ - "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - ], - listAlertsForEnterprise: [ - "GET /enterprises/{enterprise}/dependabot/alerts" - ], - listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"], - listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], - listSelectedReposForOrgSecret: [ - "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories" - ], - removeSelectedRepoFromOrgSecret: [ - "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" - ], - setSelectedReposForOrgSecret: [ - "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories" - ], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}" - ] - }, - dependencyGraph: { - createRepositorySnapshot: [ - "POST /repos/{owner}/{repo}/dependency-graph/snapshots" - ], - diffRange: [ - "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}" - ], - exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"] - }, - emojis: { get: ["GET /emojis"] }, - gists: { - checkIsStarred: ["GET /gists/{gist_id}/star"], - create: ["POST /gists"], - createComment: ["POST /gists/{gist_id}/comments"], - delete: ["DELETE /gists/{gist_id}"], - deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], - fork: ["POST /gists/{gist_id}/forks"], - get: ["GET /gists/{gist_id}"], - getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], - getRevision: ["GET /gists/{gist_id}/{sha}"], - list: ["GET /gists"], - listComments: ["GET /gists/{gist_id}/comments"], - listCommits: ["GET /gists/{gist_id}/commits"], - listForUser: ["GET /users/{username}/gists"], - listForks: ["GET /gists/{gist_id}/forks"], - listPublic: ["GET /gists/public"], - listStarred: ["GET /gists/starred"], - star: ["PUT /gists/{gist_id}/star"], - unstar: ["DELETE /gists/{gist_id}/star"], - update: ["PATCH /gists/{gist_id}"], - updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] - }, - git: { - createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], - createCommit: ["POST /repos/{owner}/{repo}/git/commits"], - createRef: ["POST /repos/{owner}/{repo}/git/refs"], - createTag: ["POST /repos/{owner}/{repo}/git/tags"], - createTree: ["POST /repos/{owner}/{repo}/git/trees"], - deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], - getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], - getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], - getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], - getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], - getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], - listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], - updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] - }, - gitignore: { - getAllTemplates: ["GET /gitignore/templates"], - getTemplate: ["GET /gitignore/templates/{name}"] - }, - interactions: { - getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], - getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], - getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], - getRestrictionsForYourPublicRepos: [ - "GET /user/interaction-limits", - {}, - { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] } - ], - removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], - removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], - removeRestrictionsForRepo: [ - "DELETE /repos/{owner}/{repo}/interaction-limits" - ], - removeRestrictionsForYourPublicRepos: [ - "DELETE /user/interaction-limits", - {}, - { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] } - ], - setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], - setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], - setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], - setRestrictionsForYourPublicRepos: [ - "PUT /user/interaction-limits", - {}, - { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] } - ] - }, - issues: { - addAssignees: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees" - ], - addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], - checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], - checkUserCanBeAssignedToIssue: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}" - ], - create: ["POST /repos/{owner}/{repo}/issues"], - createComment: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" - ], - createLabel: ["POST /repos/{owner}/{repo}/labels"], - createMilestone: ["POST /repos/{owner}/{repo}/milestones"], - deleteComment: [ - "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}" - ], - deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], - deleteMilestone: [ - "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}" - ], - get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], - getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], - getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], - getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], - getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], - list: ["GET /issues"], - listAssignees: ["GET /repos/{owner}/{repo}/assignees"], - listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], - listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], - listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], - listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], - listEventsForTimeline: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" - ], - listForAuthenticatedUser: ["GET /user/issues"], - listForOrg: ["GET /orgs/{org}/issues"], - listForRepo: ["GET /repos/{owner}/{repo}/issues"], - listLabelsForMilestone: [ - "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels" - ], - listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], - listLabelsOnIssue: [ - "GET /repos/{owner}/{repo}/issues/{issue_number}/labels" - ], - listMilestones: ["GET /repos/{owner}/{repo}/milestones"], - lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], - removeAllLabels: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels" - ], - removeAssignees: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees" - ], - removeLabel: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}" - ], - setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], - unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], - update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], - updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], - updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], - updateMilestone: [ - "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}" - ] - }, - licenses: { - get: ["GET /licenses/{license}"], - getAllCommonlyUsed: ["GET /licenses"], - getForRepo: ["GET /repos/{owner}/{repo}/license"] - }, - markdown: { - render: ["POST /markdown"], - renderRaw: [ - "POST /markdown/raw", - { headers: { "content-type": "text/plain; charset=utf-8" } } - ] - }, - meta: { - get: ["GET /meta"], - getAllVersions: ["GET /versions"], - getOctocat: ["GET /octocat"], - getZen: ["GET /zen"], - root: ["GET /"] - }, - migrations: { - cancelImport: [ - "DELETE /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import" - } - ], - deleteArchiveForAuthenticatedUser: [ - "DELETE /user/migrations/{migration_id}/archive" - ], - deleteArchiveForOrg: [ - "DELETE /orgs/{org}/migrations/{migration_id}/archive" - ], - downloadArchiveForOrg: [ - "GET /orgs/{org}/migrations/{migration_id}/archive" - ], - getArchiveForAuthenticatedUser: [ - "GET /user/migrations/{migration_id}/archive" - ], - getCommitAuthors: [ - "GET /repos/{owner}/{repo}/import/authors", - {}, - { - deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors" - } - ], - getImportStatus: [ - "GET /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status" - } - ], - getLargeFiles: [ - "GET /repos/{owner}/{repo}/import/large_files", - {}, - { - deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files" - } - ], - getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], - getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], - listForAuthenticatedUser: ["GET /user/migrations"], - listForOrg: ["GET /orgs/{org}/migrations"], - listReposForAuthenticatedUser: [ - "GET /user/migrations/{migration_id}/repositories" - ], - listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], - listReposForUser: [ - "GET /user/migrations/{migration_id}/repositories", - {}, - { renamed: ["migrations", "listReposForAuthenticatedUser"] } - ], - mapCommitAuthor: [ - "PATCH /repos/{owner}/{repo}/import/authors/{author_id}", - {}, - { - deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author" - } - ], - setLfsPreference: [ - "PATCH /repos/{owner}/{repo}/import/lfs", - {}, - { - deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference" - } - ], - startForAuthenticatedUser: ["POST /user/migrations"], - startForOrg: ["POST /orgs/{org}/migrations"], - startImport: [ - "PUT /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import" - } - ], - unlockRepoForAuthenticatedUser: [ - "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock" - ], - unlockRepoForOrg: [ - "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock" - ], - updateImport: [ - "PATCH /repos/{owner}/{repo}/import", - {}, - { - deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import" - } - ] - }, - orgs: { - addSecurityManagerTeam: [ - "PUT /orgs/{org}/security-managers/teams/{team_slug}" - ], - blockUser: ["PUT /orgs/{org}/blocks/{username}"], - cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], - checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], - checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], - checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], - convertMemberToOutsideCollaborator: [ - "PUT /orgs/{org}/outside_collaborators/{username}" - ], - createInvitation: ["POST /orgs/{org}/invitations"], - createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], - createOrUpdateCustomPropertiesValuesForRepos: [ - "PATCH /orgs/{org}/properties/values" - ], - createOrUpdateCustomProperty: [ - "PUT /orgs/{org}/properties/schema/{custom_property_name}" - ], - createWebhook: ["POST /orgs/{org}/hooks"], - delete: ["DELETE /orgs/{org}"], - deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], - enableOrDisableSecurityProductOnAllOrgRepos: [ - "POST /orgs/{org}/{security_product}/{enablement}" - ], - get: ["GET /orgs/{org}"], - getAllCustomProperties: ["GET /orgs/{org}/properties/schema"], - getCustomProperty: [ - "GET /orgs/{org}/properties/schema/{custom_property_name}" - ], - getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], - getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], - getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], - getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], - getWebhookDelivery: [ - "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" - ], - list: ["GET /organizations"], - listAppInstallations: ["GET /orgs/{org}/installations"], - listBlockedUsers: ["GET /orgs/{org}/blocks"], - listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"], - listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], - listForAuthenticatedUser: ["GET /user/orgs"], - listForUser: ["GET /users/{username}/orgs"], - listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], - listMembers: ["GET /orgs/{org}/members"], - listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], - listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], - listPatGrantRepositories: [ - "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" - ], - listPatGrantRequestRepositories: [ - "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories" - ], - listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"], - listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], - listPendingInvitations: ["GET /orgs/{org}/invitations"], - listPublicMembers: ["GET /orgs/{org}/public_members"], - listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], - listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /orgs/{org}/hooks"], - pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: [ - "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" - ], - removeCustomProperty: [ - "DELETE /orgs/{org}/properties/schema/{custom_property_name}" - ], - removeMember: ["DELETE /orgs/{org}/members/{username}"], - removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], - removeOutsideCollaborator: [ - "DELETE /orgs/{org}/outside_collaborators/{username}" - ], - removePublicMembershipForAuthenticatedUser: [ - "DELETE /orgs/{org}/public_members/{username}" - ], - removeSecurityManagerTeam: [ - "DELETE /orgs/{org}/security-managers/teams/{team_slug}" - ], - reviewPatGrantRequest: [ - "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}" - ], - reviewPatGrantRequestsInBulk: [ - "POST /orgs/{org}/personal-access-token-requests" - ], - setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], - setPublicMembershipForAuthenticatedUser: [ - "PUT /orgs/{org}/public_members/{username}" - ], - unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], - update: ["PATCH /orgs/{org}"], - updateMembershipForAuthenticatedUser: [ - "PATCH /user/memberships/orgs/{org}" - ], - updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"], - updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"], - updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], - updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] - }, - packages: { - deletePackageForAuthenticatedUser: [ - "DELETE /user/packages/{package_type}/{package_name}" - ], - deletePackageForOrg: [ - "DELETE /orgs/{org}/packages/{package_type}/{package_name}" - ], - deletePackageForUser: [ - "DELETE /users/{username}/packages/{package_type}/{package_name}" - ], - deletePackageVersionForAuthenticatedUser: [ - "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - deletePackageVersionForOrg: [ - "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - deletePackageVersionForUser: [ - "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getAllPackageVersionsForAPackageOwnedByAnOrg: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", - {}, - { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] } - ], - getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions", - {}, - { - renamed: [ - "packages", - "getAllPackageVersionsForPackageOwnedByAuthenticatedUser" - ] - } - ], - getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions" - ], - getAllPackageVersionsForPackageOwnedByOrg: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions" - ], - getAllPackageVersionsForPackageOwnedByUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}/versions" - ], - getPackageForAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}" - ], - getPackageForOrganization: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}" - ], - getPackageForUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}" - ], - getPackageVersionForAuthenticatedUser: [ - "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getPackageVersionForOrganization: [ - "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - getPackageVersionForUser: [ - "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" - ], - listDockerMigrationConflictingPackagesForAuthenticatedUser: [ - "GET /user/docker/conflicts" - ], - listDockerMigrationConflictingPackagesForOrganization: [ - "GET /orgs/{org}/docker/conflicts" - ], - listDockerMigrationConflictingPackagesForUser: [ - "GET /users/{username}/docker/conflicts" - ], - listPackagesForAuthenticatedUser: ["GET /user/packages"], - listPackagesForOrganization: ["GET /orgs/{org}/packages"], - listPackagesForUser: ["GET /users/{username}/packages"], - restorePackageForAuthenticatedUser: [ - "POST /user/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageForOrg: [ - "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageForUser: [ - "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}" - ], - restorePackageVersionForAuthenticatedUser: [ - "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ], - restorePackageVersionForOrg: [ - "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ], - restorePackageVersionForUser: [ - "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" - ] - }, - projects: { - addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], - createCard: ["POST /projects/columns/{column_id}/cards"], - createColumn: ["POST /projects/{project_id}/columns"], - createForAuthenticatedUser: ["POST /user/projects"], - createForOrg: ["POST /orgs/{org}/projects"], - createForRepo: ["POST /repos/{owner}/{repo}/projects"], - delete: ["DELETE /projects/{project_id}"], - deleteCard: ["DELETE /projects/columns/cards/{card_id}"], - deleteColumn: ["DELETE /projects/columns/{column_id}"], - get: ["GET /projects/{project_id}"], - getCard: ["GET /projects/columns/cards/{card_id}"], - getColumn: ["GET /projects/columns/{column_id}"], - getPermissionForUser: [ - "GET /projects/{project_id}/collaborators/{username}/permission" - ], - listCards: ["GET /projects/columns/{column_id}/cards"], - listCollaborators: ["GET /projects/{project_id}/collaborators"], - listColumns: ["GET /projects/{project_id}/columns"], - listForOrg: ["GET /orgs/{org}/projects"], - listForRepo: ["GET /repos/{owner}/{repo}/projects"], - listForUser: ["GET /users/{username}/projects"], - moveCard: ["POST /projects/columns/cards/{card_id}/moves"], - moveColumn: ["POST /projects/columns/{column_id}/moves"], - removeCollaborator: [ - "DELETE /projects/{project_id}/collaborators/{username}" - ], - update: ["PATCH /projects/{project_id}"], - updateCard: ["PATCH /projects/columns/cards/{card_id}"], - updateColumn: ["PATCH /projects/columns/{column_id}"] - }, - pulls: { - checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - create: ["POST /repos/{owner}/{repo}/pulls"], - createReplyForReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" - ], - createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - createReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments" - ], - deletePendingReview: [ - "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - deleteReviewComment: [ - "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}" - ], - dismissReview: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" - ], - get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], - getReview: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - list: ["GET /repos/{owner}/{repo}/pulls"], - listCommentsForReview: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments" - ], - listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], - listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], - listRequestedReviewers: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - listReviewComments: [ - "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments" - ], - listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], - listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - removeRequestedReviewers: [ - "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - requestReviewers: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - ], - submitReview: [ - "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" - ], - update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], - updateBranch: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" - ], - updateReview: [ - "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - ], - updateReviewComment: [ - "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" - ] - }, - rateLimit: { get: ["GET /rate_limit"] }, - reactions: { - createForCommitComment: [ - "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" - ], - createForIssue: [ - "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions" - ], - createForIssueComment: [ - "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - ], - createForPullRequestReviewComment: [ - "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - ], - createForRelease: [ - "POST /repos/{owner}/{repo}/releases/{release_id}/reactions" - ], - createForTeamDiscussionCommentInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - ], - createForTeamDiscussionInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - ], - deleteForCommitComment: [ - "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForIssue: [ - "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}" - ], - deleteForIssueComment: [ - "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForPullRequestComment: [ - "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}" - ], - deleteForRelease: [ - "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}" - ], - deleteForTeamDiscussion: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}" - ], - deleteForTeamDiscussionComment: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}" - ], - listForCommitComment: [ - "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions" - ], - listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - listForIssueComment: [ - "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - ], - listForPullRequestReviewComment: [ - "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - ], - listForRelease: [ - "GET /repos/{owner}/{repo}/releases/{release_id}/reactions" - ], - listForTeamDiscussionCommentInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - ], - listForTeamDiscussionInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - ] - }, - repos: { - acceptInvitation: [ - "PATCH /user/repository_invitations/{invitation_id}", - {}, - { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] } - ], - acceptInvitationForAuthenticatedUser: [ - "PATCH /user/repository_invitations/{invitation_id}" - ], - addAppAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], - addStatusCheckContexts: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - addTeamAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - addUserAccessRestrictions: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - checkAutomatedSecurityFixes: [ - "GET /repos/{owner}/{repo}/automated-security-fixes" - ], - checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], - checkVulnerabilityAlerts: [ - "GET /repos/{owner}/{repo}/vulnerability-alerts" - ], - codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], - compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], - compareCommitsWithBasehead: [ - "GET /repos/{owner}/{repo}/compare/{basehead}" - ], - createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], - createCommitComment: [ - "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments" - ], - createCommitSignatureProtection: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], - createDeployKey: ["POST /repos/{owner}/{repo}/keys"], - createDeployment: ["POST /repos/{owner}/{repo}/deployments"], - createDeploymentBranchPolicy: [ - "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - ], - createDeploymentProtectionRule: [ - "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - ], - createDeploymentStatus: [ - "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - ], - createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], - createForAuthenticatedUser: ["POST /user/repos"], - createFork: ["POST /repos/{owner}/{repo}/forks"], - createInOrg: ["POST /orgs/{org}/repos"], - createOrUpdateEnvironment: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}" - ], - createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], - createOrgRuleset: ["POST /orgs/{org}/rulesets"], - createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployment"], - createPagesSite: ["POST /repos/{owner}/{repo}/pages"], - createRelease: ["POST /repos/{owner}/{repo}/releases"], - createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], - createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], - createUsingTemplate: [ - "POST /repos/{template_owner}/{template_repo}/generate" - ], - createWebhook: ["POST /repos/{owner}/{repo}/hooks"], - declineInvitation: [ - "DELETE /user/repository_invitations/{invitation_id}", - {}, - { renamed: ["repos", "declineInvitationForAuthenticatedUser"] } - ], - declineInvitationForAuthenticatedUser: [ - "DELETE /user/repository_invitations/{invitation_id}" - ], - delete: ["DELETE /repos/{owner}/{repo}"], - deleteAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" - ], - deleteAdminBranchProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - deleteAnEnvironment: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}" - ], - deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], - deleteBranchProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection" - ], - deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], - deleteCommitSignatureProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], - deleteDeployment: [ - "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" - ], - deleteDeploymentBranchPolicy: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], - deleteInvitation: [ - "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" - ], - deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"], - deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], - deletePullRequestReviewProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], - deleteReleaseAsset: [ - "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}" - ], - deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - deleteTagProtection: [ - "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}" - ], - deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], - disableAutomatedSecurityFixes: [ - "DELETE /repos/{owner}/{repo}/automated-security-fixes" - ], - disableDeploymentProtectionRule: [ - "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" - ], - disablePrivateVulnerabilityReporting: [ - "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting" - ], - disableVulnerabilityAlerts: [ - "DELETE /repos/{owner}/{repo}/vulnerability-alerts" - ], - downloadArchive: [ - "GET /repos/{owner}/{repo}/zipball/{ref}", - {}, - { renamed: ["repos", "downloadZipballArchive"] } - ], - downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], - downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], - enableAutomatedSecurityFixes: [ - "PUT /repos/{owner}/{repo}/automated-security-fixes" - ], - enablePrivateVulnerabilityReporting: [ - "PUT /repos/{owner}/{repo}/private-vulnerability-reporting" - ], - enableVulnerabilityAlerts: [ - "PUT /repos/{owner}/{repo}/vulnerability-alerts" - ], - generateReleaseNotes: [ - "POST /repos/{owner}/{repo}/releases/generate-notes" - ], - get: ["GET /repos/{owner}/{repo}"], - getAccessRestrictions: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" - ], - getAdminBranchProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - getAllDeploymentProtectionRules: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - ], - getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], - getAllStatusCheckContexts: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - ], - getAllTopics: ["GET /repos/{owner}/{repo}/topics"], - getAppsWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - ], - getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], - getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], - getBranchProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection" - ], - getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"], - getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], - getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], - getCollaboratorPermissionLevel: [ - "GET /repos/{owner}/{repo}/collaborators/{username}/permission" - ], - getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], - getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], - getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], - getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], - getCommitSignatureProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" - ], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], - getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], - getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], - getCustomDeploymentProtectionRule: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" - ], - getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"], - getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], - getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], - getDeploymentBranchPolicy: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - getDeploymentStatus: [ - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" - ], - getEnvironment: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}" - ], - getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], - getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], - getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"], - getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"], - getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"], - getOrgRulesets: ["GET /orgs/{org}/rulesets"], - getPages: ["GET /repos/{owner}/{repo}/pages"], - getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], - getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], - getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], - getPullRequestReviewProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], - getReadme: ["GET /repos/{owner}/{repo}/readme"], - getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], - getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], - getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], - getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], - getRepoRuleSuite: [ - "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" - ], - getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"], - getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"], - getStatusChecksProtection: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - getTeamsWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - ], - getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], - getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], - getUsersWithAccessToProtectedBranch: [ - "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - ], - getViews: ["GET /repos/{owner}/{repo}/traffic/views"], - getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], - getWebhookConfigForRepo: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" - ], - getWebhookDelivery: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}" - ], - listActivities: ["GET /repos/{owner}/{repo}/activity"], - listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], - listBranches: ["GET /repos/{owner}/{repo}/branches"], - listBranchesForHeadCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" - ], - listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], - listCommentsForCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" - ], - listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], - listCommitStatusesForRef: [ - "GET /repos/{owner}/{repo}/commits/{ref}/statuses" - ], - listCommits: ["GET /repos/{owner}/{repo}/commits"], - listContributors: ["GET /repos/{owner}/{repo}/contributors"], - listCustomDeploymentRuleIntegrations: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps" - ], - listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], - listDeploymentBranchPolicies: [ - "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - ], - listDeploymentStatuses: [ - "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - ], - listDeployments: ["GET /repos/{owner}/{repo}/deployments"], - listForAuthenticatedUser: ["GET /user/repos"], - listForOrg: ["GET /orgs/{org}/repos"], - listForUser: ["GET /users/{username}/repos"], - listForks: ["GET /repos/{owner}/{repo}/forks"], - listInvitations: ["GET /repos/{owner}/{repo}/invitations"], - listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], - listLanguages: ["GET /repos/{owner}/{repo}/languages"], - listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], - listPublic: ["GET /repositories"], - listPullRequestsAssociatedWithCommit: [ - "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" - ], - listReleaseAssets: [ - "GET /repos/{owner}/{repo}/releases/{release_id}/assets" - ], - listReleases: ["GET /repos/{owner}/{repo}/releases"], - listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], - listTags: ["GET /repos/{owner}/{repo}/tags"], - listTeams: ["GET /repos/{owner}/{repo}/teams"], - listWebhookDeliveries: [ - "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" - ], - listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], - merge: ["POST /repos/{owner}/{repo}/merges"], - mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], - pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: [ - "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" - ], - removeAppAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - removeCollaborator: [ - "DELETE /repos/{owner}/{repo}/collaborators/{username}" - ], - removeStatusCheckContexts: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - removeStatusCheckProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - removeTeamAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - removeUserAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], - replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], - requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], - setAdminBranchProtection: [ - "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" - ], - setAppAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", - {}, - { mapToData: "apps" } - ], - setStatusCheckContexts: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", - {}, - { mapToData: "contexts" } - ], - setTeamAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } - ], - setUserAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", - {}, - { mapToData: "users" } - ], - testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], - transfer: ["POST /repos/{owner}/{repo}/transfer"], - update: ["PATCH /repos/{owner}/{repo}"], - updateBranchProtection: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection" - ], - updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], - updateDeploymentBranchPolicy: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - ], - updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], - updateInvitation: [ - "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" - ], - updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], - updatePullRequestReviewProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - ], - updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], - updateReleaseAsset: [ - "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" - ], - updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - updateStatusCheckPotection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", - {}, - { renamed: ["repos", "updateStatusCheckProtection"] } - ], - updateStatusCheckProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" - ], - updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], - updateWebhookConfigForRepo: [ - "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" - ], - uploadReleaseAsset: [ - "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", - { baseUrl: "https://uploads.github.com" } - ] - }, - search: { - code: ["GET /search/code"], - commits: ["GET /search/commits"], - issuesAndPullRequests: ["GET /search/issues"], - labels: ["GET /search/labels"], - repos: ["GET /search/repositories"], - topics: ["GET /search/topics"], - users: ["GET /search/users"] - }, - secretScanning: { - getAlert: [ - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - ], - listAlertsForEnterprise: [ - "GET /enterprises/{enterprise}/secret-scanning/alerts" - ], - listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], - listLocationsForAlert: [ - "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations" - ], - updateAlert: [ - "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - ] - }, - securityAdvisories: { - createPrivateVulnerabilityReport: [ - "POST /repos/{owner}/{repo}/security-advisories/reports" - ], - createRepositoryAdvisory: [ - "POST /repos/{owner}/{repo}/security-advisories" - ], - createRepositoryAdvisoryCveRequest: [ - "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve" - ], - getGlobalAdvisory: ["GET /advisories/{ghsa_id}"], - getRepositoryAdvisory: [ - "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}" - ], - listGlobalAdvisories: ["GET /advisories"], - listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"], - listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"], - updateRepositoryAdvisory: [ - "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}" - ] - }, - teams: { - addOrUpdateMembershipForUserInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - addOrUpdateProjectPermissionsInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}" - ], - addOrUpdateRepoPermissionsInOrg: [ - "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - checkPermissionsForProjectInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}" - ], - checkPermissionsForRepoInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - create: ["POST /orgs/{org}/teams"], - createDiscussionCommentInOrg: [ - "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - ], - createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], - deleteDiscussionCommentInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - deleteDiscussionInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], - getByName: ["GET /orgs/{org}/teams/{team_slug}"], - getDiscussionCommentInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - getDiscussionInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - getMembershipForUserInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - list: ["GET /orgs/{org}/teams"], - listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], - listDiscussionCommentsInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - ], - listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], - listForAuthenticatedUser: ["GET /user/teams"], - listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], - listPendingInvitationsInOrg: [ - "GET /orgs/{org}/teams/{team_slug}/invitations" - ], - listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], - listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], - removeMembershipForUserInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}" - ], - removeProjectInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}" - ], - removeRepoInOrg: [ - "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - ], - updateDiscussionCommentInOrg: [ - "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - ], - updateDiscussionInOrg: [ - "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - ], - updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] - }, - users: { - addEmailForAuthenticated: [ - "POST /user/emails", - {}, - { renamed: ["users", "addEmailForAuthenticatedUser"] } - ], - addEmailForAuthenticatedUser: ["POST /user/emails"], - addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], - block: ["PUT /user/blocks/{username}"], - checkBlocked: ["GET /user/blocks/{username}"], - checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], - checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], - createGpgKeyForAuthenticated: [ - "POST /user/gpg_keys", - {}, - { renamed: ["users", "createGpgKeyForAuthenticatedUser"] } - ], - createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], - createPublicSshKeyForAuthenticated: [ - "POST /user/keys", - {}, - { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } - ], - createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], - createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], - deleteEmailForAuthenticated: [ - "DELETE /user/emails", - {}, - { renamed: ["users", "deleteEmailForAuthenticatedUser"] } - ], - deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], - deleteGpgKeyForAuthenticated: [ - "DELETE /user/gpg_keys/{gpg_key_id}", - {}, - { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } - ], - deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], - deletePublicSshKeyForAuthenticated: [ - "DELETE /user/keys/{key_id}", - {}, - { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } - ], - deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], - deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], - deleteSshSigningKeyForAuthenticatedUser: [ - "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" - ], - follow: ["PUT /user/following/{username}"], - getAuthenticated: ["GET /user"], - getByUsername: ["GET /users/{username}"], - getContextForUser: ["GET /users/{username}/hovercard"], - getGpgKeyForAuthenticated: [ - "GET /user/gpg_keys/{gpg_key_id}", - {}, - { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } - ], - getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], - getPublicSshKeyForAuthenticated: [ - "GET /user/keys/{key_id}", - {}, - { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } - ], - getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], - getSshSigningKeyForAuthenticatedUser: [ - "GET /user/ssh_signing_keys/{ssh_signing_key_id}" - ], - list: ["GET /users"], - listBlockedByAuthenticated: [ - "GET /user/blocks", - {}, - { renamed: ["users", "listBlockedByAuthenticatedUser"] } - ], - listBlockedByAuthenticatedUser: ["GET /user/blocks"], - listEmailsForAuthenticated: [ - "GET /user/emails", - {}, - { renamed: ["users", "listEmailsForAuthenticatedUser"] } - ], - listEmailsForAuthenticatedUser: ["GET /user/emails"], - listFollowedByAuthenticated: [ - "GET /user/following", - {}, - { renamed: ["users", "listFollowedByAuthenticatedUser"] } - ], - listFollowedByAuthenticatedUser: ["GET /user/following"], - listFollowersForAuthenticatedUser: ["GET /user/followers"], - listFollowersForUser: ["GET /users/{username}/followers"], - listFollowingForUser: ["GET /users/{username}/following"], - listGpgKeysForAuthenticated: [ - "GET /user/gpg_keys", - {}, - { renamed: ["users", "listGpgKeysForAuthenticatedUser"] } - ], - listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], - listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], - listPublicEmailsForAuthenticated: [ - "GET /user/public_emails", - {}, - { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } - ], - listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], - listPublicKeysForUser: ["GET /users/{username}/keys"], - listPublicSshKeysForAuthenticated: [ - "GET /user/keys", - {}, - { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } - ], - listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], - listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"], - listSocialAccountsForUser: ["GET /users/{username}/social_accounts"], - listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"], - listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"], - setPrimaryEmailVisibilityForAuthenticated: [ - "PATCH /user/email/visibility", - {}, - { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] } - ], - setPrimaryEmailVisibilityForAuthenticatedUser: [ - "PATCH /user/email/visibility" - ], - unblock: ["DELETE /user/blocks/{username}"], - unfollow: ["DELETE /user/following/{username}"], - updateAuthenticated: ["PATCH /user"] - } +// pkg/dist-src/index.js +var noop = () => { }; -var endpoints_default = Endpoints; - -// pkg/dist-src/endpoints-to-methods.js -var endpointMethodsMap = /* @__PURE__ */ new Map(); -for (const [scope, endpoints] of Object.entries(endpoints_default)) { - for (const [methodName, endpoint] of Object.entries(endpoints)) { - const [route, defaults, decorations] = endpoint; - const [method, url] = route.split(/ /); - const endpointDefaults = Object.assign( +var consoleWarn = console.warn.bind(console); +var consoleError = console.error.bind(console); +var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; +var Octokit = class { + static { + this.VERSION = VERSION; + } + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; + if (typeof defaults === "function") { + super(defaults(options)); + return; + } + super( + Object.assign( + {}, + defaults, + options, + options.userAgent && defaults.userAgent ? { + userAgent: `${options.userAgent} ${defaults.userAgent}` + } : null + ) + ); + } + }; + return OctokitWithDefaults; + } + static { + this.plugins = []; + } + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ + static plugin(...newPlugins) { + const currentPlugins = this.plugins; + const NewOctokit = class extends this { + static { + this.plugins = currentPlugins.concat( + newPlugins.filter((plugin) => !currentPlugins.includes(plugin)) + ); + } + }; + return NewOctokit; + } + constructor(options = {}) { + const hook = new import_before_after_hook.Collection(); + const requestDefaults = { + baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type + hook: hook.bind(null, "request") + }), + mediaType: { + previews: [], + format: "" + } + }; + requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail; + if (options.baseUrl) { + requestDefaults.baseUrl = options.baseUrl; + } + if (options.previews) { + requestDefaults.mediaType.previews = options.previews; + } + if (options.timeZone) { + requestDefaults.headers["time-zone"] = options.timeZone; + } + this.request = import_request.request.defaults(requestDefaults); + this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults); + this.log = Object.assign( { - method, - url + debug: noop, + info: noop, + warn: consoleWarn, + error: consoleError }, - defaults + options.log ); - if (!endpointMethodsMap.has(scope)) { - endpointMethodsMap.set(scope, /* @__PURE__ */ new Map()); + this.hook = hook; + if (!options.authStrategy) { + if (!options.auth) { + this.auth = async () => ({ + type: "unauthenticated" + }); + } else { + const auth = (0, import_auth_token.createTokenAuth)(options.auth); + hook.wrap("request", auth.hook); + this.auth = auth; + } + } else { + const { authStrategy, ...otherOptions } = options; + const auth = authStrategy( + Object.assign( + { + request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions + }, + options.auth + ) + ); + hook.wrap("request", auth.hook); + this.auth = auth; + } + const classConstructor = this.constructor; + for (let i = 0; i < classConstructor.plugins.length; ++i) { + Object.assign(this, classConstructor.plugins[i](this, options)); } - endpointMethodsMap.get(scope).set(methodName, { - scope, - methodName, - endpointDefaults, - decorations - }); } -} -var handler = { - has({ scope }, methodName) { - return endpointMethodsMap.get(scope).has(methodName); - }, - getOwnPropertyDescriptor(target, methodName) { - return { - value: this.get(target, methodName), - // ensures method is in the cache - configurable: true, - writable: true, - enumerable: true - }; - }, - defineProperty(target, methodName, descriptor) { - Object.defineProperty(target.cache, methodName, descriptor); - return true; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (0); + + +/***/ }), + +/***/ 59440: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + endpoint: () => endpoint +}); +module.exports = __toCommonJS(dist_src_exports); + +// pkg/dist-src/defaults.js +var import_universal_user_agent = __nccwpck_require__(45030); + +// pkg/dist-src/version.js +var VERSION = "9.0.5"; + +// pkg/dist-src/defaults.js +var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; +var DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent }, - deleteProperty(target, methodName) { - delete target.cache[methodName]; + mediaType: { + format: "" + } +}; + +// pkg/dist-src/util/lowercase-keys.js +function lowercaseKeys(object) { + if (!object) { + return {}; + } + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); +} + +// pkg/dist-src/util/is-plain-object.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) + return false; + if (Object.prototype.toString.call(value) !== "[object Object]") + return false; + const proto = Object.getPrototypeOf(value); + if (proto === null) return true; - }, - ownKeys({ scope }) { - return [...endpointMethodsMap.get(scope).keys()]; - }, - set(target, methodName, value) { - return target.cache[methodName] = value; - }, - get({ octokit, scope, cache }, methodName) { - if (cache[methodName]) { - return cache[methodName]; + const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); +} + +// pkg/dist-src/util/merge-deep.js +function mergeDeep(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach((key) => { + if (isPlainObject(options[key])) { + if (!(key in defaults)) + Object.assign(result, { [key]: options[key] }); + else + result[key] = mergeDeep(defaults[key], options[key]); + } else { + Object.assign(result, { [key]: options[key] }); } - const method = endpointMethodsMap.get(scope).get(methodName); - if (!method) { - return void 0; + }); + return result; +} + +// pkg/dist-src/util/remove-undefined-properties.js +function removeUndefinedProperties(obj) { + for (const key in obj) { + if (obj[key] === void 0) { + delete obj[key]; } - const { endpointDefaults, decorations } = method; - if (decorations) { - cache[methodName] = decorate( - octokit, - scope, - methodName, - endpointDefaults, - decorations - ); - } else { - cache[methodName] = octokit.request.defaults(endpointDefaults); + } + return obj; +} + +// pkg/dist-src/merge.js +function merge(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { method, url } : { url: method }, options); + } else { + options = Object.assign({}, route); + } + options.headers = lowercaseKeys(options.headers); + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); + if (options.url === "/graphql") { + if (defaults && defaults.mediaType.previews?.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter( + (preview) => !mergedOptions.mediaType.previews.includes(preview) + ).concat(mergedOptions.mediaType.previews); } - return cache[methodName]; + mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); } -}; -function endpointsToMethods(octokit) { - const newMethods = {}; - for (const scope of endpointMethodsMap.keys()) { - newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler); + return mergedOptions; +} + +// pkg/dist-src/util/add-query-parameters.js +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + if (names.length === 0) { + return url; } - return newMethods; + return url + separator + names.map((name) => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); } -function decorate(octokit, scope, methodName, defaults, decorations) { - const requestWithDefaults = octokit.request.defaults(defaults); - function withDecorations(...args) { - let options = requestWithDefaults.endpoint.merge(...args); - if (decorations.mapToData) { - options = Object.assign({}, options, { - data: options[decorations.mapToData], - [decorations.mapToData]: void 0 - }); - return requestWithDefaults(options); + +// pkg/dist-src/util/extract-url-variable-names.js +var urlVariableRegex = /\{[^}]+\}/g; +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); +} +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + if (!matches) { + return []; + } + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +} + +// pkg/dist-src/util/omit.js +function omit(object, keysToOmit) { + const result = { __proto__: null }; + for (const key of Object.keys(object)) { + if (keysToOmit.indexOf(key) === -1) { + result[key] = object[key]; } - if (decorations.renamed) { - const [newScope, newMethodName] = decorations.renamed; - octokit.log.warn( - `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` + } + return result; +} + +// pkg/dist-src/util/url-template.js +function encodeReserved(str) { + return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { + if (!/%[0-9A-Fa-f]/.test(part)) { + part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); + } + return part; + }).join(""); +} +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; + } +} +function isDefined(value) { + return value !== void 0 && value !== null; +} +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} +function getValues(context, operator, key, modifier) { + var value = context[key], result = []; + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); + } + result.push( + encodeValue(operator, value, isKeyOperator(operator) ? key : "") ); - } - if (decorations.deprecated) { - octokit.log.warn(decorations.deprecated); - } - if (decorations.renamedParameters) { - const options2 = requestWithDefaults.endpoint.merge(...args); - for (const [name, alias] of Object.entries( - decorations.renamedParameters - )) { - if (name in options2) { - octokit.log.warn( - `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead` - ); - if (!(alias in options2)) { - options2[alias] = options2[name]; - } - delete options2[name]; + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function(value2) { + result.push( + encodeValue(operator, value2, isKeyOperator(operator) ? key : "") + ); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } + } else { + const tmp = []; + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function(value2) { + tmp.push(encodeValue(operator, value2)); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined(value[k])) { + tmp.push(encodeUnreserved(k)); + tmp.push(encodeValue(operator, value[k].toString())); + } + }); + } + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); } } - return requestWithDefaults(options2); } - return requestWithDefaults(...args); + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); + } + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); + } } - return Object.assign(withDecorations, requestWithDefaults); + return result; } - -// pkg/dist-src/index.js -function restEndpointMethods(octokit) { - const api = endpointsToMethods(octokit); +function parseUrl(template) { return { - rest: api + expand: expand.bind(null, template) }; } -restEndpointMethods.VERSION = VERSION; -function legacyRestEndpointMethods(octokit) { - const api = endpointsToMethods(octokit); - return { - ...api, - rest: api - }; +function expand(template, context) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + template = template.replace( + /\{([^\{\}]+)\}|([^\{\}]+)/g, + function(_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); + } + expression.split(/,/g).forEach(function(variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); + if (operator && operator !== "+") { + var separator = ","; + if (operator === "?") { + separator = "&"; + } else if (operator !== "#") { + separator = operator; + } + return (values.length !== 0 ? operator : "") + values.join(separator); + } else { + return values.join(","); + } + } else { + return encodeReserved(literal); + } + } + ); + if (template === "/") { + return template; + } else { + return template.replace(/\/$/, ""); + } } -legacyRestEndpointMethods.VERSION = VERSION; -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), -/***/ 10537: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -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 __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 (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); +// pkg/dist-src/parse.js +function parse(options) { + let method = options.method.toUpperCase(); + let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); + let headers = Object.assign({}, options.headers); + let body; + let parameters = omit(options, [ + "method", + "baseUrl", + "url", + "headers", + "request", + "mediaType" + ]); + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + if (!/^http/.test(url)) { + url = options.baseUrl + url; } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - RequestError: () => RequestError -}); -module.exports = __toCommonJS(dist_src_exports); -var import_deprecation = __nccwpck_require__(58932); -var import_once = __toESM(__nccwpck_require__(1223)); -var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation)); -var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation)); -var RequestError = class extends Error { - constructor(message, statusCode, options) { - super(message); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - this.name = "HttpError"; - this.status = statusCode; - let headers; - if ("headers" in options && typeof options.headers !== "undefined") { - headers = options.headers; - } - if ("response" in options) { - this.response = options.response; - headers = options.response.headers; - } - const requestCopy = Object.assign({}, options.request); - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace( - / .*$/, - " [REDACTED]" + const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); + if (!isBinaryRequest) { + if (options.mediaType.format) { + headers.accept = headers.accept.split(/,/).map( + (format) => format.replace( + /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, + `application/vnd$1$2.${options.mediaType.format}` ) - }); + ).join(","); } - requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; - Object.defineProperty(this, "code", { - get() { - logOnceCode( - new import_deprecation.Deprecation( - "[@octokit/request-error] `error.code` is deprecated, use `error.status`." - ) - ); - return statusCode; + if (url.endsWith("/graphql")) { + if (options.mediaType.previews?.length) { + const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; + headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => { + const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format}`; + }).join(","); } - }); - Object.defineProperty(this, "headers", { - get() { - logOnceHeaders( - new import_deprecation.Deprecation( - "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`." - ) - ); - return headers || {}; + } + } + if (["GET", "HEAD"].includes(method)) { + url = addQueryParameters(url, remainingParameters); + } else { + if ("data" in remainingParameters) { + body = remainingParameters.data; + } else { + if (Object.keys(remainingParameters).length) { + body = remainingParameters; } - }); + } } -}; + if (!headers["content-type"] && typeof body !== "undefined") { + headers["content-type"] = "application/json; charset=utf-8"; + } + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } + return Object.assign( + { method, url, headers }, + typeof body !== "undefined" ? { body } : null, + options.request ? { request: options.request } : null + ); +} + +// pkg/dist-src/endpoint-with-defaults.js +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); +} + +// pkg/dist-src/with-defaults.js +function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS2 = merge(oldDefaults, newDefaults); + const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); + return Object.assign(endpoint2, { + DEFAULTS: DEFAULTS2, + defaults: withDefaults.bind(null, DEFAULTS2), + merge: merge.bind(null, DEFAULTS2), + parse + }); +} + +// pkg/dist-src/index.js +var endpoint = withDefaults(null, DEFAULTS); // Annotate the CommonJS export names for ESM import in node: 0 && (0); /***/ }), -/***/ 36234: +/***/ 88467: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -6621,1407 +4510,3038 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru // pkg/dist-src/index.js var dist_src_exports = {}; __export(dist_src_exports, { - request: () => request + GraphqlResponseError: () => GraphqlResponseError, + graphql: () => graphql2, + withCustomRequest: () => withCustomRequest }); module.exports = __toCommonJS(dist_src_exports); -var import_endpoint = __nccwpck_require__(59440); +var import_request3 = __nccwpck_require__(36234); var import_universal_user_agent = __nccwpck_require__(45030); // pkg/dist-src/version.js -var VERSION = "8.1.6"; +var VERSION = "7.1.0"; -// pkg/dist-src/is-plain-object.js -function isPlainObject(value) { - if (typeof value !== "object" || value === null) - return false; - if (Object.prototype.toString.call(value) !== "[object Object]") - return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); -} +// pkg/dist-src/with-defaults.js +var import_request2 = __nccwpck_require__(36234); -// pkg/dist-src/fetch-wrapper.js -var import_request_error = __nccwpck_require__(10537); +// pkg/dist-src/graphql.js +var import_request = __nccwpck_require__(36234); -// pkg/dist-src/get-buffer-response.js -function getBufferResponse(response) { - return response.arrayBuffer(); +// pkg/dist-src/error.js +function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors: +` + data.errors.map((e) => ` - ${e.message}`).join("\n"); } - -// pkg/dist-src/fetch-wrapper.js -function fetchWrapper(requestOptions) { - var _a, _b, _c; - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; - const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; - if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - let headers = {}; - let status; - let url; - let { fetch } = globalThis; - if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) { - fetch = requestOptions.request.fetch; - } - if (!fetch) { - throw new Error( - "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" - ); - } - return fetch(requestOptions.url, { - method: requestOptions.method, - body: requestOptions.body, - headers: requestOptions.headers, - signal: (_c = requestOptions.request) == null ? void 0 : _c.signal, - // duplex must be set if request.body is ReadableStream or Async Iterables. - // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. - ...requestOptions.body && { duplex: "half" } - }).then(async (response) => { - url = response.url; - status = response.status; - for (const keyAndValue of response.headers) { - headers[keyAndValue[0]] = keyAndValue[1]; +var GraphqlResponseError = class extends Error { + constructor(request2, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request2; + this.headers = headers; + this.response = response; + this.name = "GraphqlResponseError"; + this.errors = response.errors; + this.data = response.data; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); } - if ("deprecation" in headers) { - const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); - const deprecationLink = matches && matches.pop(); - log.warn( - `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` + } +}; + +// pkg/dist-src/graphql.js +var NON_VARIABLE_OPTIONS = [ + "method", + "baseUrl", + "url", + "headers", + "request", + "query", + "mediaType" +]; +var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; +var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request2, query, options) { + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject( + new Error(`[@octokit/graphql] "query" cannot be used as variable name`) ); } - if (status === 204 || status === 205) { - return; - } - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } - throw new import_request_error.RequestError(response.statusText, status, { - response: { - url, - status, - headers, - data: void 0 - }, - request: requestOptions - }); - } - if (status === 304) { - throw new import_request_error.RequestError("Not modified", status, { - response: { - url, - status, - headers, - data: await getResponseData(response) - }, - request: requestOptions - }); + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) + continue; + return Promise.reject( + new Error( + `[@octokit/graphql] "${key}" cannot be used as variable name` + ) + ); } - if (status >= 400) { - const data = await getResponseData(response); - const error = new import_request_error.RequestError(toErrorMessage(data), status, { - response: { - url, - status, - headers, - data - }, - request: requestOptions - }); - throw error; + } + const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; + const requestOptions = Object.keys( + parsedOptions + ).reduce((result, key) => { + if (NON_VARIABLE_OPTIONS.includes(key)) { + result[key] = parsedOptions[key]; + return result; } - return parseSuccessResponseBody ? await getResponseData(response) : response.body; - }).then((data) => { - return { - status, - url, - headers, - data - }; - }).catch((error) => { - if (error instanceof import_request_error.RequestError) - throw error; - else if (error.name === "AbortError") - throw error; - let message = error.message; - if (error.name === "TypeError" && "cause" in error) { - if (error.cause instanceof Error) { - message = error.cause.message; - } else if (typeof error.cause === "string") { - message = error.cause; - } + if (!result.variables) { + result.variables = {}; } - throw new import_request_error.RequestError(message, 500, { - request: requestOptions - }); - }); -} -async function getResponseData(response) { - const contentType = response.headers.get("content-type"); - if (/application\/json/.test(contentType)) { - return response.json().catch(() => response.text()).catch(() => ""); - } - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); + result.variables[key] = parsedOptions[key]; + return result; + }, {}); + const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl; + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); } - return getBufferResponse(response); -} -function toErrorMessage(data) { - if (typeof data === "string") - return data; - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + return request2(requestOptions).then((response) => { + if (response.data.errors) { + const headers = {}; + for (const key of Object.keys(response.headers)) { + headers[key] = response.headers[key]; + } + throw new GraphqlResponseError( + requestOptions, + headers, + response.data + ); } - return data.message; - } - return `Unknown error: ${JSON.stringify(data)}`; + return response.data.data; + }); } // pkg/dist-src/with-defaults.js -function withDefaults(oldEndpoint, newDefaults) { - const endpoint2 = oldEndpoint.defaults(newDefaults); - const newApi = function(route, parameters) { - const endpointOptions = endpoint2.merge(route, parameters); - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper(endpoint2.parse(endpointOptions)); - } - const request2 = (route2, parameters2) => { - return fetchWrapper( - endpoint2.parse(endpoint2.merge(route2, parameters2)) - ); - }; - Object.assign(request2, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) - }); - return endpointOptions.request.hook(request2, endpointOptions); +function withDefaults(request2, newDefaults) { + const newRequest = request2.defaults(newDefaults); + const newApi = (query, options) => { + return graphql(newRequest, query, options); }; return Object.assign(newApi, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) + defaults: withDefaults.bind(null, newRequest), + endpoint: newRequest.endpoint }); } // pkg/dist-src/index.js -var request = withDefaults(import_endpoint.endpoint, { +var graphql2 = withDefaults(import_request3.request, { headers: { - "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` - } + "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` + }, + method: "POST", + url: "/graphql" }); +function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); +} // Annotate the CommonJS export names for ESM import in node: 0 && (0); /***/ }), -/***/ 20940: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 64193: +/***/ ((module) => { -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; +"use strict"; -apiLoader.services['accessanalyzer'] = {}; -AWS.AccessAnalyzer = Service.defineService('accessanalyzer', ['2019-11-01']); -Object.defineProperty(apiLoader.services['accessanalyzer'], '2019-11-01', { - get: function get() { - var model = __nccwpck_require__(30590); - model.paginators = (__nccwpck_require__(63080)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true -}); +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -module.exports = AWS.AccessAnalyzer; +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + composePaginateRest: () => composePaginateRest, + isPaginatingEndpoint: () => isPaginatingEndpoint, + paginateRest: () => paginateRest, + paginatingEndpoints: () => paginatingEndpoints +}); +module.exports = __toCommonJS(dist_src_exports); +// pkg/dist-src/version.js +var VERSION = "9.2.1"; -/***/ }), +// pkg/dist-src/normalize-paginated-list-response.js +function normalizePaginatedListResponse(response) { + if (!response.data) { + return { + ...response, + data: [] + }; + } + const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); + if (!responseNeedsNormalization) + return response; + const incompleteResults = response.data.incomplete_results; + const repositorySelection = response.data.repository_selection; + const totalCount = response.data.total_count; + delete response.data.incomplete_results; + delete response.data.repository_selection; + delete response.data.total_count; + const namespaceKey = Object.keys(response.data)[0]; + const data = response.data[namespaceKey]; + response.data = data; + if (typeof incompleteResults !== "undefined") { + response.data.incomplete_results = incompleteResults; + } + if (typeof repositorySelection !== "undefined") { + response.data.repository_selection = repositorySelection; + } + response.data.total_count = totalCount; + return response; +} -/***/ 32400: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// pkg/dist-src/iterator.js +function iterator(octokit, route, parameters) { + const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); + const requestMethod = typeof route === "function" ? route : octokit.request; + const method = options.method; + const headers = options.headers; + let url = options.url; + return { + [Symbol.asyncIterator]: () => ({ + async next() { + if (!url) + return { done: true }; + try { + const response = await requestMethod({ method, url, headers }); + const normalizedResponse = normalizePaginatedListResponse(response); + url = ((normalizedResponse.headers.link || "").match( + /<([^>]+)>;\s*rel="next"/ + ) || [])[1]; + return { value: normalizedResponse }; + } catch (error) { + if (error.status !== 409) + throw error; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [] + } + }; + } + } + }) + }; +} -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; +// pkg/dist-src/paginate.js +function paginate(octokit, route, parameters, mapFn) { + if (typeof parameters === "function") { + mapFn = parameters; + parameters = void 0; + } + return gather( + octokit, + [], + iterator(octokit, route, parameters)[Symbol.asyncIterator](), + mapFn + ); +} +function gather(octokit, results, iterator2, mapFn) { + return iterator2.next().then((result) => { + if (result.done) { + return results; + } + let earlyExit = false; + function done() { + earlyExit = true; + } + results = results.concat( + mapFn ? mapFn(result.value, done) : result.value.data + ); + if (earlyExit) { + return results; + } + return gather(octokit, results, iterator2, mapFn); + }); +} -apiLoader.services['account'] = {}; -AWS.Account = Service.defineService('account', ['2021-02-01']); -Object.defineProperty(apiLoader.services['account'], '2021-02-01', { - get: function get() { - var model = __nccwpck_require__(36713); - model.paginators = (__nccwpck_require__(52324)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true +// pkg/dist-src/compose-paginate.js +var composePaginateRest = Object.assign(paginate, { + iterator }); -module.exports = AWS.Account; - +// pkg/dist-src/generated/paginating-endpoints.js +var paginatingEndpoints = [ + "GET /advisories", + "GET /app/hook/deliveries", + "GET /app/installation-requests", + "GET /app/installations", + "GET /assignments/{assignment_id}/accepted_assignments", + "GET /classrooms", + "GET /classrooms/{classroom_id}/assignments", + "GET /enterprises/{enterprise}/dependabot/alerts", + "GET /enterprises/{enterprise}/secret-scanning/alerts", + "GET /events", + "GET /gists", + "GET /gists/public", + "GET /gists/starred", + "GET /gists/{gist_id}/comments", + "GET /gists/{gist_id}/commits", + "GET /gists/{gist_id}/forks", + "GET /installation/repositories", + "GET /issues", + "GET /licenses", + "GET /marketplace_listing/plans", + "GET /marketplace_listing/plans/{plan_id}/accounts", + "GET /marketplace_listing/stubbed/plans", + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", + "GET /networks/{owner}/{repo}/events", + "GET /notifications", + "GET /organizations", + "GET /orgs/{org}/actions/cache/usage-by-repository", + "GET /orgs/{org}/actions/permissions/repositories", + "GET /orgs/{org}/actions/runners", + "GET /orgs/{org}/actions/secrets", + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", + "GET /orgs/{org}/actions/variables", + "GET /orgs/{org}/actions/variables/{name}/repositories", + "GET /orgs/{org}/blocks", + "GET /orgs/{org}/code-scanning/alerts", + "GET /orgs/{org}/codespaces", + "GET /orgs/{org}/codespaces/secrets", + "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories", + "GET /orgs/{org}/copilot/billing/seats", + "GET /orgs/{org}/dependabot/alerts", + "GET /orgs/{org}/dependabot/secrets", + "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", + "GET /orgs/{org}/events", + "GET /orgs/{org}/failed_invitations", + "GET /orgs/{org}/hooks", + "GET /orgs/{org}/hooks/{hook_id}/deliveries", + "GET /orgs/{org}/installations", + "GET /orgs/{org}/invitations", + "GET /orgs/{org}/invitations/{invitation_id}/teams", + "GET /orgs/{org}/issues", + "GET /orgs/{org}/members", + "GET /orgs/{org}/members/{username}/codespaces", + "GET /orgs/{org}/migrations", + "GET /orgs/{org}/migrations/{migration_id}/repositories", + "GET /orgs/{org}/organization-roles/{role_id}/teams", + "GET /orgs/{org}/organization-roles/{role_id}/users", + "GET /orgs/{org}/outside_collaborators", + "GET /orgs/{org}/packages", + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + "GET /orgs/{org}/personal-access-token-requests", + "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories", + "GET /orgs/{org}/personal-access-tokens", + "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories", + "GET /orgs/{org}/projects", + "GET /orgs/{org}/properties/values", + "GET /orgs/{org}/public_members", + "GET /orgs/{org}/repos", + "GET /orgs/{org}/rulesets", + "GET /orgs/{org}/rulesets/rule-suites", + "GET /orgs/{org}/secret-scanning/alerts", + "GET /orgs/{org}/security-advisories", + "GET /orgs/{org}/teams", + "GET /orgs/{org}/teams/{team_slug}/discussions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/invitations", + "GET /orgs/{org}/teams/{team_slug}/members", + "GET /orgs/{org}/teams/{team_slug}/projects", + "GET /orgs/{org}/teams/{team_slug}/repos", + "GET /orgs/{org}/teams/{team_slug}/teams", + "GET /projects/columns/{column_id}/cards", + "GET /projects/{project_id}/collaborators", + "GET /projects/{project_id}/columns", + "GET /repos/{owner}/{repo}/actions/artifacts", + "GET /repos/{owner}/{repo}/actions/caches", + "GET /repos/{owner}/{repo}/actions/organization-secrets", + "GET /repos/{owner}/{repo}/actions/organization-variables", + "GET /repos/{owner}/{repo}/actions/runners", + "GET /repos/{owner}/{repo}/actions/runs", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", + "GET /repos/{owner}/{repo}/actions/secrets", + "GET /repos/{owner}/{repo}/actions/variables", + "GET /repos/{owner}/{repo}/actions/workflows", + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", + "GET /repos/{owner}/{repo}/activity", + "GET /repos/{owner}/{repo}/assignees", + "GET /repos/{owner}/{repo}/branches", + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", + "GET /repos/{owner}/{repo}/code-scanning/alerts", + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + "GET /repos/{owner}/{repo}/code-scanning/analyses", + "GET /repos/{owner}/{repo}/codespaces", + "GET /repos/{owner}/{repo}/codespaces/devcontainers", + "GET /repos/{owner}/{repo}/codespaces/secrets", + "GET /repos/{owner}/{repo}/collaborators", + "GET /repos/{owner}/{repo}/comments", + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/commits", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", + "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", + "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", + "GET /repos/{owner}/{repo}/commits/{ref}/status", + "GET /repos/{owner}/{repo}/commits/{ref}/statuses", + "GET /repos/{owner}/{repo}/contributors", + "GET /repos/{owner}/{repo}/dependabot/alerts", + "GET /repos/{owner}/{repo}/dependabot/secrets", + "GET /repos/{owner}/{repo}/deployments", + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", + "GET /repos/{owner}/{repo}/environments", + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps", + "GET /repos/{owner}/{repo}/events", + "GET /repos/{owner}/{repo}/forks", + "GET /repos/{owner}/{repo}/hooks", + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", + "GET /repos/{owner}/{repo}/invitations", + "GET /repos/{owner}/{repo}/issues", + "GET /repos/{owner}/{repo}/issues/comments", + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/issues/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", + "GET /repos/{owner}/{repo}/issues/{issue_number}/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", + "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", + "GET /repos/{owner}/{repo}/keys", + "GET /repos/{owner}/{repo}/labels", + "GET /repos/{owner}/{repo}/milestones", + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", + "GET /repos/{owner}/{repo}/notifications", + "GET /repos/{owner}/{repo}/pages/builds", + "GET /repos/{owner}/{repo}/projects", + "GET /repos/{owner}/{repo}/pulls", + "GET /repos/{owner}/{repo}/pulls/comments", + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", + "GET /repos/{owner}/{repo}/releases", + "GET /repos/{owner}/{repo}/releases/{release_id}/assets", + "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", + "GET /repos/{owner}/{repo}/rules/branches/{branch}", + "GET /repos/{owner}/{repo}/rulesets", + "GET /repos/{owner}/{repo}/rulesets/rule-suites", + "GET /repos/{owner}/{repo}/secret-scanning/alerts", + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", + "GET /repos/{owner}/{repo}/security-advisories", + "GET /repos/{owner}/{repo}/stargazers", + "GET /repos/{owner}/{repo}/subscribers", + "GET /repos/{owner}/{repo}/tags", + "GET /repos/{owner}/{repo}/teams", + "GET /repos/{owner}/{repo}/topics", + "GET /repositories", + "GET /repositories/{repository_id}/environments/{environment_name}/secrets", + "GET /repositories/{repository_id}/environments/{environment_name}/variables", + "GET /search/code", + "GET /search/commits", + "GET /search/issues", + "GET /search/labels", + "GET /search/repositories", + "GET /search/topics", + "GET /search/users", + "GET /teams/{team_id}/discussions", + "GET /teams/{team_id}/discussions/{discussion_number}/comments", + "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /teams/{team_id}/discussions/{discussion_number}/reactions", + "GET /teams/{team_id}/invitations", + "GET /teams/{team_id}/members", + "GET /teams/{team_id}/projects", + "GET /teams/{team_id}/repos", + "GET /teams/{team_id}/teams", + "GET /user/blocks", + "GET /user/codespaces", + "GET /user/codespaces/secrets", + "GET /user/emails", + "GET /user/followers", + "GET /user/following", + "GET /user/gpg_keys", + "GET /user/installations", + "GET /user/installations/{installation_id}/repositories", + "GET /user/issues", + "GET /user/keys", + "GET /user/marketplace_purchases", + "GET /user/marketplace_purchases/stubbed", + "GET /user/memberships/orgs", + "GET /user/migrations", + "GET /user/migrations/{migration_id}/repositories", + "GET /user/orgs", + "GET /user/packages", + "GET /user/packages/{package_type}/{package_name}/versions", + "GET /user/public_emails", + "GET /user/repos", + "GET /user/repository_invitations", + "GET /user/social_accounts", + "GET /user/ssh_signing_keys", + "GET /user/starred", + "GET /user/subscriptions", + "GET /user/teams", + "GET /users", + "GET /users/{username}/events", + "GET /users/{username}/events/orgs/{org}", + "GET /users/{username}/events/public", + "GET /users/{username}/followers", + "GET /users/{username}/following", + "GET /users/{username}/gists", + "GET /users/{username}/gpg_keys", + "GET /users/{username}/keys", + "GET /users/{username}/orgs", + "GET /users/{username}/packages", + "GET /users/{username}/projects", + "GET /users/{username}/received_events", + "GET /users/{username}/received_events/public", + "GET /users/{username}/repos", + "GET /users/{username}/social_accounts", + "GET /users/{username}/ssh_signing_keys", + "GET /users/{username}/starred", + "GET /users/{username}/subscriptions" +]; -/***/ }), +// pkg/dist-src/paginating-endpoints.js +function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } else { + return false; + } +} -/***/ 30838: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// pkg/dist-src/index.js +function paginateRest(octokit) { + return { + paginate: Object.assign(paginate.bind(null, octokit), { + iterator: iterator.bind(null, octokit) + }) + }; +} +paginateRest.VERSION = VERSION; +// Annotate the CommonJS export names for ESM import in node: +0 && (0); -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; -apiLoader.services['acm'] = {}; -AWS.ACM = Service.defineService('acm', ['2015-12-08']); -Object.defineProperty(apiLoader.services['acm'], '2015-12-08', { - get: function get() { - var model = __nccwpck_require__(34662); - model.paginators = (__nccwpck_require__(42680)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(85678)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); +/***/ }), -module.exports = AWS.ACM; +/***/ 83044: +/***/ ((module) => { +"use strict"; -/***/ }), +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -/***/ 18450: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + legacyRestEndpointMethods: () => legacyRestEndpointMethods, + restEndpointMethods: () => restEndpointMethods +}); +module.exports = __toCommonJS(dist_src_exports); -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; +// pkg/dist-src/version.js +var VERSION = "10.4.1"; -apiLoader.services['acmpca'] = {}; -AWS.ACMPCA = Service.defineService('acmpca', ['2017-08-22']); -Object.defineProperty(apiLoader.services['acmpca'], '2017-08-22', { - get: function get() { - var model = __nccwpck_require__(33004); - model.paginators = (__nccwpck_require__(21209)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(89217)/* .waiters */ .V); - return model; +// pkg/dist-src/generated/endpoints.js +var Endpoints = { + actions: { + addCustomLabelsToSelfHostedRunnerForOrg: [ + "POST /orgs/{org}/actions/runners/{runner_id}/labels" + ], + addCustomLabelsToSelfHostedRunnerForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + addSelectedRepoToOrgSecret: [ + "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" + ], + addSelectedRepoToOrgVariable: [ + "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" + ], + approveWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve" + ], + cancelWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel" + ], + createEnvironmentVariable: [ + "POST /repositories/{repository_id}/environments/{environment_name}/variables" + ], + createOrUpdateEnvironmentSecret: [ + "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" + ], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], + createOrUpdateRepoSecret: [ + "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" + ], + createOrgVariable: ["POST /orgs/{org}/actions/variables"], + createRegistrationTokenForOrg: [ + "POST /orgs/{org}/actions/runners/registration-token" + ], + createRegistrationTokenForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/registration-token" + ], + createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], + createRemoveTokenForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/remove-token" + ], + createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"], + createWorkflowDispatch: [ + "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" + ], + deleteActionsCacheById: [ + "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}" + ], + deleteActionsCacheByKey: [ + "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}" + ], + deleteArtifact: [ + "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}" + ], + deleteEnvironmentSecret: [ + "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" + ], + deleteEnvironmentVariable: [ + "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}" + ], + deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], + deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], + deleteRepoSecret: [ + "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}" + ], + deleteRepoVariable: [ + "DELETE /repos/{owner}/{repo}/actions/variables/{name}" + ], + deleteSelfHostedRunnerFromOrg: [ + "DELETE /orgs/{org}/actions/runners/{runner_id}" + ], + deleteSelfHostedRunnerFromRepo: [ + "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" + ], + deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], + deleteWorkflowRunLogs: [ + "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" + ], + disableSelectedRepositoryGithubActionsOrganization: [ + "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}" + ], + disableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable" + ], + downloadArtifact: [ + "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}" + ], + downloadJobLogsForWorkflowRun: [ + "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs" + ], + downloadWorkflowRunAttemptLogs: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs" + ], + downloadWorkflowRunLogs: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs" + ], + enableSelectedRepositoryGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}" + ], + enableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable" + ], + forceCancelWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel" + ], + generateRunnerJitconfigForOrg: [ + "POST /orgs/{org}/actions/runners/generate-jitconfig" + ], + generateRunnerJitconfigForRepo: [ + "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig" + ], + getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], + getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], + getActionsCacheUsageByRepoForOrg: [ + "GET /orgs/{org}/actions/cache/usage-by-repository" + ], + getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], + getAllowedActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/selected-actions" + ], + getAllowedActionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" + ], + getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getCustomOidcSubClaimForRepo: [ + "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], + getEnvironmentPublicKey: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" + ], + getEnvironmentSecret: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" + ], + getEnvironmentVariable: [ + "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}" + ], + getGithubActionsDefaultWorkflowPermissionsOrganization: [ + "GET /orgs/{org}/actions/permissions/workflow" + ], + getGithubActionsDefaultWorkflowPermissionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/workflow" + ], + getGithubActionsPermissionsOrganization: [ + "GET /orgs/{org}/actions/permissions" + ], + getGithubActionsPermissionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions" + ], + getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], + getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"], + getPendingDeploymentsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" + ], + getRepoPermissions: [ + "GET /repos/{owner}/{repo}/actions/permissions", + {}, + { renamed: ["actions", "getGithubActionsPermissionsRepository"] } + ], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"], + getReviewsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals" + ], + getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], + getSelfHostedRunnerForRepo: [ + "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" + ], + getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], + getWorkflowAccessToRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/access" + ], + getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], + getWorkflowRunAttempt: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}" + ], + getWorkflowRunUsage: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing" + ], + getWorkflowUsage: [ + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing" + ], + listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets" + ], + listEnvironmentVariables: [ + "GET /repositories/{repository_id}/environments/{environment_name}/variables" + ], + listJobsForWorkflowRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs" + ], + listJobsForWorkflowRunAttempt: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs" + ], + listLabelsForSelfHostedRunnerForOrg: [ + "GET /orgs/{org}/actions/runners/{runner_id}/labels" + ], + listLabelsForSelfHostedRunnerForRepo: [ + "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], + listOrgVariables: ["GET /orgs/{org}/actions/variables"], + listRepoOrganizationSecrets: [ + "GET /repos/{owner}/{repo}/actions/organization-secrets" + ], + listRepoOrganizationVariables: [ + "GET /repos/{owner}/{repo}/actions/organization-variables" + ], + listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], + listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"], + listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], + listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], + listRunnerApplicationsForRepo: [ + "GET /repos/{owner}/{repo}/actions/runners/downloads" + ], + listSelectedReposForOrgSecret: [ + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories" + ], + listSelectedReposForOrgVariable: [ + "GET /orgs/{org}/actions/variables/{name}/repositories" + ], + listSelectedRepositoriesEnabledGithubActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/repositories" + ], + listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], + listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], + listWorkflowRunArtifacts: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts" + ], + listWorkflowRuns: [ + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" + ], + listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], + reRunJobForWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" + ], + reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], + reRunWorkflowFailedJobs: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" + ], + removeAllCustomLabelsFromSelfHostedRunnerForOrg: [ + "DELETE /orgs/{org}/actions/runners/{runner_id}/labels" + ], + removeAllCustomLabelsFromSelfHostedRunnerForRepo: [ + "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + removeCustomLabelFromSelfHostedRunnerForOrg: [ + "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}" + ], + removeCustomLabelFromSelfHostedRunnerForRepo: [ + "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}" + ], + removeSelectedRepoFromOrgSecret: [ + "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" + ], + removeSelectedRepoFromOrgVariable: [ + "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" + ], + reviewCustomGatesForRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" + ], + reviewPendingDeploymentsForRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" + ], + setAllowedActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/selected-actions" + ], + setAllowedActionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions" + ], + setCustomLabelsForSelfHostedRunnerForOrg: [ + "PUT /orgs/{org}/actions/runners/{runner_id}/labels" + ], + setCustomLabelsForSelfHostedRunnerForRepo: [ + "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" + ], + setCustomOidcSubClaimForRepo: [ + "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], + setGithubActionsDefaultWorkflowPermissionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/workflow" + ], + setGithubActionsDefaultWorkflowPermissionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/workflow" + ], + setGithubActionsPermissionsOrganization: [ + "PUT /orgs/{org}/actions/permissions" + ], + setGithubActionsPermissionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions" + ], + setSelectedReposForOrgSecret: [ + "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories" + ], + setSelectedReposForOrgVariable: [ + "PUT /orgs/{org}/actions/variables/{name}/repositories" + ], + setSelectedRepositoriesEnabledGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories" + ], + setWorkflowAccessToRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/access" + ], + updateEnvironmentVariable: [ + "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}" + ], + updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"], + updateRepoVariable: [ + "PATCH /repos/{owner}/{repo}/actions/variables/{name}" + ] + }, + activity: { + checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], + deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], + deleteThreadSubscription: [ + "DELETE /notifications/threads/{thread_id}/subscription" + ], + getFeeds: ["GET /feeds"], + getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], + getThread: ["GET /notifications/threads/{thread_id}"], + getThreadSubscriptionForAuthenticatedUser: [ + "GET /notifications/threads/{thread_id}/subscription" + ], + listEventsForAuthenticatedUser: ["GET /users/{username}/events"], + listNotificationsForAuthenticatedUser: ["GET /notifications"], + listOrgEventsForAuthenticatedUser: [ + "GET /users/{username}/events/orgs/{org}" + ], + listPublicEvents: ["GET /events"], + listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], + listPublicEventsForUser: ["GET /users/{username}/events/public"], + listPublicOrgEvents: ["GET /orgs/{org}/events"], + listReceivedEventsForUser: ["GET /users/{username}/received_events"], + listReceivedPublicEventsForUser: [ + "GET /users/{username}/received_events/public" + ], + listRepoEvents: ["GET /repos/{owner}/{repo}/events"], + listRepoNotificationsForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/notifications" + ], + listReposStarredByAuthenticatedUser: ["GET /user/starred"], + listReposStarredByUser: ["GET /users/{username}/starred"], + listReposWatchedByUser: ["GET /users/{username}/subscriptions"], + listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], + listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], + listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], + markNotificationsAsRead: ["PUT /notifications"], + markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], + markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], + setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], + setThreadSubscription: [ + "PUT /notifications/threads/{thread_id}/subscription" + ], + starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], + unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] + }, + apps: { + addRepoToInstallation: [ + "PUT /user/installations/{installation_id}/repositories/{repository_id}", + {}, + { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] } + ], + addRepoToInstallationForAuthenticatedUser: [ + "PUT /user/installations/{installation_id}/repositories/{repository_id}" + ], + checkToken: ["POST /applications/{client_id}/token"], + createFromManifest: ["POST /app-manifests/{code}/conversions"], + createInstallationAccessToken: [ + "POST /app/installations/{installation_id}/access_tokens" + ], + deleteAuthorization: ["DELETE /applications/{client_id}/grant"], + deleteInstallation: ["DELETE /app/installations/{installation_id}"], + deleteToken: ["DELETE /applications/{client_id}/token"], + getAuthenticated: ["GET /app"], + getBySlug: ["GET /apps/{app_slug}"], + getInstallation: ["GET /app/installations/{installation_id}"], + getOrgInstallation: ["GET /orgs/{org}/installation"], + getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], + getSubscriptionPlanForAccount: [ + "GET /marketplace_listing/accounts/{account_id}" + ], + getSubscriptionPlanForAccountStubbed: [ + "GET /marketplace_listing/stubbed/accounts/{account_id}" + ], + getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], + listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], + listAccountsForPlanStubbed: [ + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts" + ], + listInstallationReposForAuthenticatedUser: [ + "GET /user/installations/{installation_id}/repositories" + ], + listInstallationRequestsForAuthenticatedApp: [ + "GET /app/installation-requests" + ], + listInstallations: ["GET /app/installations"], + listInstallationsForAuthenticatedUser: ["GET /user/installations"], + listPlans: ["GET /marketplace_listing/plans"], + listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], + listReposAccessibleToInstallation: ["GET /installation/repositories"], + listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], + listSubscriptionsForAuthenticatedUserStubbed: [ + "GET /user/marketplace_purchases/stubbed" + ], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: [ + "POST /app/hook/deliveries/{delivery_id}/attempts" + ], + removeRepoFromInstallation: [ + "DELETE /user/installations/{installation_id}/repositories/{repository_id}", + {}, + { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] } + ], + removeRepoFromInstallationForAuthenticatedUser: [ + "DELETE /user/installations/{installation_id}/repositories/{repository_id}" + ], + resetToken: ["PATCH /applications/{client_id}/token"], + revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], + suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], + unsuspendInstallation: [ + "DELETE /app/installations/{installation_id}/suspended" + ], + updateWebhookConfigForApp: ["PATCH /app/hook/config"] + }, + billing: { + getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], + getGithubActionsBillingUser: [ + "GET /users/{username}/settings/billing/actions" + ], + getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], + getGithubPackagesBillingUser: [ + "GET /users/{username}/settings/billing/packages" + ], + getSharedStorageBillingOrg: [ + "GET /orgs/{org}/settings/billing/shared-storage" + ], + getSharedStorageBillingUser: [ + "GET /users/{username}/settings/billing/shared-storage" + ] + }, + checks: { + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], + listAnnotations: [ + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations" + ], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], + listForSuite: [ + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" + ], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], + rerequestRun: [ + "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" + ], + rerequestSuite: [ + "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest" + ], + setSuitesPreferences: [ + "PATCH /repos/{owner}/{repo}/check-suites/preferences" + ], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] + }, + codeScanning: { + deleteAnalysis: [ + "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}" + ], + getAlert: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", + {}, + { renamedParameters: { alert_id: "alert_number" } } + ], + getAnalysis: [ + "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}" + ], + getCodeqlDatabase: [ + "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" + ], + getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" + ], + listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + {}, + { renamed: ["codeScanning", "listAlertInstances"] } + ], + listCodeqlDatabases: [ + "GET /repos/{owner}/{repo}/code-scanning/codeql/databases" + ], + listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" + ], + updateDefaultSetup: [ + "PATCH /repos/{owner}/{repo}/code-scanning/default-setup" + ], + uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.ACMPCA; - - -/***/ }), - -/***/ 14578: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['alexaforbusiness'] = {}; -AWS.AlexaForBusiness = Service.defineService('alexaforbusiness', ['2017-11-09']); -Object.defineProperty(apiLoader.services['alexaforbusiness'], '2017-11-09', { - get: function get() { - var model = __nccwpck_require__(69786); - model.paginators = (__nccwpck_require__(21009)/* .pagination */ .o); - return model; + codesOfConduct: { + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AlexaForBusiness; - - -/***/ }), - -/***/ 26296: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -module.exports = { - ACM: __nccwpck_require__(30838), - APIGateway: __nccwpck_require__(91759), - ApplicationAutoScaling: __nccwpck_require__(25598), - AppStream: __nccwpck_require__(21730), - AutoScaling: __nccwpck_require__(31652), - Batch: __nccwpck_require__(10000), - Budgets: __nccwpck_require__(43923), - CloudDirectory: __nccwpck_require__(56231), - CloudFormation: __nccwpck_require__(74643), - CloudFront: __nccwpck_require__(48058), - CloudHSM: __nccwpck_require__(59976), - CloudSearch: __nccwpck_require__(72321), - CloudSearchDomain: __nccwpck_require__(64072), - CloudTrail: __nccwpck_require__(65512), - CloudWatch: __nccwpck_require__(6763), - CloudWatchEvents: __nccwpck_require__(38124), - CloudWatchLogs: __nccwpck_require__(96693), - CodeBuild: __nccwpck_require__(60450), - CodeCommit: __nccwpck_require__(71323), - CodeDeploy: __nccwpck_require__(54599), - CodePipeline: __nccwpck_require__(22938), - CognitoIdentity: __nccwpck_require__(58291), - CognitoIdentityServiceProvider: __nccwpck_require__(31379), - CognitoSync: __nccwpck_require__(74770), - ConfigService: __nccwpck_require__(34061), - CUR: __nccwpck_require__(5026), - DataPipeline: __nccwpck_require__(65688), - DeviceFarm: __nccwpck_require__(26272), - DirectConnect: __nccwpck_require__(73783), - DirectoryService: __nccwpck_require__(83908), - Discovery: __nccwpck_require__(81690), - DMS: __nccwpck_require__(69868), - DynamoDB: __nccwpck_require__(14347), - DynamoDBStreams: __nccwpck_require__(88090), - EC2: __nccwpck_require__(7778), - ECR: __nccwpck_require__(15211), - ECS: __nccwpck_require__(16615), - EFS: __nccwpck_require__(34375), - ElastiCache: __nccwpck_require__(81065), - ElasticBeanstalk: __nccwpck_require__(14897), - ELB: __nccwpck_require__(10907), - ELBv2: __nccwpck_require__(44311), - EMR: __nccwpck_require__(50470), - ES: __nccwpck_require__(84462), - ElasticTranscoder: __nccwpck_require__(40745), - Firehose: __nccwpck_require__(92831), - GameLift: __nccwpck_require__(8085), - Glacier: __nccwpck_require__(63249), - Health: __nccwpck_require__(21834), - IAM: __nccwpck_require__(50058), - ImportExport: __nccwpck_require__(6769), - Inspector: __nccwpck_require__(89439), - Iot: __nccwpck_require__(98392), - IotData: __nccwpck_require__(6564), - Kinesis: __nccwpck_require__(49876), - KinesisAnalytics: __nccwpck_require__(90042), - KMS: __nccwpck_require__(56782), - Lambda: __nccwpck_require__(13321), - LexRuntime: __nccwpck_require__(62716), - Lightsail: __nccwpck_require__(22718), - MachineLearning: __nccwpck_require__(82907), - MarketplaceCommerceAnalytics: __nccwpck_require__(4540), - MarketplaceMetering: __nccwpck_require__(39297), - MTurk: __nccwpck_require__(79954), - MobileAnalytics: __nccwpck_require__(66690), - OpsWorks: __nccwpck_require__(75691), - OpsWorksCM: __nccwpck_require__(80388), - Organizations: __nccwpck_require__(52560), - Pinpoint: __nccwpck_require__(18388), - Polly: __nccwpck_require__(97332), - RDS: __nccwpck_require__(71578), - Redshift: __nccwpck_require__(84853), - Rekognition: __nccwpck_require__(65470), - ResourceGroupsTaggingAPI: __nccwpck_require__(7385), - Route53: __nccwpck_require__(44968), - Route53Domains: __nccwpck_require__(51994), - S3: __nccwpck_require__(83256), - S3Control: __nccwpck_require__(99817), - ServiceCatalog: __nccwpck_require__(822), - SES: __nccwpck_require__(46816), - Shield: __nccwpck_require__(20271), - SimpleDB: __nccwpck_require__(10120), - SMS: __nccwpck_require__(57719), - Snowball: __nccwpck_require__(510), - SNS: __nccwpck_require__(28581), - SQS: __nccwpck_require__(63172), - SSM: __nccwpck_require__(83380), - StorageGateway: __nccwpck_require__(89190), - StepFunctions: __nccwpck_require__(8136), - STS: __nccwpck_require__(57513), - Support: __nccwpck_require__(1099), - SWF: __nccwpck_require__(32327), - XRay: __nccwpck_require__(41548), - WAF: __nccwpck_require__(72742), - WAFRegional: __nccwpck_require__(23153), - WorkDocs: __nccwpck_require__(38835), - WorkSpaces: __nccwpck_require__(25513), - CodeStar: __nccwpck_require__(98336), - LexModelBuildingService: __nccwpck_require__(37397), - MarketplaceEntitlementService: __nccwpck_require__(53707), - Athena: __nccwpck_require__(29434), - Greengrass: __nccwpck_require__(20690), - DAX: __nccwpck_require__(71398), - MigrationHub: __nccwpck_require__(14688), - CloudHSMV2: __nccwpck_require__(70889), - Glue: __nccwpck_require__(31658), - Mobile: __nccwpck_require__(39782), - Pricing: __nccwpck_require__(92765), - CostExplorer: __nccwpck_require__(79523), - MediaConvert: __nccwpck_require__(57220), - MediaLive: __nccwpck_require__(7509), - MediaPackage: __nccwpck_require__(91620), - MediaStore: __nccwpck_require__(83748), - MediaStoreData: __nccwpck_require__(98703), - AppSync: __nccwpck_require__(12402), - GuardDuty: __nccwpck_require__(40755), - MQ: __nccwpck_require__(23093), - Comprehend: __nccwpck_require__(62878), - IoTJobsDataPlane: __nccwpck_require__(42332), - KinesisVideoArchivedMedia: __nccwpck_require__(5580), - KinesisVideoMedia: __nccwpck_require__(81308), - KinesisVideo: __nccwpck_require__(89927), - SageMakerRuntime: __nccwpck_require__(85044), - SageMaker: __nccwpck_require__(77657), - Translate: __nccwpck_require__(72544), - ResourceGroups: __nccwpck_require__(58756), - AlexaForBusiness: __nccwpck_require__(14578), - Cloud9: __nccwpck_require__(85473), - ServerlessApplicationRepository: __nccwpck_require__(62402), - ServiceDiscovery: __nccwpck_require__(91569), - WorkMail: __nccwpck_require__(38374), - AutoScalingPlans: __nccwpck_require__(2554), - TranscribeService: __nccwpck_require__(75811), - Connect: __nccwpck_require__(13879), - ACMPCA: __nccwpck_require__(18450), - FMS: __nccwpck_require__(11316), - SecretsManager: __nccwpck_require__(85131), - IoTAnalytics: __nccwpck_require__(67409), - IoT1ClickDevicesService: __nccwpck_require__(39474), - IoT1ClickProjects: __nccwpck_require__(4686), - PI: __nccwpck_require__(15505), - Neptune: __nccwpck_require__(30047), - MediaTailor: __nccwpck_require__(99658), - EKS: __nccwpck_require__(23337), - DLM: __nccwpck_require__(24958), - Signer: __nccwpck_require__(71596), - Chime: __nccwpck_require__(84646), - PinpointEmail: __nccwpck_require__(83060), - RAM: __nccwpck_require__(94394), - Route53Resolver: __nccwpck_require__(25894), - PinpointSMSVoice: __nccwpck_require__(46605), - QuickSight: __nccwpck_require__(29898), - RDSDataService: __nccwpck_require__(30147), - Amplify: __nccwpck_require__(38090), - DataSync: __nccwpck_require__(25308), - RoboMaker: __nccwpck_require__(18068), - Transfer: __nccwpck_require__(51585), - GlobalAccelerator: __nccwpck_require__(19306), - ComprehendMedical: __nccwpck_require__(32349), - KinesisAnalyticsV2: __nccwpck_require__(74631), - MediaConnect: __nccwpck_require__(67639), - FSx: __nccwpck_require__(60642), - SecurityHub: __nccwpck_require__(21550), - AppMesh: __nccwpck_require__(69226), - LicenseManager: __nccwpck_require__(34693), - Kafka: __nccwpck_require__(56775), - ApiGatewayManagementApi: __nccwpck_require__(31762), - ApiGatewayV2: __nccwpck_require__(44987), - DocDB: __nccwpck_require__(55129), - Backup: __nccwpck_require__(82455), - WorkLink: __nccwpck_require__(48579), - Textract: __nccwpck_require__(58523), - ManagedBlockchain: __nccwpck_require__(85143), - MediaPackageVod: __nccwpck_require__(14962), - GroundStation: __nccwpck_require__(80494), - IoTThingsGraph: __nccwpck_require__(58905), - IoTEvents: __nccwpck_require__(88065), - IoTEventsData: __nccwpck_require__(56973), - Personalize: __nccwpck_require__(33696), - PersonalizeEvents: __nccwpck_require__(88170), - PersonalizeRuntime: __nccwpck_require__(66184), - ApplicationInsights: __nccwpck_require__(83972), - ServiceQuotas: __nccwpck_require__(57800), - EC2InstanceConnect: __nccwpck_require__(92209), - EventBridge: __nccwpck_require__(898), - LakeFormation: __nccwpck_require__(6726), - ForecastService: __nccwpck_require__(12942), - ForecastQueryService: __nccwpck_require__(36822), - QLDB: __nccwpck_require__(71266), - QLDBSession: __nccwpck_require__(55423), - WorkMailMessageFlow: __nccwpck_require__(67025), - CodeStarNotifications: __nccwpck_require__(15141), - SavingsPlans: __nccwpck_require__(62825), - SSO: __nccwpck_require__(71096), - SSOOIDC: __nccwpck_require__(49870), - MarketplaceCatalog: __nccwpck_require__(2609), - DataExchange: __nccwpck_require__(11024), - SESV2: __nccwpck_require__(20142), - MigrationHubConfig: __nccwpck_require__(62658), - ConnectParticipant: __nccwpck_require__(94198), - AppConfig: __nccwpck_require__(78606), - IoTSecureTunneling: __nccwpck_require__(98562), - WAFV2: __nccwpck_require__(50353), - ElasticInference: __nccwpck_require__(37708), - Imagebuilder: __nccwpck_require__(57511), - Schemas: __nccwpck_require__(55713), - AccessAnalyzer: __nccwpck_require__(20940), - CodeGuruReviewer: __nccwpck_require__(60070), - CodeGuruProfiler: __nccwpck_require__(65704), - ComputeOptimizer: __nccwpck_require__(64459), - FraudDetector: __nccwpck_require__(99830), - Kendra: __nccwpck_require__(66122), - NetworkManager: __nccwpck_require__(37610), - Outposts: __nccwpck_require__(27551), - AugmentedAIRuntime: __nccwpck_require__(33960), - EBS: __nccwpck_require__(62837), - KinesisVideoSignalingChannels: __nccwpck_require__(12710), - Detective: __nccwpck_require__(60674), - CodeStarconnections: __nccwpck_require__(78270), - Synthetics: __nccwpck_require__(25910), - IoTSiteWise: __nccwpck_require__(89690), - Macie2: __nccwpck_require__(57330), - CodeArtifact: __nccwpck_require__(91983), - Honeycode: __nccwpck_require__(38889), - IVS: __nccwpck_require__(67701), - Braket: __nccwpck_require__(35429), - IdentityStore: __nccwpck_require__(60222), - Appflow: __nccwpck_require__(60844), - RedshiftData: __nccwpck_require__(203), - SSOAdmin: __nccwpck_require__(66644), - TimestreamQuery: __nccwpck_require__(24529), - TimestreamWrite: __nccwpck_require__(1573), - S3Outposts: __nccwpck_require__(90493), - DataBrew: __nccwpck_require__(35846), - ServiceCatalogAppRegistry: __nccwpck_require__(79068), - NetworkFirewall: __nccwpck_require__(84626), - MWAA: __nccwpck_require__(32712), - AmplifyBackend: __nccwpck_require__(2806), - AppIntegrations: __nccwpck_require__(85479), - ConnectContactLens: __nccwpck_require__(41847), - DevOpsGuru: __nccwpck_require__(90673), - ECRPUBLIC: __nccwpck_require__(90244), - LookoutVision: __nccwpck_require__(65046), - SageMakerFeatureStoreRuntime: __nccwpck_require__(67644), - CustomerProfiles: __nccwpck_require__(28379), - AuditManager: __nccwpck_require__(20472), - EMRcontainers: __nccwpck_require__(49984), - HealthLake: __nccwpck_require__(64254), - SagemakerEdge: __nccwpck_require__(38966), - Amp: __nccwpck_require__(96881), - GreengrassV2: __nccwpck_require__(45126), - IotDeviceAdvisor: __nccwpck_require__(97569), - IoTFleetHub: __nccwpck_require__(42513), - IoTWireless: __nccwpck_require__(8226), - Location: __nccwpck_require__(44594), - WellArchitected: __nccwpck_require__(86263), - LexModelsV2: __nccwpck_require__(27254), - LexRuntimeV2: __nccwpck_require__(33855), - Fis: __nccwpck_require__(73003), - LookoutMetrics: __nccwpck_require__(78708), - Mgn: __nccwpck_require__(41339), - LookoutEquipment: __nccwpck_require__(21843), - Nimble: __nccwpck_require__(89428), - Finspace: __nccwpck_require__(3052), - Finspacedata: __nccwpck_require__(96869), - SSMContacts: __nccwpck_require__(12577), - SSMIncidents: __nccwpck_require__(20590), - ApplicationCostProfiler: __nccwpck_require__(20887), - AppRunner: __nccwpck_require__(75589), - Proton: __nccwpck_require__(9275), - Route53RecoveryCluster: __nccwpck_require__(35738), - Route53RecoveryControlConfig: __nccwpck_require__(16063), - Route53RecoveryReadiness: __nccwpck_require__(79106), - ChimeSDKIdentity: __nccwpck_require__(55975), - ChimeSDKMessaging: __nccwpck_require__(25255), - SnowDeviceManagement: __nccwpck_require__(64655), - MemoryDB: __nccwpck_require__(50782), - OpenSearch: __nccwpck_require__(60358), - KafkaConnect: __nccwpck_require__(61879), - VoiceID: __nccwpck_require__(28747), - Wisdom: __nccwpck_require__(85266), - Account: __nccwpck_require__(32400), - CloudControl: __nccwpck_require__(25630), - Grafana: __nccwpck_require__(51050), - Panorama: __nccwpck_require__(20368), - ChimeSDKMeetings: __nccwpck_require__(80788), - Resiliencehub: __nccwpck_require__(21173), - MigrationHubStrategy: __nccwpck_require__(96533), - AppConfigData: __nccwpck_require__(45282), - Drs: __nccwpck_require__(41116), - MigrationHubRefactorSpaces: __nccwpck_require__(2925), - Evidently: __nccwpck_require__(21440), - Inspector2: __nccwpck_require__(98650), - Rbin: __nccwpck_require__(70145), - RUM: __nccwpck_require__(53237), - BackupGateway: __nccwpck_require__(68277), - IoTTwinMaker: __nccwpck_require__(65010), - WorkSpacesWeb: __nccwpck_require__(94124), - AmplifyUIBuilder: __nccwpck_require__(89937), - Keyspaces: __nccwpck_require__(24789), - Billingconductor: __nccwpck_require__(38416), - PinpointSMSVoiceV2: __nccwpck_require__(478), - Ivschat: __nccwpck_require__(17077), - ChimeSDKMediaPipelines: __nccwpck_require__(18423), - EMRServerless: __nccwpck_require__(219), - M2: __nccwpck_require__(22482), - ConnectCampaigns: __nccwpck_require__(42789), - RedshiftServerless: __nccwpck_require__(29987), - RolesAnywhere: __nccwpck_require__(83604), - LicenseManagerUserSubscriptions: __nccwpck_require__(37725), - BackupStorage: __nccwpck_require__(82304), - PrivateNetworks: __nccwpck_require__(63088), - SupportApp: __nccwpck_require__(51288), - ControlTower: __nccwpck_require__(77574), - IoTFleetWise: __nccwpck_require__(94329), - MigrationHubOrchestrator: __nccwpck_require__(66120), - ConnectCases: __nccwpck_require__(72223), - ResourceExplorer2: __nccwpck_require__(74071), - Scheduler: __nccwpck_require__(94840), - ChimeSDKVoice: __nccwpck_require__(349), - IoTRoboRunner: __nccwpck_require__(22163), - SsmSap: __nccwpck_require__(44552), - OAM: __nccwpck_require__(9319), - ARCZonalShift: __nccwpck_require__(54280), - Omics: __nccwpck_require__(75114), - OpenSearchServerless: __nccwpck_require__(86277), - SecurityLake: __nccwpck_require__(84296), - SimSpaceWeaver: __nccwpck_require__(37090), - DocDBElastic: __nccwpck_require__(20792), - SageMakerGeospatial: __nccwpck_require__(4707), - CodeCatalyst: __nccwpck_require__(19499), - Pipes: __nccwpck_require__(14220), - SageMakerMetrics: __nccwpck_require__(28199), - KinesisVideoWebRTCStorage: __nccwpck_require__(52642), - LicenseManagerLinuxSubscriptions: __nccwpck_require__(52687), - KendraRanking: __nccwpck_require__(46255), - CleanRooms: __nccwpck_require__(15130), - CloudTrailData: __nccwpck_require__(31191), - Tnb: __nccwpck_require__(15300), - InternetMonitor: __nccwpck_require__(84099), - IVSRealTime: __nccwpck_require__(51946), - VPCLattice: __nccwpck_require__(78952), - OSIS: __nccwpck_require__(98021), - MediaPackageV2: __nccwpck_require__(53264), - PaymentCryptography: __nccwpck_require__(11594), - PaymentCryptographyData: __nccwpck_require__(96559), - CodeGuruSecurity: __nccwpck_require__(32620), - VerifiedPermissions: __nccwpck_require__(35604), - AppFabric: __nccwpck_require__(46318), - MedicalImaging: __nccwpck_require__(79712), - EntityResolution: __nccwpck_require__(22697), - ManagedBlockchainQuery: __nccwpck_require__(51046), - Neptunedata: __nccwpck_require__(25737), - PcaConnectorAd: __nccwpck_require__(55959), - Bedrock: __nccwpck_require__(88808), - BedrockRuntime: __nccwpck_require__(99177), - DataZone: __nccwpck_require__(31763), - LaunchWizard: __nccwpck_require__(71060), - TrustedAdvisor: __nccwpck_require__(4992), - CloudFrontKeyValueStore: __nccwpck_require__(47859), - InspectorScan: __nccwpck_require__(25467), - BCMDataExports: __nccwpck_require__(56703), - CostOptimizationHub: __nccwpck_require__(55443), - EKSAuth: __nccwpck_require__(66164), - FreeTier: __nccwpck_require__(11681), - Repostspace: __nccwpck_require__(21154), - WorkSpacesThinClient: __nccwpck_require__(22033), - B2bi: __nccwpck_require__(91065), - BedrockAgent: __nccwpck_require__(9025), - BedrockAgentRuntime: __nccwpck_require__(16946), - QBusiness: __nccwpck_require__(26842), - QConnect: __nccwpck_require__(39094), - CleanRoomsML: __nccwpck_require__(47594), - MarketplaceAgreement: __nccwpck_require__(50379), - MarketplaceDeployment: __nccwpck_require__(56811), - NeptuneGraph: __nccwpck_require__(77598), - NetworkMonitor: __nccwpck_require__(77614), - SupplyChain: __nccwpck_require__(39674) -}; - -/***/ }), - -/***/ 96881: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['amp'] = {}; -AWS.Amp = Service.defineService('amp', ['2020-08-01']); -Object.defineProperty(apiLoader.services['amp'], '2020-08-01', { - get: function get() { - var model = __nccwpck_require__(78362); - model.paginators = (__nccwpck_require__(75928)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(58239)/* .waiters */ .V); - return model; + codespaces: { + addRepositoryForSecretForAuthenticatedUser: [ + "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + addSelectedRepoToOrgSecret: [ + "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + checkPermissionsForDevcontainer: [ + "GET /repos/{owner}/{repo}/codespaces/permissions_check" + ], + codespaceMachinesForAuthenticatedUser: [ + "GET /user/codespaces/{codespace_name}/machines" + ], + createForAuthenticatedUser: ["POST /user/codespaces"], + createOrUpdateOrgSecret: [ + "PUT /orgs/{org}/codespaces/secrets/{secret_name}" + ], + createOrUpdateRepoSecret: [ + "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" + ], + createOrUpdateSecretForAuthenticatedUser: [ + "PUT /user/codespaces/secrets/{secret_name}" + ], + createWithPrForAuthenticatedUser: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces" + ], + createWithRepoForAuthenticatedUser: [ + "POST /repos/{owner}/{repo}/codespaces" + ], + deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], + deleteFromOrganization: [ + "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}" + ], + deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"], + deleteRepoSecret: [ + "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" + ], + deleteSecretForAuthenticatedUser: [ + "DELETE /user/codespaces/secrets/{secret_name}" + ], + exportForAuthenticatedUser: [ + "POST /user/codespaces/{codespace_name}/exports" + ], + getCodespacesForUserInOrg: [ + "GET /orgs/{org}/members/{username}/codespaces" + ], + getExportDetailsForAuthenticatedUser: [ + "GET /user/codespaces/{codespace_name}/exports/{export_id}" + ], + getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], + getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"], + getPublicKeyForAuthenticatedUser: [ + "GET /user/codespaces/secrets/public-key" + ], + getRepoPublicKey: [ + "GET /repos/{owner}/{repo}/codespaces/secrets/public-key" + ], + getRepoSecret: [ + "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" + ], + getSecretForAuthenticatedUser: [ + "GET /user/codespaces/secrets/{secret_name}" + ], + listDevcontainersInRepositoryForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces/devcontainers" + ], + listForAuthenticatedUser: ["GET /user/codespaces"], + listInOrganization: [ + "GET /orgs/{org}/codespaces", + {}, + { renamedParameters: { org_id: "org" } } + ], + listInRepositoryForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces" + ], + listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], + listRepositoriesForSecretForAuthenticatedUser: [ + "GET /user/codespaces/secrets/{secret_name}/repositories" + ], + listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], + listSelectedReposForOrgSecret: [ + "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories" + ], + preFlightWithRepoForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces/new" + ], + publishForAuthenticatedUser: [ + "POST /user/codespaces/{codespace_name}/publish" + ], + removeRepositoryForSecretForAuthenticatedUser: [ + "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + removeSelectedRepoFromOrgSecret: [ + "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" + ], + repoMachinesForAuthenticatedUser: [ + "GET /repos/{owner}/{repo}/codespaces/machines" + ], + setRepositoriesForSecretForAuthenticatedUser: [ + "PUT /user/codespaces/secrets/{secret_name}/repositories" + ], + setSelectedReposForOrgSecret: [ + "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories" + ], + startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], + stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], + stopInOrganization: [ + "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop" + ], + updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.Amp; - - -/***/ }), - -/***/ 38090: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['amplify'] = {}; -AWS.Amplify = Service.defineService('amplify', ['2017-07-25']); -Object.defineProperty(apiLoader.services['amplify'], '2017-07-25', { - get: function get() { - var model = __nccwpck_require__(36813); - model.paginators = (__nccwpck_require__(53733)/* .pagination */ .o); - return model; + copilot: { + addCopilotSeatsForTeams: [ + "POST /orgs/{org}/copilot/billing/selected_teams" + ], + addCopilotSeatsForUsers: [ + "POST /orgs/{org}/copilot/billing/selected_users" + ], + cancelCopilotSeatAssignmentForTeams: [ + "DELETE /orgs/{org}/copilot/billing/selected_teams" + ], + cancelCopilotSeatAssignmentForUsers: [ + "DELETE /orgs/{org}/copilot/billing/selected_users" + ], + getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], + getCopilotSeatDetailsForUser: [ + "GET /orgs/{org}/members/{username}/copilot" + ], + listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.Amplify; - - -/***/ }), - -/***/ 2806: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['amplifybackend'] = {}; -AWS.AmplifyBackend = Service.defineService('amplifybackend', ['2020-08-11']); -Object.defineProperty(apiLoader.services['amplifybackend'], '2020-08-11', { - get: function get() { - var model = __nccwpck_require__(23939); - model.paginators = (__nccwpck_require__(27232)/* .pagination */ .o); - return model; + dependabot: { + addSelectedRepoToOrgSecret: [ + "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" + ], + createOrUpdateOrgSecret: [ + "PUT /orgs/{org}/dependabot/secrets/{secret_name}" + ], + createOrUpdateRepoSecret: [ + "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" + ], + deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], + deleteRepoSecret: [ + "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" + ], + getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], + getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], + getRepoPublicKey: [ + "GET /repos/{owner}/{repo}/dependabot/secrets/public-key" + ], + getRepoSecret: [ + "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" + ], + listAlertsForEnterprise: [ + "GET /enterprises/{enterprise}/dependabot/alerts" + ], + listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"], + listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], + listSelectedReposForOrgSecret: [ + "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories" + ], + removeSelectedRepoFromOrgSecret: [ + "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" + ], + setSelectedReposForOrgSecret: [ + "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories" + ], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}" + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AmplifyBackend; - - -/***/ }), - -/***/ 89937: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['amplifyuibuilder'] = {}; -AWS.AmplifyUIBuilder = Service.defineService('amplifyuibuilder', ['2021-08-11']); -Object.defineProperty(apiLoader.services['amplifyuibuilder'], '2021-08-11', { - get: function get() { - var model = __nccwpck_require__(48987); - model.paginators = (__nccwpck_require__(56072)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(70564)/* .waiters */ .V); - return model; + dependencyGraph: { + createRepositorySnapshot: [ + "POST /repos/{owner}/{repo}/dependency-graph/snapshots" + ], + diffRange: [ + "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}" + ], + exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AmplifyUIBuilder; - - -/***/ }), - -/***/ 91759: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['apigateway'] = {}; -AWS.APIGateway = Service.defineService('apigateway', ['2015-07-09']); -__nccwpck_require__(4338); -Object.defineProperty(apiLoader.services['apigateway'], '2015-07-09', { - get: function get() { - var model = __nccwpck_require__(59463); - model.paginators = (__nccwpck_require__(25878)/* .pagination */ .o); - return model; + emojis: { get: ["GET /emojis"] }, + gists: { + checkIsStarred: ["GET /gists/{gist_id}/star"], + create: ["POST /gists"], + createComment: ["POST /gists/{gist_id}/comments"], + delete: ["DELETE /gists/{gist_id}"], + deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], + fork: ["POST /gists/{gist_id}/forks"], + get: ["GET /gists/{gist_id}"], + getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], + getRevision: ["GET /gists/{gist_id}/{sha}"], + list: ["GET /gists"], + listComments: ["GET /gists/{gist_id}/comments"], + listCommits: ["GET /gists/{gist_id}/commits"], + listForUser: ["GET /users/{username}/gists"], + listForks: ["GET /gists/{gist_id}/forks"], + listPublic: ["GET /gists/public"], + listStarred: ["GET /gists/starred"], + star: ["PUT /gists/{gist_id}/star"], + unstar: ["DELETE /gists/{gist_id}/star"], + update: ["PATCH /gists/{gist_id}"], + updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.APIGateway; - - -/***/ }), - -/***/ 31762: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['apigatewaymanagementapi'] = {}; -AWS.ApiGatewayManagementApi = Service.defineService('apigatewaymanagementapi', ['2018-11-29']); -Object.defineProperty(apiLoader.services['apigatewaymanagementapi'], '2018-11-29', { - get: function get() { - var model = __nccwpck_require__(57832); - model.paginators = (__nccwpck_require__(2787)/* .pagination */ .o); - return model; + git: { + createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], + createCommit: ["POST /repos/{owner}/{repo}/git/commits"], + createRef: ["POST /repos/{owner}/{repo}/git/refs"], + createTag: ["POST /repos/{owner}/{repo}/git/tags"], + createTree: ["POST /repos/{owner}/{repo}/git/trees"], + deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], + getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], + getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], + getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], + getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], + getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], + listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], + updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.ApiGatewayManagementApi; - - -/***/ }), - -/***/ 44987: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['apigatewayv2'] = {}; -AWS.ApiGatewayV2 = Service.defineService('apigatewayv2', ['2018-11-29']); -Object.defineProperty(apiLoader.services['apigatewayv2'], '2018-11-29', { - get: function get() { - var model = __nccwpck_require__(59326); - model.paginators = (__nccwpck_require__(90171)/* .pagination */ .o); - return model; + gitignore: { + getAllTemplates: ["GET /gitignore/templates"], + getTemplate: ["GET /gitignore/templates/{name}"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.ApiGatewayV2; - - -/***/ }), - -/***/ 78606: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['appconfig'] = {}; -AWS.AppConfig = Service.defineService('appconfig', ['2019-10-09']); -Object.defineProperty(apiLoader.services['appconfig'], '2019-10-09', { - get: function get() { - var model = __nccwpck_require__(44701); - model.paginators = (__nccwpck_require__(41789)/* .pagination */ .o); - return model; + interactions: { + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: [ + "GET /user/interaction-limits", + {}, + { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] } + ], + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], + removeRestrictionsForRepo: [ + "DELETE /repos/{owner}/{repo}/interaction-limits" + ], + removeRestrictionsForYourPublicRepos: [ + "DELETE /user/interaction-limits", + {}, + { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] } + ], + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: [ + "PUT /user/interaction-limits", + {}, + { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] } + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppConfig; - - -/***/ }), - -/***/ 45282: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['appconfigdata'] = {}; -AWS.AppConfigData = Service.defineService('appconfigdata', ['2021-11-11']); -Object.defineProperty(apiLoader.services['appconfigdata'], '2021-11-11', { - get: function get() { - var model = __nccwpck_require__(86796); - model.paginators = (__nccwpck_require__(48010)/* .pagination */ .o); - return model; + issues: { + addAssignees: [ + "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees" + ], + addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], + checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], + checkUserCanBeAssignedToIssue: [ + "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}" + ], + create: ["POST /repos/{owner}/{repo}/issues"], + createComment: [ + "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" + ], + createLabel: ["POST /repos/{owner}/{repo}/labels"], + createMilestone: ["POST /repos/{owner}/{repo}/milestones"], + deleteComment: [ + "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}" + ], + deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], + deleteMilestone: [ + "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}" + ], + get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], + getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], + getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], + getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], + getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], + list: ["GET /issues"], + listAssignees: ["GET /repos/{owner}/{repo}/assignees"], + listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], + listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], + listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], + listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], + listEventsForTimeline: [ + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" + ], + listForAuthenticatedUser: ["GET /user/issues"], + listForOrg: ["GET /orgs/{org}/issues"], + listForRepo: ["GET /repos/{owner}/{repo}/issues"], + listLabelsForMilestone: [ + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels" + ], + listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], + listLabelsOnIssue: [ + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels" + ], + listMilestones: ["GET /repos/{owner}/{repo}/milestones"], + lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], + removeAllLabels: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels" + ], + removeAssignees: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees" + ], + removeLabel: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}" + ], + setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], + unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], + update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], + updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], + updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], + updateMilestone: [ + "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}" + ] + }, + licenses: { + get: ["GET /licenses/{license}"], + getAllCommonlyUsed: ["GET /licenses"], + getForRepo: ["GET /repos/{owner}/{repo}/license"] + }, + markdown: { + render: ["POST /markdown"], + renderRaw: [ + "POST /markdown/raw", + { headers: { "content-type": "text/plain; charset=utf-8" } } + ] + }, + meta: { + get: ["GET /meta"], + getAllVersions: ["GET /versions"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"] + }, + migrations: { + cancelImport: [ + "DELETE /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import" + } + ], + deleteArchiveForAuthenticatedUser: [ + "DELETE /user/migrations/{migration_id}/archive" + ], + deleteArchiveForOrg: [ + "DELETE /orgs/{org}/migrations/{migration_id}/archive" + ], + downloadArchiveForOrg: [ + "GET /orgs/{org}/migrations/{migration_id}/archive" + ], + getArchiveForAuthenticatedUser: [ + "GET /user/migrations/{migration_id}/archive" + ], + getCommitAuthors: [ + "GET /repos/{owner}/{repo}/import/authors", + {}, + { + deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors" + } + ], + getImportStatus: [ + "GET /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status" + } + ], + getLargeFiles: [ + "GET /repos/{owner}/{repo}/import/large_files", + {}, + { + deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files" + } + ], + getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], + getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], + listForAuthenticatedUser: ["GET /user/migrations"], + listForOrg: ["GET /orgs/{org}/migrations"], + listReposForAuthenticatedUser: [ + "GET /user/migrations/{migration_id}/repositories" + ], + listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], + listReposForUser: [ + "GET /user/migrations/{migration_id}/repositories", + {}, + { renamed: ["migrations", "listReposForAuthenticatedUser"] } + ], + mapCommitAuthor: [ + "PATCH /repos/{owner}/{repo}/import/authors/{author_id}", + {}, + { + deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author" + } + ], + setLfsPreference: [ + "PATCH /repos/{owner}/{repo}/import/lfs", + {}, + { + deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference" + } + ], + startForAuthenticatedUser: ["POST /user/migrations"], + startForOrg: ["POST /orgs/{org}/migrations"], + startImport: [ + "PUT /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import" + } + ], + unlockRepoForAuthenticatedUser: [ + "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock" + ], + unlockRepoForOrg: [ + "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock" + ], + updateImport: [ + "PATCH /repos/{owner}/{repo}/import", + {}, + { + deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import" + } + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppConfigData; - - -/***/ }), - -/***/ 46318: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['appfabric'] = {}; -AWS.AppFabric = Service.defineService('appfabric', ['2023-05-19']); -Object.defineProperty(apiLoader.services['appfabric'], '2023-05-19', { - get: function get() { - var model = __nccwpck_require__(78267); - model.paginators = (__nccwpck_require__(42193)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(44821)/* .waiters */ .V); - return model; + oidc: { + getOidcCustomSubTemplateForOrg: [ + "GET /orgs/{org}/actions/oidc/customization/sub" + ], + updateOidcCustomSubTemplateForOrg: [ + "PUT /orgs/{org}/actions/oidc/customization/sub" + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppFabric; - - -/***/ }), - -/***/ 60844: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['appflow'] = {}; -AWS.Appflow = Service.defineService('appflow', ['2020-08-23']); -Object.defineProperty(apiLoader.services['appflow'], '2020-08-23', { - get: function get() { - var model = __nccwpck_require__(32840); - model.paginators = (__nccwpck_require__(16916)/* .pagination */ .o); - return model; + orgs: { + addSecurityManagerTeam: [ + "PUT /orgs/{org}/security-managers/teams/{team_slug}" + ], + assignTeamToOrgRole: [ + "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + assignUserToOrgRole: [ + "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], + blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], + checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], + checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], + checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], + convertMemberToOutsideCollaborator: [ + "PUT /orgs/{org}/outside_collaborators/{username}" + ], + createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"], + createInvitation: ["POST /orgs/{org}/invitations"], + createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], + createOrUpdateCustomPropertiesValuesForRepos: [ + "PATCH /orgs/{org}/properties/values" + ], + createOrUpdateCustomProperty: [ + "PUT /orgs/{org}/properties/schema/{custom_property_name}" + ], + createWebhook: ["POST /orgs/{org}/hooks"], + delete: ["DELETE /orgs/{org}"], + deleteCustomOrganizationRole: [ + "DELETE /orgs/{org}/organization-roles/{role_id}" + ], + deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], + enableOrDisableSecurityProductOnAllOrgRepos: [ + "POST /orgs/{org}/{security_product}/{enablement}" + ], + get: ["GET /orgs/{org}"], + getAllCustomProperties: ["GET /orgs/{org}/properties/schema"], + getCustomProperty: [ + "GET /orgs/{org}/properties/schema/{custom_property_name}" + ], + getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], + getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], + getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: [ + "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" + ], + list: ["GET /organizations"], + listAppInstallations: ["GET /orgs/{org}/installations"], + listBlockedUsers: ["GET /orgs/{org}/blocks"], + listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], + listForAuthenticatedUser: ["GET /user/orgs"], + listForUser: ["GET /users/{username}/orgs"], + listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], + listMembers: ["GET /orgs/{org}/members"], + listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], + listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], + listOrgRoles: ["GET /orgs/{org}/organization-roles"], + listOrganizationFineGrainedPermissions: [ + "GET /orgs/{org}/organization-fine-grained-permissions" + ], + listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], + listPatGrantRepositories: [ + "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" + ], + listPatGrantRequestRepositories: [ + "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories" + ], + listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"], + listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], + listPendingInvitations: ["GET /orgs/{org}/invitations"], + listPublicMembers: ["GET /orgs/{org}/public_members"], + listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /orgs/{org}/hooks"], + patchCustomOrganizationRole: [ + "PATCH /orgs/{org}/organization-roles/{role_id}" + ], + pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" + ], + removeCustomProperty: [ + "DELETE /orgs/{org}/properties/schema/{custom_property_name}" + ], + removeMember: ["DELETE /orgs/{org}/members/{username}"], + removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], + removeOutsideCollaborator: [ + "DELETE /orgs/{org}/outside_collaborators/{username}" + ], + removePublicMembershipForAuthenticatedUser: [ + "DELETE /orgs/{org}/public_members/{username}" + ], + removeSecurityManagerTeam: [ + "DELETE /orgs/{org}/security-managers/teams/{team_slug}" + ], + reviewPatGrantRequest: [ + "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}" + ], + reviewPatGrantRequestsInBulk: [ + "POST /orgs/{org}/personal-access-token-requests" + ], + revokeAllOrgRolesTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" + ], + revokeAllOrgRolesUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}" + ], + revokeOrgRoleTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + revokeOrgRoleUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], + setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], + setPublicMembershipForAuthenticatedUser: [ + "PUT /orgs/{org}/public_members/{username}" + ], + unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], + update: ["PATCH /orgs/{org}"], + updateMembershipForAuthenticatedUser: [ + "PATCH /user/memberships/orgs/{org}" + ], + updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"], + updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"], + updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.Appflow; - - -/***/ }), - -/***/ 85479: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['appintegrations'] = {}; -AWS.AppIntegrations = Service.defineService('appintegrations', ['2020-07-29']); -Object.defineProperty(apiLoader.services['appintegrations'], '2020-07-29', { - get: function get() { - var model = __nccwpck_require__(62033); - model.paginators = (__nccwpck_require__(61866)/* .pagination */ .o); - return model; + packages: { + deletePackageForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}" + ], + deletePackageForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}" + ], + deletePackageForUser: [ + "DELETE /users/{username}/packages/{package_type}/{package_name}" + ], + deletePackageVersionForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + deletePackageVersionForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + deletePackageVersionForUser: [ + "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + getAllPackageVersionsForAPackageOwnedByAnOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + {}, + { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] } + ], + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions", + {}, + { + renamed: [ + "packages", + "getAllPackageVersionsForPackageOwnedByAuthenticatedUser" + ] + } + ], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions" + ], + getAllPackageVersionsForPackageOwnedByOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions" + ], + getAllPackageVersionsForPackageOwnedByUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions" + ], + getPackageForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}" + ], + getPackageForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}" + ], + getPackageForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}" + ], + getPackageVersionForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + getPackageVersionForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + getPackageVersionForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" + ], + listDockerMigrationConflictingPackagesForAuthenticatedUser: [ + "GET /user/docker/conflicts" + ], + listDockerMigrationConflictingPackagesForOrganization: [ + "GET /orgs/{org}/docker/conflicts" + ], + listDockerMigrationConflictingPackagesForUser: [ + "GET /users/{username}/docker/conflicts" + ], + listPackagesForAuthenticatedUser: ["GET /user/packages"], + listPackagesForOrganization: ["GET /orgs/{org}/packages"], + listPackagesForUser: ["GET /users/{username}/packages"], + restorePackageForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/restore{?token}" + ], + restorePackageForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}" + ], + restorePackageForUser: [ + "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}" + ], + restorePackageVersionForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" + ], + restorePackageVersionForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" + ], + restorePackageVersionForUser: [ + "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppIntegrations; - - -/***/ }), - -/***/ 25598: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['applicationautoscaling'] = {}; -AWS.ApplicationAutoScaling = Service.defineService('applicationautoscaling', ['2016-02-06']); -Object.defineProperty(apiLoader.services['applicationautoscaling'], '2016-02-06', { - get: function get() { - var model = __nccwpck_require__(47320); - model.paginators = (__nccwpck_require__(40322)/* .pagination */ .o); - return model; + projects: { + addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], + createCard: ["POST /projects/columns/{column_id}/cards"], + createColumn: ["POST /projects/{project_id}/columns"], + createForAuthenticatedUser: ["POST /user/projects"], + createForOrg: ["POST /orgs/{org}/projects"], + createForRepo: ["POST /repos/{owner}/{repo}/projects"], + delete: ["DELETE /projects/{project_id}"], + deleteCard: ["DELETE /projects/columns/cards/{card_id}"], + deleteColumn: ["DELETE /projects/columns/{column_id}"], + get: ["GET /projects/{project_id}"], + getCard: ["GET /projects/columns/cards/{card_id}"], + getColumn: ["GET /projects/columns/{column_id}"], + getPermissionForUser: [ + "GET /projects/{project_id}/collaborators/{username}/permission" + ], + listCards: ["GET /projects/columns/{column_id}/cards"], + listCollaborators: ["GET /projects/{project_id}/collaborators"], + listColumns: ["GET /projects/{project_id}/columns"], + listForOrg: ["GET /orgs/{org}/projects"], + listForRepo: ["GET /repos/{owner}/{repo}/projects"], + listForUser: ["GET /users/{username}/projects"], + moveCard: ["POST /projects/columns/cards/{card_id}/moves"], + moveColumn: ["POST /projects/columns/{column_id}/moves"], + removeCollaborator: [ + "DELETE /projects/{project_id}/collaborators/{username}" + ], + update: ["PATCH /projects/{project_id}"], + updateCard: ["PATCH /projects/columns/cards/{card_id}"], + updateColumn: ["PATCH /projects/columns/{column_id}"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.ApplicationAutoScaling; - - -/***/ }), - -/***/ 20887: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['applicationcostprofiler'] = {}; -AWS.ApplicationCostProfiler = Service.defineService('applicationcostprofiler', ['2020-09-10']); -Object.defineProperty(apiLoader.services['applicationcostprofiler'], '2020-09-10', { - get: function get() { - var model = __nccwpck_require__(96818); - model.paginators = (__nccwpck_require__(41331)/* .pagination */ .o); - return model; + pulls: { + checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + create: ["POST /repos/{owner}/{repo}/pulls"], + createReplyForReviewComment: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" + ], + createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + createReviewComment: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments" + ], + deletePendingReview: [ + "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" + ], + deleteReviewComment: [ + "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}" + ], + dismissReview: [ + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" + ], + get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], + getReview: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" + ], + getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + list: ["GET /repos/{owner}/{repo}/pulls"], + listCommentsForReview: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments" + ], + listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], + listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], + listRequestedReviewers: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" + ], + listReviewComments: [ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments" + ], + listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], + listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + removeRequestedReviewers: [ + "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" + ], + requestReviewers: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" + ], + submitReview: [ + "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" + ], + update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], + updateBranch: [ + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" + ], + updateReview: [ + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" + ], + updateReviewComment: [ + "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.ApplicationCostProfiler; - - -/***/ }), - -/***/ 83972: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['applicationinsights'] = {}; -AWS.ApplicationInsights = Service.defineService('applicationinsights', ['2018-11-25']); -Object.defineProperty(apiLoader.services['applicationinsights'], '2018-11-25', { - get: function get() { - var model = __nccwpck_require__(96143); - model.paginators = (__nccwpck_require__(22242)/* .pagination */ .o); - return model; + rateLimit: { get: ["GET /rate_limit"] }, + reactions: { + createForCommitComment: [ + "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" + ], + createForIssue: [ + "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions" + ], + createForIssueComment: [ + "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" + ], + createForPullRequestReviewComment: [ + "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" + ], + createForRelease: [ + "POST /repos/{owner}/{repo}/releases/{release_id}/reactions" + ], + createForTeamDiscussionCommentInOrg: [ + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" + ], + createForTeamDiscussionInOrg: [ + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" + ], + deleteForCommitComment: [ + "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}" + ], + deleteForIssue: [ + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}" + ], + deleteForIssueComment: [ + "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}" + ], + deleteForPullRequestComment: [ + "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}" + ], + deleteForRelease: [ + "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}" + ], + deleteForTeamDiscussion: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}" + ], + deleteForTeamDiscussionComment: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}" + ], + listForCommitComment: [ + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions" + ], + listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + listForIssueComment: [ + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" + ], + listForPullRequestReviewComment: [ + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" + ], + listForRelease: [ + "GET /repos/{owner}/{repo}/releases/{release_id}/reactions" + ], + listForTeamDiscussionCommentInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" + ], + listForTeamDiscussionInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.ApplicationInsights; - - -/***/ }), - -/***/ 69226: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['appmesh'] = {}; -AWS.AppMesh = Service.defineService('appmesh', ['2018-10-01', '2018-10-01*', '2019-01-25']); -Object.defineProperty(apiLoader.services['appmesh'], '2018-10-01', { - get: function get() { - var model = __nccwpck_require__(64780); - model.paginators = (__nccwpck_require__(54936)/* .pagination */ .o); - return model; + repos: { + acceptInvitation: [ + "PATCH /user/repository_invitations/{invitation_id}", + {}, + { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] } + ], + acceptInvitationForAuthenticatedUser: [ + "PATCH /user/repository_invitations/{invitation_id}" + ], + addAppAccessRestrictions: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + {}, + { mapToData: "apps" } + ], + addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], + addStatusCheckContexts: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + {}, + { mapToData: "contexts" } + ], + addTeamAccessRestrictions: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", + {}, + { mapToData: "teams" } + ], + addUserAccessRestrictions: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + {}, + { mapToData: "users" } + ], + cancelPagesDeployment: [ + "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" + ], + checkAutomatedSecurityFixes: [ + "GET /repos/{owner}/{repo}/automated-security-fixes" + ], + checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], + checkVulnerabilityAlerts: [ + "GET /repos/{owner}/{repo}/vulnerability-alerts" + ], + codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], + compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: [ + "GET /repos/{owner}/{repo}/compare/{basehead}" + ], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], + createCommitComment: [ + "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments" + ], + createCommitSignatureProtection: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" + ], + createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], + createDeployKey: ["POST /repos/{owner}/{repo}/keys"], + createDeployment: ["POST /repos/{owner}/{repo}/deployments"], + createDeploymentBranchPolicy: [ + "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" + ], + createDeploymentProtectionRule: [ + "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" + ], + createDeploymentStatus: [ + "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" + ], + createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], + createForAuthenticatedUser: ["POST /user/repos"], + createFork: ["POST /repos/{owner}/{repo}/forks"], + createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateCustomPropertiesValues: [ + "PATCH /repos/{owner}/{repo}/properties/values" + ], + createOrUpdateEnvironment: [ + "PUT /repos/{owner}/{repo}/environments/{environment_name}" + ], + createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], + createOrgRuleset: ["POST /orgs/{org}/rulesets"], + createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], + createPagesSite: ["POST /repos/{owner}/{repo}/pages"], + createRelease: ["POST /repos/{owner}/{repo}/releases"], + createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], + createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], + createUsingTemplate: [ + "POST /repos/{template_owner}/{template_repo}/generate" + ], + createWebhook: ["POST /repos/{owner}/{repo}/hooks"], + declineInvitation: [ + "DELETE /user/repository_invitations/{invitation_id}", + {}, + { renamed: ["repos", "declineInvitationForAuthenticatedUser"] } + ], + declineInvitationForAuthenticatedUser: [ + "DELETE /user/repository_invitations/{invitation_id}" + ], + delete: ["DELETE /repos/{owner}/{repo}"], + deleteAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" + ], + deleteAdminBranchProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" + ], + deleteAnEnvironment: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}" + ], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], + deleteBranchProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection" + ], + deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], + deleteCommitSignatureProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" + ], + deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], + deleteDeployment: [ + "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" + ], + deleteDeploymentBranchPolicy: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" + ], + deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], + deleteInvitation: [ + "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" + ], + deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"], + deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], + deletePullRequestReviewProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" + ], + deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], + deleteReleaseAsset: [ + "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}" + ], + deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"], + deleteTagProtection: [ + "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}" + ], + deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], + disableAutomatedSecurityFixes: [ + "DELETE /repos/{owner}/{repo}/automated-security-fixes" + ], + disableDeploymentProtectionRule: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" + ], + disablePrivateVulnerabilityReporting: [ + "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting" + ], + disableVulnerabilityAlerts: [ + "DELETE /repos/{owner}/{repo}/vulnerability-alerts" + ], + downloadArchive: [ + "GET /repos/{owner}/{repo}/zipball/{ref}", + {}, + { renamed: ["repos", "downloadZipballArchive"] } + ], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], + enableAutomatedSecurityFixes: [ + "PUT /repos/{owner}/{repo}/automated-security-fixes" + ], + enablePrivateVulnerabilityReporting: [ + "PUT /repos/{owner}/{repo}/private-vulnerability-reporting" + ], + enableVulnerabilityAlerts: [ + "PUT /repos/{owner}/{repo}/vulnerability-alerts" + ], + generateReleaseNotes: [ + "POST /repos/{owner}/{repo}/releases/generate-notes" + ], + get: ["GET /repos/{owner}/{repo}"], + getAccessRestrictions: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" + ], + getAdminBranchProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" + ], + getAllDeploymentProtectionRules: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" + ], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], + getAllStatusCheckContexts: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" + ], + getAllTopics: ["GET /repos/{owner}/{repo}/topics"], + getAppsWithAccessToProtectedBranch: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" + ], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], + getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], + getBranchProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection" + ], + getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"], + getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], + getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], + getCollaboratorPermissionLevel: [ + "GET /repos/{owner}/{repo}/collaborators/{username}/permission" + ], + getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], + getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], + getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], + getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], + getCommitSignatureProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" + ], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], + getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], + getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], + getCustomDeploymentProtectionRule: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" + ], + getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"], + getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], + getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], + getDeploymentBranchPolicy: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" + ], + getDeploymentStatus: [ + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" + ], + getEnvironment: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}" + ], + getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], + getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], + getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"], + getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"], + getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"], + getOrgRulesets: ["GET /orgs/{org}/rulesets"], + getPages: ["GET /repos/{owner}/{repo}/pages"], + getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesDeployment: [ + "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" + ], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], + getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], + getPullRequestReviewProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" + ], + getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], + getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], + getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], + getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], + getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], + getRepoRuleSuite: [ + "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" + ], + getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"], + getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"], + getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"], + getStatusChecksProtection: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + ], + getTeamsWithAccessToProtectedBranch: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" + ], + getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], + getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], + getUsersWithAccessToProtectedBranch: [ + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" + ], + getViews: ["GET /repos/{owner}/{repo}/traffic/views"], + getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" + ], + getWebhookDelivery: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}" + ], + listActivities: ["GET /repos/{owner}/{repo}/activity"], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], + listBranches: ["GET /repos/{owner}/{repo}/branches"], + listBranchesForHeadCommit: [ + "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" + ], + listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], + listCommentsForCommit: [ + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" + ], + listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], + listCommitStatusesForRef: [ + "GET /repos/{owner}/{repo}/commits/{ref}/statuses" + ], + listCommits: ["GET /repos/{owner}/{repo}/commits"], + listContributors: ["GET /repos/{owner}/{repo}/contributors"], + listCustomDeploymentRuleIntegrations: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps" + ], + listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], + listDeploymentBranchPolicies: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" + ], + listDeploymentStatuses: [ + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" + ], + listDeployments: ["GET /repos/{owner}/{repo}/deployments"], + listForAuthenticatedUser: ["GET /user/repos"], + listForOrg: ["GET /orgs/{org}/repos"], + listForUser: ["GET /users/{username}/repos"], + listForks: ["GET /repos/{owner}/{repo}/forks"], + listInvitations: ["GET /repos/{owner}/{repo}/invitations"], + listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], + listLanguages: ["GET /repos/{owner}/{repo}/languages"], + listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], + listPublic: ["GET /repositories"], + listPullRequestsAssociatedWithCommit: [ + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" + ], + listReleaseAssets: [ + "GET /repos/{owner}/{repo}/releases/{release_id}/assets" + ], + listReleases: ["GET /repos/{owner}/{repo}/releases"], + listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], + listTags: ["GET /repos/{owner}/{repo}/tags"], + listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" + ], + listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], + merge: ["POST /repos/{owner}/{repo}/merges"], + mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], + pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" + ], + removeAppAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + {}, + { mapToData: "apps" } + ], + removeCollaborator: [ + "DELETE /repos/{owner}/{repo}/collaborators/{username}" + ], + removeStatusCheckContexts: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + {}, + { mapToData: "contexts" } + ], + removeStatusCheckProtection: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + ], + removeTeamAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", + {}, + { mapToData: "teams" } + ], + removeUserAccessRestrictions: [ + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + {}, + { mapToData: "users" } + ], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], + replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], + requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], + setAdminBranchProtection: [ + "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" + ], + setAppAccessRestrictions: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + {}, + { mapToData: "apps" } + ], + setStatusCheckContexts: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + {}, + { mapToData: "contexts" } + ], + setTeamAccessRestrictions: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", + {}, + { mapToData: "teams" } + ], + setUserAccessRestrictions: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + {}, + { mapToData: "users" } + ], + testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], + transfer: ["POST /repos/{owner}/{repo}/transfer"], + update: ["PATCH /repos/{owner}/{repo}"], + updateBranchProtection: [ + "PUT /repos/{owner}/{repo}/branches/{branch}/protection" + ], + updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], + updateDeploymentBranchPolicy: [ + "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" + ], + updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], + updateInvitation: [ + "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" + ], + updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], + updatePullRequestReviewProtection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" + ], + updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], + updateReleaseAsset: [ + "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" + ], + updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], + updateStatusCheckPotection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", + {}, + { renamed: ["repos", "updateStatusCheckProtection"] } + ], + updateStatusCheckProtection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + ], + updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: [ + "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" + ], + uploadReleaseAsset: [ + "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", + { baseUrl: "https://uploads.github.com" } + ] }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['appmesh'], '2019-01-25', { - get: function get() { - var model = __nccwpck_require__(78066); - model.paginators = (__nccwpck_require__(37698)/* .pagination */ .o); - return model; + search: { + code: ["GET /search/code"], + commits: ["GET /search/commits"], + issuesAndPullRequests: ["GET /search/issues"], + labels: ["GET /search/labels"], + repos: ["GET /search/repositories"], + topics: ["GET /search/topics"], + users: ["GET /search/users"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppMesh; - - -/***/ }), - -/***/ 75589: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['apprunner'] = {}; -AWS.AppRunner = Service.defineService('apprunner', ['2020-05-15']); -Object.defineProperty(apiLoader.services['apprunner'], '2020-05-15', { - get: function get() { - var model = __nccwpck_require__(30036); - model.paginators = (__nccwpck_require__(50293)/* .pagination */ .o); - return model; + secretScanning: { + getAlert: [ + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" + ], + listAlertsForEnterprise: [ + "GET /enterprises/{enterprise}/secret-scanning/alerts" + ], + listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + listLocationsForAlert: [ + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations" + ], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" + ] + }, + securityAdvisories: { + createFork: [ + "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" + ], + createPrivateVulnerabilityReport: [ + "POST /repos/{owner}/{repo}/security-advisories/reports" + ], + createRepositoryAdvisory: [ + "POST /repos/{owner}/{repo}/security-advisories" + ], + createRepositoryAdvisoryCveRequest: [ + "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve" + ], + getGlobalAdvisory: ["GET /advisories/{ghsa_id}"], + getRepositoryAdvisory: [ + "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}" + ], + listGlobalAdvisories: ["GET /advisories"], + listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"], + listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"], + updateRepositoryAdvisory: [ + "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}" + ] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppRunner; - - -/***/ }), - -/***/ 21730: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['appstream'] = {}; -AWS.AppStream = Service.defineService('appstream', ['2016-12-01']); -Object.defineProperty(apiLoader.services['appstream'], '2016-12-01', { - get: function get() { - var model = __nccwpck_require__(85538); - model.paginators = (__nccwpck_require__(32191)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(21134)/* .waiters */ .V); - return model; + teams: { + addOrUpdateMembershipForUserInOrg: [ + "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}" + ], + addOrUpdateProjectPermissionsInOrg: [ + "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}" + ], + addOrUpdateRepoPermissionsInOrg: [ + "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" + ], + checkPermissionsForProjectInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}" + ], + checkPermissionsForRepoInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" + ], + create: ["POST /orgs/{org}/teams"], + createDiscussionCommentInOrg: [ + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" + ], + createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], + deleteDiscussionCommentInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" + ], + deleteDiscussionInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" + ], + deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], + getByName: ["GET /orgs/{org}/teams/{team_slug}"], + getDiscussionCommentInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" + ], + getDiscussionInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" + ], + getMembershipForUserInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/memberships/{username}" + ], + list: ["GET /orgs/{org}/teams"], + listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], + listDiscussionCommentsInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" + ], + listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], + listForAuthenticatedUser: ["GET /user/teams"], + listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], + listPendingInvitationsInOrg: [ + "GET /orgs/{org}/teams/{team_slug}/invitations" + ], + listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], + listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], + removeMembershipForUserInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}" + ], + removeProjectInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}" + ], + removeRepoInOrg: [ + "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" + ], + updateDiscussionCommentInOrg: [ + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" + ], + updateDiscussionInOrg: [ + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" + ], + updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppStream; - - -/***/ }), - -/***/ 12402: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; + users: { + addEmailForAuthenticated: [ + "POST /user/emails", + {}, + { renamed: ["users", "addEmailForAuthenticatedUser"] } + ], + addEmailForAuthenticatedUser: ["POST /user/emails"], + addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], + block: ["PUT /user/blocks/{username}"], + checkBlocked: ["GET /user/blocks/{username}"], + checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], + checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], + createGpgKeyForAuthenticated: [ + "POST /user/gpg_keys", + {}, + { renamed: ["users", "createGpgKeyForAuthenticatedUser"] } + ], + createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], + createPublicSshKeyForAuthenticated: [ + "POST /user/keys", + {}, + { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } + ], + createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], + createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], + deleteEmailForAuthenticated: [ + "DELETE /user/emails", + {}, + { renamed: ["users", "deleteEmailForAuthenticatedUser"] } + ], + deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], + deleteGpgKeyForAuthenticated: [ + "DELETE /user/gpg_keys/{gpg_key_id}", + {}, + { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } + ], + deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], + deletePublicSshKeyForAuthenticated: [ + "DELETE /user/keys/{key_id}", + {}, + { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } + ], + deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], + deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], + deleteSshSigningKeyForAuthenticatedUser: [ + "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" + ], + follow: ["PUT /user/following/{username}"], + getAuthenticated: ["GET /user"], + getByUsername: ["GET /users/{username}"], + getContextForUser: ["GET /users/{username}/hovercard"], + getGpgKeyForAuthenticated: [ + "GET /user/gpg_keys/{gpg_key_id}", + {}, + { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } + ], + getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], + getPublicSshKeyForAuthenticated: [ + "GET /user/keys/{key_id}", + {}, + { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } + ], + getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], + getSshSigningKeyForAuthenticatedUser: [ + "GET /user/ssh_signing_keys/{ssh_signing_key_id}" + ], + list: ["GET /users"], + listBlockedByAuthenticated: [ + "GET /user/blocks", + {}, + { renamed: ["users", "listBlockedByAuthenticatedUser"] } + ], + listBlockedByAuthenticatedUser: ["GET /user/blocks"], + listEmailsForAuthenticated: [ + "GET /user/emails", + {}, + { renamed: ["users", "listEmailsForAuthenticatedUser"] } + ], + listEmailsForAuthenticatedUser: ["GET /user/emails"], + listFollowedByAuthenticated: [ + "GET /user/following", + {}, + { renamed: ["users", "listFollowedByAuthenticatedUser"] } + ], + listFollowedByAuthenticatedUser: ["GET /user/following"], + listFollowersForAuthenticatedUser: ["GET /user/followers"], + listFollowersForUser: ["GET /users/{username}/followers"], + listFollowingForUser: ["GET /users/{username}/following"], + listGpgKeysForAuthenticated: [ + "GET /user/gpg_keys", + {}, + { renamed: ["users", "listGpgKeysForAuthenticatedUser"] } + ], + listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], + listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], + listPublicEmailsForAuthenticated: [ + "GET /user/public_emails", + {}, + { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } + ], + listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], + listPublicKeysForUser: ["GET /users/{username}/keys"], + listPublicSshKeysForAuthenticated: [ + "GET /user/keys", + {}, + { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } + ], + listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], + listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"], + listSocialAccountsForUser: ["GET /users/{username}/social_accounts"], + listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"], + listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"], + setPrimaryEmailVisibilityForAuthenticated: [ + "PATCH /user/email/visibility", + {}, + { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] } + ], + setPrimaryEmailVisibilityForAuthenticatedUser: [ + "PATCH /user/email/visibility" + ], + unblock: ["DELETE /user/blocks/{username}"], + unfollow: ["DELETE /user/following/{username}"], + updateAuthenticated: ["PATCH /user"] + } +}; +var endpoints_default = Endpoints; -apiLoader.services['appsync'] = {}; -AWS.AppSync = Service.defineService('appsync', ['2017-07-25']); -Object.defineProperty(apiLoader.services['appsync'], '2017-07-25', { - get: function get() { - var model = __nccwpck_require__(94937); - model.paginators = (__nccwpck_require__(50233)/* .pagination */ .o); - return model; +// pkg/dist-src/endpoints-to-methods.js +var endpointMethodsMap = /* @__PURE__ */ new Map(); +for (const [scope, endpoints] of Object.entries(endpoints_default)) { + for (const [methodName, endpoint] of Object.entries(endpoints)) { + const [route, defaults, decorations] = endpoint; + const [method, url] = route.split(/ /); + const endpointDefaults = Object.assign( + { + method, + url + }, + defaults + ); + if (!endpointMethodsMap.has(scope)) { + endpointMethodsMap.set(scope, /* @__PURE__ */ new Map()); + } + endpointMethodsMap.get(scope).set(methodName, { + scope, + methodName, + endpointDefaults, + decorations + }); + } +} +var handler = { + has({ scope }, methodName) { + return endpointMethodsMap.get(scope).has(methodName); }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AppSync; - - -/***/ }), - -/***/ 54280: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['arczonalshift'] = {}; -AWS.ARCZonalShift = Service.defineService('arczonalshift', ['2022-10-30']); -Object.defineProperty(apiLoader.services['arczonalshift'], '2022-10-30', { - get: function get() { - var model = __nccwpck_require__(52286); - model.paginators = (__nccwpck_require__(70002)/* .pagination */ .o); - return model; + getOwnPropertyDescriptor(target, methodName) { + return { + value: this.get(target, methodName), + // ensures method is in the cache + configurable: true, + writable: true, + enumerable: true + }; }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.ARCZonalShift; - - -/***/ }), - -/***/ 29434: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['athena'] = {}; -AWS.Athena = Service.defineService('athena', ['2017-05-18']); -Object.defineProperty(apiLoader.services['athena'], '2017-05-18', { - get: function get() { - var model = __nccwpck_require__(28680); - model.paginators = (__nccwpck_require__(44417)/* .pagination */ .o); - return model; + defineProperty(target, methodName, descriptor) { + Object.defineProperty(target.cache, methodName, descriptor); + return true; }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.Athena; - - -/***/ }), - -/***/ 20472: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['auditmanager'] = {}; -AWS.AuditManager = Service.defineService('auditmanager', ['2017-07-25']); -Object.defineProperty(apiLoader.services['auditmanager'], '2017-07-25', { - get: function get() { - var model = __nccwpck_require__(41672); - model.paginators = (__nccwpck_require__(41321)/* .pagination */ .o); - return model; + deleteProperty(target, methodName) { + delete target.cache[methodName]; + return true; }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AuditManager; - - -/***/ }), - -/***/ 33960: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['augmentedairuntime'] = {}; -AWS.AugmentedAIRuntime = Service.defineService('augmentedairuntime', ['2019-11-07']); -Object.defineProperty(apiLoader.services['augmentedairuntime'], '2019-11-07', { - get: function get() { - var model = __nccwpck_require__(57704); - model.paginators = (__nccwpck_require__(13201)/* .pagination */ .o); - return model; + ownKeys({ scope }) { + return [...endpointMethodsMap.get(scope).keys()]; }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.AugmentedAIRuntime; - - -/***/ }), - -/***/ 31652: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['autoscaling'] = {}; -AWS.AutoScaling = Service.defineService('autoscaling', ['2011-01-01']); -Object.defineProperty(apiLoader.services['autoscaling'], '2011-01-01', { - get: function get() { - var model = __nccwpck_require__(55394); - model.paginators = (__nccwpck_require__(81436)/* .pagination */ .o); - return model; + set(target, methodName, value) { + return target.cache[methodName] = value; }, - enumerable: true, - configurable: true -}); + get({ octokit, scope, cache }, methodName) { + if (cache[methodName]) { + return cache[methodName]; + } + const method = endpointMethodsMap.get(scope).get(methodName); + if (!method) { + return void 0; + } + const { endpointDefaults, decorations } = method; + if (decorations) { + cache[methodName] = decorate( + octokit, + scope, + methodName, + endpointDefaults, + decorations + ); + } else { + cache[methodName] = octokit.request.defaults(endpointDefaults); + } + return cache[methodName]; + } +}; +function endpointsToMethods(octokit) { + const newMethods = {}; + for (const scope of endpointMethodsMap.keys()) { + newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler); + } + return newMethods; +} +function decorate(octokit, scope, methodName, defaults, decorations) { + const requestWithDefaults = octokit.request.defaults(defaults); + function withDecorations(...args) { + let options = requestWithDefaults.endpoint.merge(...args); + if (decorations.mapToData) { + options = Object.assign({}, options, { + data: options[decorations.mapToData], + [decorations.mapToData]: void 0 + }); + return requestWithDefaults(options); + } + if (decorations.renamed) { + const [newScope, newMethodName] = decorations.renamed; + octokit.log.warn( + `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` + ); + } + if (decorations.deprecated) { + octokit.log.warn(decorations.deprecated); + } + if (decorations.renamedParameters) { + const options2 = requestWithDefaults.endpoint.merge(...args); + for (const [name, alias] of Object.entries( + decorations.renamedParameters + )) { + if (name in options2) { + octokit.log.warn( + `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead` + ); + if (!(alias in options2)) { + options2[alias] = options2[name]; + } + delete options2[name]; + } + } + return requestWithDefaults(options2); + } + return requestWithDefaults(...args); + } + return Object.assign(withDecorations, requestWithDefaults); +} -module.exports = AWS.AutoScaling; +// pkg/dist-src/index.js +function restEndpointMethods(octokit) { + const api = endpointsToMethods(octokit); + return { + rest: api + }; +} +restEndpointMethods.VERSION = VERSION; +function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit); + return { + ...api, + rest: api + }; +} +legacyRestEndpointMethods.VERSION = VERSION; +// Annotate the CommonJS export names for ESM import in node: +0 && (0); /***/ }), -/***/ 2554: +/***/ 10537: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; +"use strict"; -apiLoader.services['autoscalingplans'] = {}; -AWS.AutoScalingPlans = Service.defineService('autoscalingplans', ['2018-01-06']); -Object.defineProperty(apiLoader.services['autoscalingplans'], '2018-01-06', { - get: function get() { - var model = __nccwpck_require__(53216); - model.paginators = (__nccwpck_require__(64985)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true -}); +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 __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 (let 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( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -module.exports = AWS.AutoScalingPlans; +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + RequestError: () => RequestError +}); +module.exports = __toCommonJS(dist_src_exports); +var import_deprecation = __nccwpck_require__(58932); +var import_once = __toESM(__nccwpck_require__(1223)); +var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation)); +var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation)); +var RequestError = class extends Error { + constructor(message, statusCode, options) { + super(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + this.name = "HttpError"; + this.status = statusCode; + let headers; + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } + const requestCopy = Object.assign({}, options.request); + if (options.request.headers.authorization) { + requestCopy.headers = Object.assign({}, options.request.headers, { + authorization: options.request.headers.authorization.replace( + / .*$/, + " [REDACTED]" + ) + }); + } + requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); + this.request = requestCopy; + Object.defineProperty(this, "code", { + get() { + logOnceCode( + new import_deprecation.Deprecation( + "[@octokit/request-error] `error.code` is deprecated, use `error.status`." + ) + ); + return statusCode; + } + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders( + new import_deprecation.Deprecation( + "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`." + ) + ); + return headers || {}; + } + }); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (0); /***/ }), -/***/ 91065: +/***/ 36234: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; +"use strict"; -apiLoader.services['b2bi'] = {}; -AWS.B2bi = Service.defineService('b2bi', ['2022-06-23']); -Object.defineProperty(apiLoader.services['b2bi'], '2022-06-23', { - get: function get() { - var model = __nccwpck_require__(93012); - model.paginators = (__nccwpck_require__(13608)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +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 (let 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + request: () => request }); +module.exports = __toCommonJS(dist_src_exports); +var import_endpoint = __nccwpck_require__(59440); +var import_universal_user_agent = __nccwpck_require__(45030); -module.exports = AWS.B2bi; +// pkg/dist-src/version.js +var VERSION = "8.4.0"; +// pkg/dist-src/is-plain-object.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) + return false; + if (Object.prototype.toString.call(value) !== "[object Object]") + return false; + const proto = Object.getPrototypeOf(value); + if (proto === null) + return true; + const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); +} -/***/ }), +// pkg/dist-src/fetch-wrapper.js +var import_request_error = __nccwpck_require__(10537); -/***/ 82455: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// pkg/dist-src/get-buffer-response.js +function getBufferResponse(response) { + return response.arrayBuffer(); +} -__nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; +// pkg/dist-src/fetch-wrapper.js +function fetchWrapper(requestOptions) { + var _a, _b, _c, _d; + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; + if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); + } + let headers = {}; + let status; + let url; + let { fetch } = globalThis; + if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) { + fetch = requestOptions.request.fetch; + } + if (!fetch) { + throw new Error( + "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" + ); + } + return fetch(requestOptions.url, { + method: requestOptions.method, + body: requestOptions.body, + redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect, + headers: requestOptions.headers, + signal: (_d = requestOptions.request) == null ? void 0 : _d.signal, + // duplex must be set if request.body is ReadableStream or Async Iterables. + // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. + ...requestOptions.body && { duplex: "half" } + }).then(async (response) => { + url = response.url; + status = response.status; + for (const keyAndValue of response.headers) { + headers[keyAndValue[0]] = keyAndValue[1]; + } + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn( + `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` + ); + } + if (status === 204 || status === 205) { + return; + } + if (requestOptions.method === "HEAD") { + if (status < 400) { + return; + } + throw new import_request_error.RequestError(response.statusText, status, { + response: { + url, + status, + headers, + data: void 0 + }, + request: requestOptions + }); + } + if (status === 304) { + throw new import_request_error.RequestError("Not modified", status, { + response: { + url, + status, + headers, + data: await getResponseData(response) + }, + request: requestOptions + }); + } + if (status >= 400) { + const data = await getResponseData(response); + const error = new import_request_error.RequestError(toErrorMessage(data), status, { + response: { + url, + status, + headers, + data + }, + request: requestOptions + }); + throw error; + } + return parseSuccessResponseBody ? await getResponseData(response) : response.body; + }).then((data) => { + return { + status, + url, + headers, + data + }; + }).catch((error) => { + if (error instanceof import_request_error.RequestError) + throw error; + else if (error.name === "AbortError") + throw error; + let message = error.message; + if (error.name === "TypeError" && "cause" in error) { + if (error.cause instanceof Error) { + message = error.cause.message; + } else if (typeof error.cause === "string") { + message = error.cause; + } + } + throw new import_request_error.RequestError(message, 500, { + request: requestOptions + }); + }); +} +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); + if (/application\/json/.test(contentType)) { + return response.json().catch(() => response.text()).catch(() => ""); + } + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } + return getBufferResponse(response); +} +function toErrorMessage(data) { + if (typeof data === "string") + return data; + let suffix; + if ("documentation_url" in data) { + suffix = ` - ${data.documentation_url}`; + } else { + suffix = ""; + } + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; + } + return `${data.message}${suffix}`; + } + return `Unknown error: ${JSON.stringify(data)}`; +} -apiLoader.services['backup'] = {}; -AWS.Backup = Service.defineService('backup', ['2018-11-15']); -Object.defineProperty(apiLoader.services['backup'], '2018-11-15', { - get: function get() { - var model = __nccwpck_require__(77990); - model.paginators = (__nccwpck_require__(54869)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true -}); +// pkg/dist-src/with-defaults.js +function withDefaults(oldEndpoint, newDefaults) { + const endpoint2 = oldEndpoint.defaults(newDefaults); + const newApi = function(route, parameters) { + const endpointOptions = endpoint2.merge(route, parameters); + if (!endpointOptions.request || !endpointOptions.request.hook) { + return fetchWrapper(endpoint2.parse(endpointOptions)); + } + const request2 = (route2, parameters2) => { + return fetchWrapper( + endpoint2.parse(endpoint2.merge(route2, parameters2)) + ); + }; + Object.assign(request2, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); + return endpointOptions.request.hook(request2, endpointOptions); + }; + return Object.assign(newApi, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); +} -module.exports = AWS.Backup; +// pkg/dist-src/index.js +var request = withDefaults(import_endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` + } +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); /***/ }), -/***/ 68277: +/***/ 20940: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8029,24 +7549,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['backupgateway'] = {}; -AWS.BackupGateway = Service.defineService('backupgateway', ['2021-01-01']); -Object.defineProperty(apiLoader.services['backupgateway'], '2021-01-01', { +apiLoader.services['accessanalyzer'] = {}; +AWS.AccessAnalyzer = Service.defineService('accessanalyzer', ['2019-11-01']); +Object.defineProperty(apiLoader.services['accessanalyzer'], '2019-11-01', { get: function get() { - var model = __nccwpck_require__(96863); - model.paginators = (__nccwpck_require__(34946)/* .pagination */ .o); + var model = __nccwpck_require__(30590); + model.paginators = (__nccwpck_require__(63080)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.BackupGateway; +module.exports = AWS.AccessAnalyzer; /***/ }), -/***/ 82304: +/***/ 32400: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8054,24 +7574,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['backupstorage'] = {}; -AWS.BackupStorage = Service.defineService('backupstorage', ['2018-04-10']); -Object.defineProperty(apiLoader.services['backupstorage'], '2018-04-10', { +apiLoader.services['account'] = {}; +AWS.Account = Service.defineService('account', ['2021-02-01']); +Object.defineProperty(apiLoader.services['account'], '2021-02-01', { get: function get() { - var model = __nccwpck_require__(97436); - model.paginators = (__nccwpck_require__(73644)/* .pagination */ .o); + var model = __nccwpck_require__(36713); + model.paginators = (__nccwpck_require__(52324)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.BackupStorage; +module.exports = AWS.Account; /***/ }), -/***/ 10000: +/***/ 30838: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8079,24 +7599,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['batch'] = {}; -AWS.Batch = Service.defineService('batch', ['2016-08-10']); -Object.defineProperty(apiLoader.services['batch'], '2016-08-10', { +apiLoader.services['acm'] = {}; +AWS.ACM = Service.defineService('acm', ['2015-12-08']); +Object.defineProperty(apiLoader.services['acm'], '2015-12-08', { get: function get() { - var model = __nccwpck_require__(12617); - model.paginators = (__nccwpck_require__(36988)/* .pagination */ .o); + var model = __nccwpck_require__(34662); + model.paginators = (__nccwpck_require__(42680)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(85678)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Batch; +module.exports = AWS.ACM; /***/ }), -/***/ 56703: +/***/ 18450: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8104,50 +7625,419 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['bcmdataexports'] = {}; -AWS.BCMDataExports = Service.defineService('bcmdataexports', ['2023-11-26']); -Object.defineProperty(apiLoader.services['bcmdataexports'], '2023-11-26', { +apiLoader.services['acmpca'] = {}; +AWS.ACMPCA = Service.defineService('acmpca', ['2017-08-22']); +Object.defineProperty(apiLoader.services['acmpca'], '2017-08-22', { get: function get() { - var model = __nccwpck_require__(81311); - model.paginators = (__nccwpck_require__(56228)/* .pagination */ .o); + var model = __nccwpck_require__(33004); + model.paginators = (__nccwpck_require__(21209)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(89217)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.BCMDataExports; +module.exports = AWS.ACMPCA; /***/ }), -/***/ 88808: +/***/ 26296: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); -var AWS = __nccwpck_require__(28437); -var Service = AWS.Service; -var apiLoader = AWS.apiLoader; - -apiLoader.services['bedrock'] = {}; -AWS.Bedrock = Service.defineService('bedrock', ['2023-04-20']); -Object.defineProperty(apiLoader.services['bedrock'], '2023-04-20', { - get: function get() { - var model = __nccwpck_require__(30615); - model.paginators = (__nccwpck_require__(27869)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(81806)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); - -module.exports = AWS.Bedrock; - +module.exports = { + ACM: __nccwpck_require__(30838), + APIGateway: __nccwpck_require__(91759), + ApplicationAutoScaling: __nccwpck_require__(25598), + AppStream: __nccwpck_require__(21730), + AutoScaling: __nccwpck_require__(31652), + Batch: __nccwpck_require__(10000), + Budgets: __nccwpck_require__(43923), + CloudDirectory: __nccwpck_require__(56231), + CloudFormation: __nccwpck_require__(74643), + CloudFront: __nccwpck_require__(48058), + CloudHSM: __nccwpck_require__(59976), + CloudSearch: __nccwpck_require__(72321), + CloudSearchDomain: __nccwpck_require__(64072), + CloudTrail: __nccwpck_require__(65512), + CloudWatch: __nccwpck_require__(6763), + CloudWatchEvents: __nccwpck_require__(38124), + CloudWatchLogs: __nccwpck_require__(96693), + CodeBuild: __nccwpck_require__(60450), + CodeCommit: __nccwpck_require__(71323), + CodeDeploy: __nccwpck_require__(54599), + CodePipeline: __nccwpck_require__(22938), + CognitoIdentity: __nccwpck_require__(58291), + CognitoIdentityServiceProvider: __nccwpck_require__(31379), + CognitoSync: __nccwpck_require__(74770), + ConfigService: __nccwpck_require__(34061), + CUR: __nccwpck_require__(5026), + DataPipeline: __nccwpck_require__(65688), + DeviceFarm: __nccwpck_require__(26272), + DirectConnect: __nccwpck_require__(73783), + DirectoryService: __nccwpck_require__(83908), + Discovery: __nccwpck_require__(81690), + DMS: __nccwpck_require__(69868), + DynamoDB: __nccwpck_require__(14347), + DynamoDBStreams: __nccwpck_require__(88090), + EC2: __nccwpck_require__(7778), + ECR: __nccwpck_require__(15211), + ECS: __nccwpck_require__(16615), + EFS: __nccwpck_require__(34375), + ElastiCache: __nccwpck_require__(81065), + ElasticBeanstalk: __nccwpck_require__(14897), + ELB: __nccwpck_require__(10907), + ELBv2: __nccwpck_require__(44311), + EMR: __nccwpck_require__(50470), + ES: __nccwpck_require__(84462), + ElasticTranscoder: __nccwpck_require__(40745), + Firehose: __nccwpck_require__(92831), + GameLift: __nccwpck_require__(8085), + Glacier: __nccwpck_require__(63249), + Health: __nccwpck_require__(21834), + IAM: __nccwpck_require__(50058), + ImportExport: __nccwpck_require__(6769), + Inspector: __nccwpck_require__(89439), + Iot: __nccwpck_require__(98392), + IotData: __nccwpck_require__(6564), + Kinesis: __nccwpck_require__(49876), + KinesisAnalytics: __nccwpck_require__(90042), + KMS: __nccwpck_require__(56782), + Lambda: __nccwpck_require__(13321), + LexRuntime: __nccwpck_require__(62716), + Lightsail: __nccwpck_require__(22718), + MachineLearning: __nccwpck_require__(82907), + MarketplaceCommerceAnalytics: __nccwpck_require__(4540), + MarketplaceMetering: __nccwpck_require__(39297), + MTurk: __nccwpck_require__(79954), + MobileAnalytics: __nccwpck_require__(66690), + OpsWorks: __nccwpck_require__(75691), + OpsWorksCM: __nccwpck_require__(80388), + Organizations: __nccwpck_require__(52560), + Pinpoint: __nccwpck_require__(18388), + Polly: __nccwpck_require__(97332), + RDS: __nccwpck_require__(71578), + Redshift: __nccwpck_require__(84853), + Rekognition: __nccwpck_require__(65470), + ResourceGroupsTaggingAPI: __nccwpck_require__(7385), + Route53: __nccwpck_require__(44968), + Route53Domains: __nccwpck_require__(51994), + S3: __nccwpck_require__(83256), + S3Control: __nccwpck_require__(99817), + ServiceCatalog: __nccwpck_require__(822), + SES: __nccwpck_require__(46816), + Shield: __nccwpck_require__(20271), + SimpleDB: __nccwpck_require__(10120), + SMS: __nccwpck_require__(57719), + Snowball: __nccwpck_require__(510), + SNS: __nccwpck_require__(28581), + SQS: __nccwpck_require__(63172), + SSM: __nccwpck_require__(83380), + StorageGateway: __nccwpck_require__(89190), + StepFunctions: __nccwpck_require__(8136), + STS: __nccwpck_require__(57513), + Support: __nccwpck_require__(1099), + SWF: __nccwpck_require__(32327), + XRay: __nccwpck_require__(41548), + WAF: __nccwpck_require__(72742), + WAFRegional: __nccwpck_require__(23153), + WorkDocs: __nccwpck_require__(38835), + WorkSpaces: __nccwpck_require__(25513), + LexModelBuildingService: __nccwpck_require__(37397), + MarketplaceEntitlementService: __nccwpck_require__(53707), + Athena: __nccwpck_require__(29434), + Greengrass: __nccwpck_require__(20690), + DAX: __nccwpck_require__(71398), + MigrationHub: __nccwpck_require__(14688), + CloudHSMV2: __nccwpck_require__(70889), + Glue: __nccwpck_require__(31658), + Pricing: __nccwpck_require__(92765), + CostExplorer: __nccwpck_require__(79523), + MediaConvert: __nccwpck_require__(57220), + MediaLive: __nccwpck_require__(7509), + MediaPackage: __nccwpck_require__(91620), + MediaStore: __nccwpck_require__(83748), + MediaStoreData: __nccwpck_require__(98703), + AppSync: __nccwpck_require__(12402), + GuardDuty: __nccwpck_require__(40755), + MQ: __nccwpck_require__(23093), + Comprehend: __nccwpck_require__(62878), + IoTJobsDataPlane: __nccwpck_require__(42332), + KinesisVideoArchivedMedia: __nccwpck_require__(5580), + KinesisVideoMedia: __nccwpck_require__(81308), + KinesisVideo: __nccwpck_require__(89927), + SageMakerRuntime: __nccwpck_require__(85044), + SageMaker: __nccwpck_require__(77657), + Translate: __nccwpck_require__(72544), + ResourceGroups: __nccwpck_require__(58756), + Cloud9: __nccwpck_require__(85473), + ServerlessApplicationRepository: __nccwpck_require__(62402), + ServiceDiscovery: __nccwpck_require__(91569), + WorkMail: __nccwpck_require__(38374), + AutoScalingPlans: __nccwpck_require__(2554), + TranscribeService: __nccwpck_require__(75811), + Connect: __nccwpck_require__(13879), + ACMPCA: __nccwpck_require__(18450), + FMS: __nccwpck_require__(11316), + SecretsManager: __nccwpck_require__(85131), + IoTAnalytics: __nccwpck_require__(67409), + IoT1ClickDevicesService: __nccwpck_require__(39474), + IoT1ClickProjects: __nccwpck_require__(4686), + PI: __nccwpck_require__(15505), + Neptune: __nccwpck_require__(30047), + MediaTailor: __nccwpck_require__(99658), + EKS: __nccwpck_require__(23337), + DLM: __nccwpck_require__(24958), + Signer: __nccwpck_require__(71596), + Chime: __nccwpck_require__(84646), + PinpointEmail: __nccwpck_require__(83060), + RAM: __nccwpck_require__(94394), + Route53Resolver: __nccwpck_require__(25894), + PinpointSMSVoice: __nccwpck_require__(46605), + QuickSight: __nccwpck_require__(29898), + RDSDataService: __nccwpck_require__(30147), + Amplify: __nccwpck_require__(38090), + DataSync: __nccwpck_require__(25308), + RoboMaker: __nccwpck_require__(18068), + Transfer: __nccwpck_require__(51585), + GlobalAccelerator: __nccwpck_require__(19306), + ComprehendMedical: __nccwpck_require__(32349), + KinesisAnalyticsV2: __nccwpck_require__(74631), + MediaConnect: __nccwpck_require__(67639), + FSx: __nccwpck_require__(60642), + SecurityHub: __nccwpck_require__(21550), + AppMesh: __nccwpck_require__(69226), + LicenseManager: __nccwpck_require__(34693), + Kafka: __nccwpck_require__(56775), + ApiGatewayManagementApi: __nccwpck_require__(31762), + ApiGatewayV2: __nccwpck_require__(44987), + DocDB: __nccwpck_require__(55129), + Backup: __nccwpck_require__(82455), + WorkLink: __nccwpck_require__(48579), + Textract: __nccwpck_require__(58523), + ManagedBlockchain: __nccwpck_require__(85143), + MediaPackageVod: __nccwpck_require__(14962), + GroundStation: __nccwpck_require__(80494), + IoTThingsGraph: __nccwpck_require__(58905), + IoTEvents: __nccwpck_require__(88065), + IoTEventsData: __nccwpck_require__(56973), + Personalize: __nccwpck_require__(33696), + PersonalizeEvents: __nccwpck_require__(88170), + PersonalizeRuntime: __nccwpck_require__(66184), + ApplicationInsights: __nccwpck_require__(83972), + ServiceQuotas: __nccwpck_require__(57800), + EC2InstanceConnect: __nccwpck_require__(92209), + EventBridge: __nccwpck_require__(898), + LakeFormation: __nccwpck_require__(6726), + ForecastService: __nccwpck_require__(12942), + ForecastQueryService: __nccwpck_require__(36822), + QLDB: __nccwpck_require__(71266), + QLDBSession: __nccwpck_require__(55423), + WorkMailMessageFlow: __nccwpck_require__(67025), + CodeStarNotifications: __nccwpck_require__(15141), + SavingsPlans: __nccwpck_require__(62825), + SSO: __nccwpck_require__(71096), + SSOOIDC: __nccwpck_require__(49870), + MarketplaceCatalog: __nccwpck_require__(2609), + DataExchange: __nccwpck_require__(11024), + SESV2: __nccwpck_require__(20142), + MigrationHubConfig: __nccwpck_require__(62658), + ConnectParticipant: __nccwpck_require__(94198), + AppConfig: __nccwpck_require__(78606), + IoTSecureTunneling: __nccwpck_require__(98562), + WAFV2: __nccwpck_require__(50353), + ElasticInference: __nccwpck_require__(37708), + Imagebuilder: __nccwpck_require__(57511), + Schemas: __nccwpck_require__(55713), + AccessAnalyzer: __nccwpck_require__(20940), + CodeGuruReviewer: __nccwpck_require__(60070), + CodeGuruProfiler: __nccwpck_require__(65704), + ComputeOptimizer: __nccwpck_require__(64459), + FraudDetector: __nccwpck_require__(99830), + Kendra: __nccwpck_require__(66122), + NetworkManager: __nccwpck_require__(37610), + Outposts: __nccwpck_require__(27551), + AugmentedAIRuntime: __nccwpck_require__(33960), + EBS: __nccwpck_require__(62837), + KinesisVideoSignalingChannels: __nccwpck_require__(12710), + Detective: __nccwpck_require__(60674), + CodeStarconnections: __nccwpck_require__(78270), + Synthetics: __nccwpck_require__(25910), + IoTSiteWise: __nccwpck_require__(89690), + Macie2: __nccwpck_require__(57330), + CodeArtifact: __nccwpck_require__(91983), + IVS: __nccwpck_require__(67701), + Braket: __nccwpck_require__(35429), + IdentityStore: __nccwpck_require__(60222), + Appflow: __nccwpck_require__(60844), + RedshiftData: __nccwpck_require__(203), + SSOAdmin: __nccwpck_require__(66644), + TimestreamQuery: __nccwpck_require__(24529), + TimestreamWrite: __nccwpck_require__(1573), + S3Outposts: __nccwpck_require__(90493), + DataBrew: __nccwpck_require__(35846), + ServiceCatalogAppRegistry: __nccwpck_require__(79068), + NetworkFirewall: __nccwpck_require__(84626), + MWAA: __nccwpck_require__(32712), + AmplifyBackend: __nccwpck_require__(2806), + AppIntegrations: __nccwpck_require__(85479), + ConnectContactLens: __nccwpck_require__(41847), + DevOpsGuru: __nccwpck_require__(90673), + ECRPUBLIC: __nccwpck_require__(90244), + LookoutVision: __nccwpck_require__(65046), + SageMakerFeatureStoreRuntime: __nccwpck_require__(67644), + CustomerProfiles: __nccwpck_require__(28379), + AuditManager: __nccwpck_require__(20472), + EMRcontainers: __nccwpck_require__(49984), + HealthLake: __nccwpck_require__(64254), + SagemakerEdge: __nccwpck_require__(38966), + Amp: __nccwpck_require__(96881), + GreengrassV2: __nccwpck_require__(45126), + IotDeviceAdvisor: __nccwpck_require__(97569), + IoTFleetHub: __nccwpck_require__(42513), + IoTWireless: __nccwpck_require__(8226), + Location: __nccwpck_require__(44594), + WellArchitected: __nccwpck_require__(86263), + LexModelsV2: __nccwpck_require__(27254), + LexRuntimeV2: __nccwpck_require__(33855), + Fis: __nccwpck_require__(73003), + LookoutMetrics: __nccwpck_require__(78708), + Mgn: __nccwpck_require__(41339), + LookoutEquipment: __nccwpck_require__(21843), + Nimble: __nccwpck_require__(89428), + Finspace: __nccwpck_require__(3052), + Finspacedata: __nccwpck_require__(96869), + SSMContacts: __nccwpck_require__(12577), + SSMIncidents: __nccwpck_require__(20590), + ApplicationCostProfiler: __nccwpck_require__(20887), + AppRunner: __nccwpck_require__(75589), + Proton: __nccwpck_require__(9275), + Route53RecoveryCluster: __nccwpck_require__(35738), + Route53RecoveryControlConfig: __nccwpck_require__(16063), + Route53RecoveryReadiness: __nccwpck_require__(79106), + ChimeSDKIdentity: __nccwpck_require__(55975), + ChimeSDKMessaging: __nccwpck_require__(25255), + SnowDeviceManagement: __nccwpck_require__(64655), + MemoryDB: __nccwpck_require__(50782), + OpenSearch: __nccwpck_require__(60358), + KafkaConnect: __nccwpck_require__(61879), + VoiceID: __nccwpck_require__(28747), + Wisdom: __nccwpck_require__(85266), + Account: __nccwpck_require__(32400), + CloudControl: __nccwpck_require__(25630), + Grafana: __nccwpck_require__(51050), + Panorama: __nccwpck_require__(20368), + ChimeSDKMeetings: __nccwpck_require__(80788), + Resiliencehub: __nccwpck_require__(21173), + MigrationHubStrategy: __nccwpck_require__(96533), + AppConfigData: __nccwpck_require__(45282), + Drs: __nccwpck_require__(41116), + MigrationHubRefactorSpaces: __nccwpck_require__(2925), + Evidently: __nccwpck_require__(21440), + Inspector2: __nccwpck_require__(98650), + Rbin: __nccwpck_require__(70145), + RUM: __nccwpck_require__(53237), + BackupGateway: __nccwpck_require__(68277), + IoTTwinMaker: __nccwpck_require__(65010), + WorkSpacesWeb: __nccwpck_require__(94124), + AmplifyUIBuilder: __nccwpck_require__(89937), + Keyspaces: __nccwpck_require__(24789), + Billingconductor: __nccwpck_require__(38416), + PinpointSMSVoiceV2: __nccwpck_require__(478), + Ivschat: __nccwpck_require__(17077), + ChimeSDKMediaPipelines: __nccwpck_require__(18423), + EMRServerless: __nccwpck_require__(219), + M2: __nccwpck_require__(22482), + ConnectCampaigns: __nccwpck_require__(42789), + RedshiftServerless: __nccwpck_require__(29987), + RolesAnywhere: __nccwpck_require__(83604), + LicenseManagerUserSubscriptions: __nccwpck_require__(37725), + PrivateNetworks: __nccwpck_require__(63088), + SupportApp: __nccwpck_require__(51288), + ControlTower: __nccwpck_require__(77574), + IoTFleetWise: __nccwpck_require__(94329), + MigrationHubOrchestrator: __nccwpck_require__(66120), + ConnectCases: __nccwpck_require__(72223), + ResourceExplorer2: __nccwpck_require__(74071), + Scheduler: __nccwpck_require__(94840), + ChimeSDKVoice: __nccwpck_require__(349), + SsmSap: __nccwpck_require__(44552), + OAM: __nccwpck_require__(9319), + ARCZonalShift: __nccwpck_require__(54280), + Omics: __nccwpck_require__(75114), + OpenSearchServerless: __nccwpck_require__(86277), + SecurityLake: __nccwpck_require__(84296), + SimSpaceWeaver: __nccwpck_require__(37090), + DocDBElastic: __nccwpck_require__(20792), + SageMakerGeospatial: __nccwpck_require__(4707), + CodeCatalyst: __nccwpck_require__(19499), + Pipes: __nccwpck_require__(14220), + SageMakerMetrics: __nccwpck_require__(28199), + KinesisVideoWebRTCStorage: __nccwpck_require__(52642), + LicenseManagerLinuxSubscriptions: __nccwpck_require__(52687), + KendraRanking: __nccwpck_require__(46255), + CleanRooms: __nccwpck_require__(15130), + CloudTrailData: __nccwpck_require__(31191), + Tnb: __nccwpck_require__(15300), + InternetMonitor: __nccwpck_require__(84099), + IVSRealTime: __nccwpck_require__(51946), + VPCLattice: __nccwpck_require__(78952), + OSIS: __nccwpck_require__(98021), + MediaPackageV2: __nccwpck_require__(53264), + PaymentCryptography: __nccwpck_require__(11594), + PaymentCryptographyData: __nccwpck_require__(96559), + CodeGuruSecurity: __nccwpck_require__(32620), + VerifiedPermissions: __nccwpck_require__(35604), + AppFabric: __nccwpck_require__(46318), + MedicalImaging: __nccwpck_require__(79712), + EntityResolution: __nccwpck_require__(22697), + ManagedBlockchainQuery: __nccwpck_require__(51046), + Neptunedata: __nccwpck_require__(25737), + PcaConnectorAd: __nccwpck_require__(55959), + Bedrock: __nccwpck_require__(88808), + BedrockRuntime: __nccwpck_require__(99177), + DataZone: __nccwpck_require__(31763), + LaunchWizard: __nccwpck_require__(71060), + TrustedAdvisor: __nccwpck_require__(4992), + InspectorScan: __nccwpck_require__(25467), + BCMDataExports: __nccwpck_require__(56703), + CostOptimizationHub: __nccwpck_require__(55443), + EKSAuth: __nccwpck_require__(66164), + FreeTier: __nccwpck_require__(11681), + Repostspace: __nccwpck_require__(21154), + WorkSpacesThinClient: __nccwpck_require__(22033), + B2bi: __nccwpck_require__(91065), + BedrockAgent: __nccwpck_require__(9025), + BedrockAgentRuntime: __nccwpck_require__(16946), + QBusiness: __nccwpck_require__(26842), + QConnect: __nccwpck_require__(39094), + CleanRoomsML: __nccwpck_require__(47594), + MarketplaceAgreement: __nccwpck_require__(50379), + MarketplaceDeployment: __nccwpck_require__(56811), + NetworkMonitor: __nccwpck_require__(77614), + SupplyChain: __nccwpck_require__(39674), + Artifact: __nccwpck_require__(63151), + Chatbot: __nccwpck_require__(14373), + TimestreamInfluxDB: __nccwpck_require__(13610), + CodeConnections: __nccwpck_require__(19123), + Deadline: __nccwpck_require__(29242), + ControlCatalog: __nccwpck_require__(87324), + Route53Profiles: __nccwpck_require__(13907), + MailManager: __nccwpck_require__(46253), + TaxSettings: __nccwpck_require__(44688), + ApplicationSignals: __nccwpck_require__(17535), + PcaConnectorScep: __nccwpck_require__(72523), + AppTest: __nccwpck_require__(50505), + QApps: __nccwpck_require__(2725), + SSMQuickSetup: __nccwpck_require__(99330), + PCS: __nccwpck_require__(6301) +}; /***/ }), -/***/ 9025: +/***/ 96881: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8155,24 +8045,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['bedrockagent'] = {}; -AWS.BedrockAgent = Service.defineService('bedrockagent', ['2023-06-05']); -Object.defineProperty(apiLoader.services['bedrockagent'], '2023-06-05', { +apiLoader.services['amp'] = {}; +AWS.Amp = Service.defineService('amp', ['2020-08-01']); +Object.defineProperty(apiLoader.services['amp'], '2020-08-01', { get: function get() { - var model = __nccwpck_require__(30755); - model.paginators = (__nccwpck_require__(7041)/* .pagination */ .o); + var model = __nccwpck_require__(78362); + model.paginators = (__nccwpck_require__(75928)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(58239)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.BedrockAgent; +module.exports = AWS.Amp; /***/ }), -/***/ 16946: +/***/ 38090: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8180,24 +8071,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['bedrockagentruntime'] = {}; -AWS.BedrockAgentRuntime = Service.defineService('bedrockagentruntime', ['2023-07-26']); -Object.defineProperty(apiLoader.services['bedrockagentruntime'], '2023-07-26', { +apiLoader.services['amplify'] = {}; +AWS.Amplify = Service.defineService('amplify', ['2017-07-25']); +Object.defineProperty(apiLoader.services['amplify'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(65069); - model.paginators = (__nccwpck_require__(79273)/* .pagination */ .o); + var model = __nccwpck_require__(36813); + model.paginators = (__nccwpck_require__(53733)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.BedrockAgentRuntime; +module.exports = AWS.Amplify; /***/ }), -/***/ 99177: +/***/ 2806: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8205,25 +8096,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['bedrockruntime'] = {}; -AWS.BedrockRuntime = Service.defineService('bedrockruntime', ['2023-09-30']); -Object.defineProperty(apiLoader.services['bedrockruntime'], '2023-09-30', { +apiLoader.services['amplifybackend'] = {}; +AWS.AmplifyBackend = Service.defineService('amplifybackend', ['2020-08-11']); +Object.defineProperty(apiLoader.services['amplifybackend'], '2020-08-11', { get: function get() { - var model = __nccwpck_require__(38801); - model.paginators = (__nccwpck_require__(89474)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(34859)/* .waiters */ .V); + var model = __nccwpck_require__(23939); + model.paginators = (__nccwpck_require__(27232)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.BedrockRuntime; +module.exports = AWS.AmplifyBackend; /***/ }), -/***/ 38416: +/***/ 89937: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8231,25 +8121,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['billingconductor'] = {}; -AWS.Billingconductor = Service.defineService('billingconductor', ['2021-07-30']); -Object.defineProperty(apiLoader.services['billingconductor'], '2021-07-30', { +apiLoader.services['amplifyuibuilder'] = {}; +AWS.AmplifyUIBuilder = Service.defineService('amplifyuibuilder', ['2021-08-11']); +Object.defineProperty(apiLoader.services['amplifyuibuilder'], '2021-08-11', { get: function get() { - var model = __nccwpck_require__(54862); - model.paginators = (__nccwpck_require__(97894)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(64224)/* .waiters */ .V); + var model = __nccwpck_require__(48987); + model.paginators = (__nccwpck_require__(56072)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(70564)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Billingconductor; +module.exports = AWS.AmplifyUIBuilder; /***/ }), -/***/ 35429: +/***/ 91759: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8257,24 +8147,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['braket'] = {}; -AWS.Braket = Service.defineService('braket', ['2019-09-01']); -Object.defineProperty(apiLoader.services['braket'], '2019-09-01', { +apiLoader.services['apigateway'] = {}; +AWS.APIGateway = Service.defineService('apigateway', ['2015-07-09']); +__nccwpck_require__(4338); +Object.defineProperty(apiLoader.services['apigateway'], '2015-07-09', { get: function get() { - var model = __nccwpck_require__(23332); - model.paginators = (__nccwpck_require__(15732)/* .pagination */ .o); + var model = __nccwpck_require__(59463); + model.paginators = (__nccwpck_require__(25878)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Braket; +module.exports = AWS.APIGateway; /***/ }), -/***/ 43923: +/***/ 31762: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8282,24 +8173,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['budgets'] = {}; -AWS.Budgets = Service.defineService('budgets', ['2016-10-20']); -Object.defineProperty(apiLoader.services['budgets'], '2016-10-20', { +apiLoader.services['apigatewaymanagementapi'] = {}; +AWS.ApiGatewayManagementApi = Service.defineService('apigatewaymanagementapi', ['2018-11-29']); +Object.defineProperty(apiLoader.services['apigatewaymanagementapi'], '2018-11-29', { get: function get() { - var model = __nccwpck_require__(11978); - model.paginators = (__nccwpck_require__(23694)/* .pagination */ .o); + var model = __nccwpck_require__(57832); + model.paginators = (__nccwpck_require__(2787)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Budgets; +module.exports = AWS.ApiGatewayManagementApi; /***/ }), -/***/ 84646: +/***/ 44987: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8307,24 +8198,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['chime'] = {}; -AWS.Chime = Service.defineService('chime', ['2018-05-01']); -Object.defineProperty(apiLoader.services['chime'], '2018-05-01', { +apiLoader.services['apigatewayv2'] = {}; +AWS.ApiGatewayV2 = Service.defineService('apigatewayv2', ['2018-11-29']); +Object.defineProperty(apiLoader.services['apigatewayv2'], '2018-11-29', { get: function get() { - var model = __nccwpck_require__(44811); - model.paginators = (__nccwpck_require__(31890)/* .pagination */ .o); + var model = __nccwpck_require__(59326); + model.paginators = (__nccwpck_require__(90171)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Chime; +module.exports = AWS.ApiGatewayV2; /***/ }), -/***/ 55975: +/***/ 78606: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8332,24 +8223,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['chimesdkidentity'] = {}; -AWS.ChimeSDKIdentity = Service.defineService('chimesdkidentity', ['2021-04-20']); -Object.defineProperty(apiLoader.services['chimesdkidentity'], '2021-04-20', { +apiLoader.services['appconfig'] = {}; +AWS.AppConfig = Service.defineService('appconfig', ['2019-10-09']); +Object.defineProperty(apiLoader.services['appconfig'], '2019-10-09', { get: function get() { - var model = __nccwpck_require__(97402); - model.paginators = (__nccwpck_require__(133)/* .pagination */ .o); + var model = __nccwpck_require__(44701); + model.paginators = (__nccwpck_require__(41789)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ChimeSDKIdentity; +module.exports = AWS.AppConfig; /***/ }), -/***/ 18423: +/***/ 45282: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8357,24 +8248,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['chimesdkmediapipelines'] = {}; -AWS.ChimeSDKMediaPipelines = Service.defineService('chimesdkmediapipelines', ['2021-07-15']); -Object.defineProperty(apiLoader.services['chimesdkmediapipelines'], '2021-07-15', { +apiLoader.services['appconfigdata'] = {}; +AWS.AppConfigData = Service.defineService('appconfigdata', ['2021-11-11']); +Object.defineProperty(apiLoader.services['appconfigdata'], '2021-11-11', { get: function get() { - var model = __nccwpck_require__(14679); - model.paginators = (__nccwpck_require__(82201)/* .pagination */ .o); + var model = __nccwpck_require__(86796); + model.paginators = (__nccwpck_require__(48010)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ChimeSDKMediaPipelines; +module.exports = AWS.AppConfigData; /***/ }), -/***/ 80788: +/***/ 46318: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8382,24 +8273,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['chimesdkmeetings'] = {}; -AWS.ChimeSDKMeetings = Service.defineService('chimesdkmeetings', ['2021-07-15']); -Object.defineProperty(apiLoader.services['chimesdkmeetings'], '2021-07-15', { +apiLoader.services['appfabric'] = {}; +AWS.AppFabric = Service.defineService('appfabric', ['2023-05-19']); +Object.defineProperty(apiLoader.services['appfabric'], '2023-05-19', { get: function get() { - var model = __nccwpck_require__(17090); - model.paginators = (__nccwpck_require__(70582)/* .pagination */ .o); + var model = __nccwpck_require__(78267); + model.paginators = (__nccwpck_require__(42193)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(44821)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ChimeSDKMeetings; +module.exports = AWS.AppFabric; /***/ }), -/***/ 25255: +/***/ 60844: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8407,24 +8299,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['chimesdkmessaging'] = {}; -AWS.ChimeSDKMessaging = Service.defineService('chimesdkmessaging', ['2021-05-15']); -Object.defineProperty(apiLoader.services['chimesdkmessaging'], '2021-05-15', { +apiLoader.services['appflow'] = {}; +AWS.Appflow = Service.defineService('appflow', ['2020-08-23']); +Object.defineProperty(apiLoader.services['appflow'], '2020-08-23', { get: function get() { - var model = __nccwpck_require__(52239); - model.paginators = (__nccwpck_require__(60807)/* .pagination */ .o); + var model = __nccwpck_require__(32840); + model.paginators = (__nccwpck_require__(16916)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ChimeSDKMessaging; +module.exports = AWS.Appflow; /***/ }), -/***/ 349: +/***/ 85479: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8432,24 +8324,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['chimesdkvoice'] = {}; -AWS.ChimeSDKVoice = Service.defineService('chimesdkvoice', ['2022-08-03']); -Object.defineProperty(apiLoader.services['chimesdkvoice'], '2022-08-03', { +apiLoader.services['appintegrations'] = {}; +AWS.AppIntegrations = Service.defineService('appintegrations', ['2020-07-29']); +Object.defineProperty(apiLoader.services['appintegrations'], '2020-07-29', { get: function get() { - var model = __nccwpck_require__(26420); - model.paginators = (__nccwpck_require__(7986)/* .pagination */ .o); + var model = __nccwpck_require__(62033); + model.paginators = (__nccwpck_require__(61866)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ChimeSDKVoice; +module.exports = AWS.AppIntegrations; /***/ }), -/***/ 15130: +/***/ 25598: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8457,25 +8349,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cleanrooms'] = {}; -AWS.CleanRooms = Service.defineService('cleanrooms', ['2022-02-17']); -Object.defineProperty(apiLoader.services['cleanrooms'], '2022-02-17', { +apiLoader.services['applicationautoscaling'] = {}; +AWS.ApplicationAutoScaling = Service.defineService('applicationautoscaling', ['2016-02-06']); +Object.defineProperty(apiLoader.services['applicationautoscaling'], '2016-02-06', { get: function get() { - var model = __nccwpck_require__(11585); - model.paginators = (__nccwpck_require__(73060)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(29284)/* .waiters */ .V); + var model = __nccwpck_require__(47320); + model.paginators = (__nccwpck_require__(40322)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CleanRooms; +module.exports = AWS.ApplicationAutoScaling; /***/ }), -/***/ 47594: +/***/ 20887: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8483,24 +8374,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cleanroomsml'] = {}; -AWS.CleanRoomsML = Service.defineService('cleanroomsml', ['2023-09-06']); -Object.defineProperty(apiLoader.services['cleanroomsml'], '2023-09-06', { +apiLoader.services['applicationcostprofiler'] = {}; +AWS.ApplicationCostProfiler = Service.defineService('applicationcostprofiler', ['2020-09-10']); +Object.defineProperty(apiLoader.services['applicationcostprofiler'], '2020-09-10', { get: function get() { - var model = __nccwpck_require__(1867); - model.paginators = (__nccwpck_require__(89767)/* .pagination */ .o); + var model = __nccwpck_require__(96818); + model.paginators = (__nccwpck_require__(41331)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CleanRoomsML; +module.exports = AWS.ApplicationCostProfiler; /***/ }), -/***/ 85473: +/***/ 83972: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8508,24 +8399,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloud9'] = {}; -AWS.Cloud9 = Service.defineService('cloud9', ['2017-09-23']); -Object.defineProperty(apiLoader.services['cloud9'], '2017-09-23', { +apiLoader.services['applicationinsights'] = {}; +AWS.ApplicationInsights = Service.defineService('applicationinsights', ['2018-11-25']); +Object.defineProperty(apiLoader.services['applicationinsights'], '2018-11-25', { get: function get() { - var model = __nccwpck_require__(82981); - model.paginators = (__nccwpck_require__(9313)/* .pagination */ .o); + var model = __nccwpck_require__(96143); + model.paginators = (__nccwpck_require__(22242)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Cloud9; +module.exports = AWS.ApplicationInsights; /***/ }), -/***/ 25630: +/***/ 17535: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8533,25 +8424,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudcontrol'] = {}; -AWS.CloudControl = Service.defineService('cloudcontrol', ['2021-09-30']); -Object.defineProperty(apiLoader.services['cloudcontrol'], '2021-09-30', { +apiLoader.services['applicationsignals'] = {}; +AWS.ApplicationSignals = Service.defineService('applicationsignals', ['2024-04-15']); +Object.defineProperty(apiLoader.services['applicationsignals'], '2024-04-15', { get: function get() { - var model = __nccwpck_require__(24689); - model.paginators = (__nccwpck_require__(16041)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(31933)/* .waiters */ .V); + var model = __nccwpck_require__(75196); + model.paginators = (__nccwpck_require__(15302)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudControl; +module.exports = AWS.ApplicationSignals; /***/ }), -/***/ 56231: +/***/ 69226: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8559,33 +8449,33 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['clouddirectory'] = {}; -AWS.CloudDirectory = Service.defineService('clouddirectory', ['2016-05-10', '2016-05-10*', '2017-01-11']); -Object.defineProperty(apiLoader.services['clouddirectory'], '2016-05-10', { +apiLoader.services['appmesh'] = {}; +AWS.AppMesh = Service.defineService('appmesh', ['2018-10-01', '2018-10-01*', '2019-01-25']); +Object.defineProperty(apiLoader.services['appmesh'], '2018-10-01', { get: function get() { - var model = __nccwpck_require__(72862); - model.paginators = (__nccwpck_require__(87597)/* .pagination */ .o); + var model = __nccwpck_require__(64780); + model.paginators = (__nccwpck_require__(54936)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -Object.defineProperty(apiLoader.services['clouddirectory'], '2017-01-11', { +Object.defineProperty(apiLoader.services['appmesh'], '2019-01-25', { get: function get() { - var model = __nccwpck_require__(88729); - model.paginators = (__nccwpck_require__(10156)/* .pagination */ .o); + var model = __nccwpck_require__(78066); + model.paginators = (__nccwpck_require__(37698)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudDirectory; +module.exports = AWS.AppMesh; /***/ }), -/***/ 74643: +/***/ 75589: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8593,25 +8483,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudformation'] = {}; -AWS.CloudFormation = Service.defineService('cloudformation', ['2010-05-15']); -Object.defineProperty(apiLoader.services['cloudformation'], '2010-05-15', { +apiLoader.services['apprunner'] = {}; +AWS.AppRunner = Service.defineService('apprunner', ['2020-05-15']); +Object.defineProperty(apiLoader.services['apprunner'], '2020-05-15', { get: function get() { - var model = __nccwpck_require__(31930); - model.paginators = (__nccwpck_require__(10611)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(53732)/* .waiters */ .V); + var model = __nccwpck_require__(30036); + model.paginators = (__nccwpck_require__(50293)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudFormation; +module.exports = AWS.AppRunner; /***/ }), -/***/ 48058: +/***/ 21730: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8619,86 +8508,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudfront'] = {}; -AWS.CloudFront = Service.defineService('cloudfront', ['2013-05-12*', '2013-11-11*', '2014-05-31*', '2014-10-21*', '2014-11-06*', '2015-04-17*', '2015-07-27*', '2015-09-17*', '2016-01-13*', '2016-01-28*', '2016-08-01*', '2016-08-20*', '2016-09-07*', '2016-09-29*', '2016-11-25', '2016-11-25*', '2017-03-25', '2017-03-25*', '2017-10-30', '2017-10-30*', '2018-06-18', '2018-06-18*', '2018-11-05', '2018-11-05*', '2019-03-26', '2019-03-26*', '2020-05-31']); -__nccwpck_require__(95483); -Object.defineProperty(apiLoader.services['cloudfront'], '2016-11-25', { - get: function get() { - var model = __nccwpck_require__(64908); - model.paginators = (__nccwpck_require__(57305)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(71106)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['cloudfront'], '2017-03-25', { - get: function get() { - var model = __nccwpck_require__(76944); - model.paginators = (__nccwpck_require__(83654)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(83406)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['cloudfront'], '2017-10-30', { - get: function get() { - var model = __nccwpck_require__(80198); - model.paginators = (__nccwpck_require__(52915)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(13399)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['cloudfront'], '2018-06-18', { - get: function get() { - var model = __nccwpck_require__(29549); - model.paginators = (__nccwpck_require__(7805)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(2353)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['cloudfront'], '2018-11-05', { - get: function get() { - var model = __nccwpck_require__(22253); - model.paginators = (__nccwpck_require__(29533)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(36883)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['cloudfront'], '2019-03-26', { - get: function get() { - var model = __nccwpck_require__(29574); - model.paginators = (__nccwpck_require__(35556)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(97142)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['cloudfront'], '2020-05-31', { +apiLoader.services['appstream'] = {}; +AWS.AppStream = Service.defineService('appstream', ['2016-12-01']); +Object.defineProperty(apiLoader.services['appstream'], '2016-12-01', { get: function get() { - var model = __nccwpck_require__(66310); - model.paginators = (__nccwpck_require__(48335)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(83517)/* .waiters */ .V); + var model = __nccwpck_require__(85538); + model.paginators = (__nccwpck_require__(32191)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(21134)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudFront; +module.exports = AWS.AppStream; /***/ }), -/***/ 47859: +/***/ 12402: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8706,24 +8534,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudfrontkeyvaluestore'] = {}; -AWS.CloudFrontKeyValueStore = Service.defineService('cloudfrontkeyvaluestore', ['2022-07-26']); -Object.defineProperty(apiLoader.services['cloudfrontkeyvaluestore'], '2022-07-26', { +apiLoader.services['appsync'] = {}; +AWS.AppSync = Service.defineService('appsync', ['2017-07-25']); +Object.defineProperty(apiLoader.services['appsync'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(49651); - model.paginators = (__nccwpck_require__(41274)/* .pagination */ .o); + var model = __nccwpck_require__(94937); + model.paginators = (__nccwpck_require__(50233)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudFrontKeyValueStore; +module.exports = AWS.AppSync; /***/ }), -/***/ 59976: +/***/ 50505: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8731,24 +8559,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudhsm'] = {}; -AWS.CloudHSM = Service.defineService('cloudhsm', ['2014-05-30']); -Object.defineProperty(apiLoader.services['cloudhsm'], '2014-05-30', { +apiLoader.services['apptest'] = {}; +AWS.AppTest = Service.defineService('apptest', ['2022-12-06']); +Object.defineProperty(apiLoader.services['apptest'], '2022-12-06', { get: function get() { - var model = __nccwpck_require__(18637); - model.paginators = (__nccwpck_require__(18988)/* .pagination */ .o); + var model = __nccwpck_require__(53250); + model.paginators = (__nccwpck_require__(32351)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(60289)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudHSM; +module.exports = AWS.AppTest; /***/ }), -/***/ 70889: +/***/ 54280: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8756,24 +8585,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudhsmv2'] = {}; -AWS.CloudHSMV2 = Service.defineService('cloudhsmv2', ['2017-04-28']); -Object.defineProperty(apiLoader.services['cloudhsmv2'], '2017-04-28', { +apiLoader.services['arczonalshift'] = {}; +AWS.ARCZonalShift = Service.defineService('arczonalshift', ['2022-10-30']); +Object.defineProperty(apiLoader.services['arczonalshift'], '2022-10-30', { get: function get() { - var model = __nccwpck_require__(90554); - model.paginators = (__nccwpck_require__(77334)/* .pagination */ .o); + var model = __nccwpck_require__(52286); + model.paginators = (__nccwpck_require__(70002)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudHSMV2; +module.exports = AWS.ARCZonalShift; /***/ }), -/***/ 72321: +/***/ 63151: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8781,33 +8610,50 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudsearch'] = {}; -AWS.CloudSearch = Service.defineService('cloudsearch', ['2011-02-01', '2013-01-01']); -Object.defineProperty(apiLoader.services['cloudsearch'], '2011-02-01', { +apiLoader.services['artifact'] = {}; +AWS.Artifact = Service.defineService('artifact', ['2018-05-10']); +Object.defineProperty(apiLoader.services['artifact'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(11732); - model.paginators = (__nccwpck_require__(51357)/* .pagination */ .o); + var model = __nccwpck_require__(76591); + model.paginators = (__nccwpck_require__(2961)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(35293)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -Object.defineProperty(apiLoader.services['cloudsearch'], '2013-01-01', { + +module.exports = AWS.Artifact; + + +/***/ }), + +/***/ 29434: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['athena'] = {}; +AWS.Athena = Service.defineService('athena', ['2017-05-18']); +Object.defineProperty(apiLoader.services['athena'], '2017-05-18', { get: function get() { - var model = __nccwpck_require__(56880); - model.paginators = (__nccwpck_require__(81127)/* .pagination */ .o); + var model = __nccwpck_require__(28680); + model.paginators = (__nccwpck_require__(44417)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudSearch; +module.exports = AWS.Athena; /***/ }), -/***/ 64072: +/***/ 20472: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8815,24 +8661,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudsearchdomain'] = {}; -AWS.CloudSearchDomain = Service.defineService('cloudsearchdomain', ['2013-01-01']); -__nccwpck_require__(48571); -Object.defineProperty(apiLoader.services['cloudsearchdomain'], '2013-01-01', { +apiLoader.services['auditmanager'] = {}; +AWS.AuditManager = Service.defineService('auditmanager', ['2017-07-25']); +Object.defineProperty(apiLoader.services['auditmanager'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(78255); + var model = __nccwpck_require__(41672); + model.paginators = (__nccwpck_require__(41321)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudSearchDomain; +module.exports = AWS.AuditManager; /***/ }), -/***/ 65512: +/***/ 33960: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8840,24 +8686,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudtrail'] = {}; -AWS.CloudTrail = Service.defineService('cloudtrail', ['2013-11-01']); -Object.defineProperty(apiLoader.services['cloudtrail'], '2013-11-01', { +apiLoader.services['augmentedairuntime'] = {}; +AWS.AugmentedAIRuntime = Service.defineService('augmentedairuntime', ['2019-11-07']); +Object.defineProperty(apiLoader.services['augmentedairuntime'], '2019-11-07', { get: function get() { - var model = __nccwpck_require__(11506); - model.paginators = (__nccwpck_require__(27523)/* .pagination */ .o); + var model = __nccwpck_require__(57704); + model.paginators = (__nccwpck_require__(13201)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudTrail; +module.exports = AWS.AugmentedAIRuntime; /***/ }), -/***/ 31191: +/***/ 31652: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8865,24 +8711,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudtraildata'] = {}; -AWS.CloudTrailData = Service.defineService('cloudtraildata', ['2021-08-11']); -Object.defineProperty(apiLoader.services['cloudtraildata'], '2021-08-11', { +apiLoader.services['autoscaling'] = {}; +AWS.AutoScaling = Service.defineService('autoscaling', ['2011-01-01']); +Object.defineProperty(apiLoader.services['autoscaling'], '2011-01-01', { get: function get() { - var model = __nccwpck_require__(27372); - model.paginators = (__nccwpck_require__(79223)/* .pagination */ .o); + var model = __nccwpck_require__(55394); + model.paginators = (__nccwpck_require__(81436)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudTrailData; +module.exports = AWS.AutoScaling; /***/ }), -/***/ 6763: +/***/ 2554: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8890,25 +8736,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudwatch'] = {}; -AWS.CloudWatch = Service.defineService('cloudwatch', ['2010-08-01']); -Object.defineProperty(apiLoader.services['cloudwatch'], '2010-08-01', { +apiLoader.services['autoscalingplans'] = {}; +AWS.AutoScalingPlans = Service.defineService('autoscalingplans', ['2018-01-06']); +Object.defineProperty(apiLoader.services['autoscalingplans'], '2018-01-06', { get: function get() { - var model = __nccwpck_require__(16363); - model.paginators = (__nccwpck_require__(46675)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(21466)/* .waiters */ .V); + var model = __nccwpck_require__(53216); + model.paginators = (__nccwpck_require__(64985)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudWatch; +module.exports = AWS.AutoScalingPlans; /***/ }), -/***/ 38124: +/***/ 91065: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8916,24 +8761,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudwatchevents'] = {}; -AWS.CloudWatchEvents = Service.defineService('cloudwatchevents', ['2014-02-03*', '2015-10-07']); -Object.defineProperty(apiLoader.services['cloudwatchevents'], '2015-10-07', { +apiLoader.services['b2bi'] = {}; +AWS.B2bi = Service.defineService('b2bi', ['2022-06-23']); +Object.defineProperty(apiLoader.services['b2bi'], '2022-06-23', { get: function get() { - var model = __nccwpck_require__(40299); - model.paginators = (__nccwpck_require__(54031)/* .pagination */ .o); + var model = __nccwpck_require__(93012); + model.paginators = (__nccwpck_require__(13608)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudWatchEvents; +module.exports = AWS.B2bi; /***/ }), -/***/ 96693: +/***/ 82455: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8941,24 +8786,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cloudwatchlogs'] = {}; -AWS.CloudWatchLogs = Service.defineService('cloudwatchlogs', ['2014-03-28']); -Object.defineProperty(apiLoader.services['cloudwatchlogs'], '2014-03-28', { +apiLoader.services['backup'] = {}; +AWS.Backup = Service.defineService('backup', ['2018-11-15']); +Object.defineProperty(apiLoader.services['backup'], '2018-11-15', { get: function get() { - var model = __nccwpck_require__(73044); - model.paginators = (__nccwpck_require__(15472)/* .pagination */ .o); + var model = __nccwpck_require__(77990); + model.paginators = (__nccwpck_require__(54869)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CloudWatchLogs; +module.exports = AWS.Backup; /***/ }), -/***/ 91983: +/***/ 68277: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8966,24 +8811,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codeartifact'] = {}; -AWS.CodeArtifact = Service.defineService('codeartifact', ['2018-09-22']); -Object.defineProperty(apiLoader.services['codeartifact'], '2018-09-22', { +apiLoader.services['backupgateway'] = {}; +AWS.BackupGateway = Service.defineService('backupgateway', ['2021-01-01']); +Object.defineProperty(apiLoader.services['backupgateway'], '2021-01-01', { get: function get() { - var model = __nccwpck_require__(87923); - model.paginators = (__nccwpck_require__(40983)/* .pagination */ .o); + var model = __nccwpck_require__(96863); + model.paginators = (__nccwpck_require__(34946)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeArtifact; +module.exports = AWS.BackupGateway; /***/ }), -/***/ 60450: +/***/ 10000: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -8991,24 +8836,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codebuild'] = {}; -AWS.CodeBuild = Service.defineService('codebuild', ['2016-10-06']); -Object.defineProperty(apiLoader.services['codebuild'], '2016-10-06', { +apiLoader.services['batch'] = {}; +AWS.Batch = Service.defineService('batch', ['2016-08-10']); +Object.defineProperty(apiLoader.services['batch'], '2016-08-10', { get: function get() { - var model = __nccwpck_require__(40893); - model.paginators = (__nccwpck_require__(23010)/* .pagination */ .o); + var model = __nccwpck_require__(12617); + model.paginators = (__nccwpck_require__(36988)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeBuild; +module.exports = AWS.Batch; /***/ }), -/***/ 19499: +/***/ 56703: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9016,25 +8861,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codecatalyst'] = {}; -AWS.CodeCatalyst = Service.defineService('codecatalyst', ['2022-09-28']); -Object.defineProperty(apiLoader.services['codecatalyst'], '2022-09-28', { +apiLoader.services['bcmdataexports'] = {}; +AWS.BCMDataExports = Service.defineService('bcmdataexports', ['2023-11-26']); +Object.defineProperty(apiLoader.services['bcmdataexports'], '2023-11-26', { get: function get() { - var model = __nccwpck_require__(22999); - model.paginators = (__nccwpck_require__(14522)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(42522)/* .waiters */ .V); + var model = __nccwpck_require__(81311); + model.paginators = (__nccwpck_require__(56228)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeCatalyst; +module.exports = AWS.BCMDataExports; /***/ }), -/***/ 71323: +/***/ 88808: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9042,24 +8886,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codecommit'] = {}; -AWS.CodeCommit = Service.defineService('codecommit', ['2015-04-13']); -Object.defineProperty(apiLoader.services['codecommit'], '2015-04-13', { +apiLoader.services['bedrock'] = {}; +AWS.Bedrock = Service.defineService('bedrock', ['2023-04-20']); +Object.defineProperty(apiLoader.services['bedrock'], '2023-04-20', { get: function get() { - var model = __nccwpck_require__(57144); - model.paginators = (__nccwpck_require__(62599)/* .pagination */ .o); + var model = __nccwpck_require__(30615); + model.paginators = (__nccwpck_require__(27869)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(81806)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeCommit; +module.exports = AWS.Bedrock; /***/ }), -/***/ 54599: +/***/ 9025: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9067,25 +8912,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codedeploy'] = {}; -AWS.CodeDeploy = Service.defineService('codedeploy', ['2014-10-06']); -Object.defineProperty(apiLoader.services['codedeploy'], '2014-10-06', { +apiLoader.services['bedrockagent'] = {}; +AWS.BedrockAgent = Service.defineService('bedrockagent', ['2023-06-05']); +Object.defineProperty(apiLoader.services['bedrockagent'], '2023-06-05', { get: function get() { - var model = __nccwpck_require__(10967); - model.paginators = (__nccwpck_require__(1917)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(52416)/* .waiters */ .V); + var model = __nccwpck_require__(30755); + model.paginators = (__nccwpck_require__(7041)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeDeploy; +module.exports = AWS.BedrockAgent; /***/ }), -/***/ 65704: +/***/ 16946: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9093,24 +8937,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codeguruprofiler'] = {}; -AWS.CodeGuruProfiler = Service.defineService('codeguruprofiler', ['2019-07-18']); -Object.defineProperty(apiLoader.services['codeguruprofiler'], '2019-07-18', { +apiLoader.services['bedrockagentruntime'] = {}; +AWS.BedrockAgentRuntime = Service.defineService('bedrockagentruntime', ['2023-07-26']); +Object.defineProperty(apiLoader.services['bedrockagentruntime'], '2023-07-26', { get: function get() { - var model = __nccwpck_require__(34890); - model.paginators = (__nccwpck_require__(25274)/* .pagination */ .o); + var model = __nccwpck_require__(65069); + model.paginators = (__nccwpck_require__(79273)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeGuruProfiler; +module.exports = AWS.BedrockAgentRuntime; /***/ }), -/***/ 60070: +/***/ 99177: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9118,25 +8962,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codegurureviewer'] = {}; -AWS.CodeGuruReviewer = Service.defineService('codegurureviewer', ['2019-09-19']); -Object.defineProperty(apiLoader.services['codegurureviewer'], '2019-09-19', { +apiLoader.services['bedrockruntime'] = {}; +AWS.BedrockRuntime = Service.defineService('bedrockruntime', ['2023-09-30']); +Object.defineProperty(apiLoader.services['bedrockruntime'], '2023-09-30', { get: function get() { - var model = __nccwpck_require__(66739); - model.paginators = (__nccwpck_require__(37775)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(69276)/* .waiters */ .V); + var model = __nccwpck_require__(38801); + model.paginators = (__nccwpck_require__(89474)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(34859)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeGuruReviewer; +module.exports = AWS.BedrockRuntime; /***/ }), -/***/ 32620: +/***/ 38416: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9144,24 +8988,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codegurusecurity'] = {}; -AWS.CodeGuruSecurity = Service.defineService('codegurusecurity', ['2018-05-10']); -Object.defineProperty(apiLoader.services['codegurusecurity'], '2018-05-10', { +apiLoader.services['billingconductor'] = {}; +AWS.Billingconductor = Service.defineService('billingconductor', ['2021-07-30']); +Object.defineProperty(apiLoader.services['billingconductor'], '2021-07-30', { get: function get() { - var model = __nccwpck_require__(7662); - model.paginators = (__nccwpck_require__(77755)/* .pagination */ .o); + var model = __nccwpck_require__(54862); + model.paginators = (__nccwpck_require__(97894)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(64224)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeGuruSecurity; +module.exports = AWS.Billingconductor; /***/ }), -/***/ 22938: +/***/ 35429: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9169,24 +9014,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codepipeline'] = {}; -AWS.CodePipeline = Service.defineService('codepipeline', ['2015-07-09']); -Object.defineProperty(apiLoader.services['codepipeline'], '2015-07-09', { +apiLoader.services['braket'] = {}; +AWS.Braket = Service.defineService('braket', ['2019-09-01']); +Object.defineProperty(apiLoader.services['braket'], '2019-09-01', { get: function get() { - var model = __nccwpck_require__(4039); - model.paginators = (__nccwpck_require__(78953)/* .pagination */ .o); + var model = __nccwpck_require__(23332); + model.paginators = (__nccwpck_require__(15732)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodePipeline; +module.exports = AWS.Braket; /***/ }), -/***/ 98336: +/***/ 43923: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9194,24 +9039,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codestar'] = {}; -AWS.CodeStar = Service.defineService('codestar', ['2017-04-19']); -Object.defineProperty(apiLoader.services['codestar'], '2017-04-19', { +apiLoader.services['budgets'] = {}; +AWS.Budgets = Service.defineService('budgets', ['2016-10-20']); +Object.defineProperty(apiLoader.services['budgets'], '2016-10-20', { get: function get() { - var model = __nccwpck_require__(12425); - model.paginators = (__nccwpck_require__(70046)/* .pagination */ .o); + var model = __nccwpck_require__(11978); + model.paginators = (__nccwpck_require__(23694)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeStar; +module.exports = AWS.Budgets; /***/ }), -/***/ 78270: +/***/ 14373: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9219,24 +9064,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codestarconnections'] = {}; -AWS.CodeStarconnections = Service.defineService('codestarconnections', ['2019-12-01']); -Object.defineProperty(apiLoader.services['codestarconnections'], '2019-12-01', { +apiLoader.services['chatbot'] = {}; +AWS.Chatbot = Service.defineService('chatbot', ['2017-10-11']); +Object.defineProperty(apiLoader.services['chatbot'], '2017-10-11', { get: function get() { - var model = __nccwpck_require__(88428); - model.paginators = (__nccwpck_require__(31506)/* .pagination */ .o); + var model = __nccwpck_require__(39802); + model.paginators = (__nccwpck_require__(81040)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeStarconnections; +module.exports = AWS.Chatbot; /***/ }), -/***/ 15141: +/***/ 84646: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9244,24 +9089,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['codestarnotifications'] = {}; -AWS.CodeStarNotifications = Service.defineService('codestarnotifications', ['2019-10-15']); -Object.defineProperty(apiLoader.services['codestarnotifications'], '2019-10-15', { +apiLoader.services['chime'] = {}; +AWS.Chime = Service.defineService('chime', ['2018-05-01']); +Object.defineProperty(apiLoader.services['chime'], '2018-05-01', { get: function get() { - var model = __nccwpck_require__(33362); - model.paginators = (__nccwpck_require__(44301)/* .pagination */ .o); + var model = __nccwpck_require__(44811); + model.paginators = (__nccwpck_require__(31890)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CodeStarNotifications; +module.exports = AWS.Chime; /***/ }), -/***/ 58291: +/***/ 55975: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9269,24 +9114,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cognitoidentity'] = {}; -AWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']); -Object.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', { +apiLoader.services['chimesdkidentity'] = {}; +AWS.ChimeSDKIdentity = Service.defineService('chimesdkidentity', ['2021-04-20']); +Object.defineProperty(apiLoader.services['chimesdkidentity'], '2021-04-20', { get: function get() { - var model = __nccwpck_require__(57377); - model.paginators = (__nccwpck_require__(85010)/* .pagination */ .o); + var model = __nccwpck_require__(97402); + model.paginators = (__nccwpck_require__(133)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CognitoIdentity; +module.exports = AWS.ChimeSDKIdentity; /***/ }), -/***/ 31379: +/***/ 18423: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9294,24 +9139,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cognitoidentityserviceprovider'] = {}; -AWS.CognitoIdentityServiceProvider = Service.defineService('cognitoidentityserviceprovider', ['2016-04-18']); -Object.defineProperty(apiLoader.services['cognitoidentityserviceprovider'], '2016-04-18', { +apiLoader.services['chimesdkmediapipelines'] = {}; +AWS.ChimeSDKMediaPipelines = Service.defineService('chimesdkmediapipelines', ['2021-07-15']); +Object.defineProperty(apiLoader.services['chimesdkmediapipelines'], '2021-07-15', { get: function get() { - var model = __nccwpck_require__(53166); - model.paginators = (__nccwpck_require__(17149)/* .pagination */ .o); + var model = __nccwpck_require__(14679); + model.paginators = (__nccwpck_require__(82201)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CognitoIdentityServiceProvider; +module.exports = AWS.ChimeSDKMediaPipelines; /***/ }), -/***/ 74770: +/***/ 80788: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9319,24 +9164,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cognitosync'] = {}; -AWS.CognitoSync = Service.defineService('cognitosync', ['2014-06-30']); -Object.defineProperty(apiLoader.services['cognitosync'], '2014-06-30', { +apiLoader.services['chimesdkmeetings'] = {}; +AWS.ChimeSDKMeetings = Service.defineService('chimesdkmeetings', ['2021-07-15']); +Object.defineProperty(apiLoader.services['chimesdkmeetings'], '2021-07-15', { get: function get() { - var model = __nccwpck_require__(29128); - model.paginators = (__nccwpck_require__(5865)/* .pagination */ .o); + var model = __nccwpck_require__(17090); + model.paginators = (__nccwpck_require__(70582)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CognitoSync; +module.exports = AWS.ChimeSDKMeetings; /***/ }), -/***/ 62878: +/***/ 25255: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9344,24 +9189,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['comprehend'] = {}; -AWS.Comprehend = Service.defineService('comprehend', ['2017-11-27']); -Object.defineProperty(apiLoader.services['comprehend'], '2017-11-27', { +apiLoader.services['chimesdkmessaging'] = {}; +AWS.ChimeSDKMessaging = Service.defineService('chimesdkmessaging', ['2021-05-15']); +Object.defineProperty(apiLoader.services['chimesdkmessaging'], '2021-05-15', { get: function get() { - var model = __nccwpck_require__(24433); - model.paginators = (__nccwpck_require__(82518)/* .pagination */ .o); + var model = __nccwpck_require__(52239); + model.paginators = (__nccwpck_require__(60807)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Comprehend; +module.exports = AWS.ChimeSDKMessaging; /***/ }), -/***/ 32349: +/***/ 349: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9369,24 +9214,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['comprehendmedical'] = {}; -AWS.ComprehendMedical = Service.defineService('comprehendmedical', ['2018-10-30']); -Object.defineProperty(apiLoader.services['comprehendmedical'], '2018-10-30', { +apiLoader.services['chimesdkvoice'] = {}; +AWS.ChimeSDKVoice = Service.defineService('chimesdkvoice', ['2022-08-03']); +Object.defineProperty(apiLoader.services['chimesdkvoice'], '2022-08-03', { get: function get() { - var model = __nccwpck_require__(96649); - model.paginators = (__nccwpck_require__(43172)/* .pagination */ .o); + var model = __nccwpck_require__(26420); + model.paginators = (__nccwpck_require__(7986)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ComprehendMedical; +module.exports = AWS.ChimeSDKVoice; /***/ }), -/***/ 64459: +/***/ 15130: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9394,24 +9239,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['computeoptimizer'] = {}; -AWS.ComputeOptimizer = Service.defineService('computeoptimizer', ['2019-11-01']); -Object.defineProperty(apiLoader.services['computeoptimizer'], '2019-11-01', { +apiLoader.services['cleanrooms'] = {}; +AWS.CleanRooms = Service.defineService('cleanrooms', ['2022-02-17']); +Object.defineProperty(apiLoader.services['cleanrooms'], '2022-02-17', { get: function get() { - var model = __nccwpck_require__(85802); - model.paginators = (__nccwpck_require__(6831)/* .pagination */ .o); + var model = __nccwpck_require__(11585); + model.paginators = (__nccwpck_require__(73060)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(29284)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ComputeOptimizer; +module.exports = AWS.CleanRooms; /***/ }), -/***/ 34061: +/***/ 47594: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9419,24 +9265,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['configservice'] = {}; -AWS.ConfigService = Service.defineService('configservice', ['2014-11-12']); -Object.defineProperty(apiLoader.services['configservice'], '2014-11-12', { +apiLoader.services['cleanroomsml'] = {}; +AWS.CleanRoomsML = Service.defineService('cleanroomsml', ['2023-09-06']); +Object.defineProperty(apiLoader.services['cleanroomsml'], '2023-09-06', { get: function get() { - var model = __nccwpck_require__(47124); - model.paginators = (__nccwpck_require__(85980)/* .pagination */ .o); + var model = __nccwpck_require__(1867); + model.paginators = (__nccwpck_require__(89767)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(39743)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ConfigService; +module.exports = AWS.CleanRoomsML; /***/ }), -/***/ 13879: +/***/ 85473: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9444,24 +9291,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['connect'] = {}; -AWS.Connect = Service.defineService('connect', ['2017-08-08']); -Object.defineProperty(apiLoader.services['connect'], '2017-08-08', { +apiLoader.services['cloud9'] = {}; +AWS.Cloud9 = Service.defineService('cloud9', ['2017-09-23']); +Object.defineProperty(apiLoader.services['cloud9'], '2017-09-23', { get: function get() { - var model = __nccwpck_require__(54511); - model.paginators = (__nccwpck_require__(19742)/* .pagination */ .o); + var model = __nccwpck_require__(82981); + model.paginators = (__nccwpck_require__(9313)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Connect; +module.exports = AWS.Cloud9; /***/ }), -/***/ 42789: +/***/ 25630: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9469,24 +9316,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['connectcampaigns'] = {}; -AWS.ConnectCampaigns = Service.defineService('connectcampaigns', ['2021-01-30']); -Object.defineProperty(apiLoader.services['connectcampaigns'], '2021-01-30', { +apiLoader.services['cloudcontrol'] = {}; +AWS.CloudControl = Service.defineService('cloudcontrol', ['2021-09-30']); +Object.defineProperty(apiLoader.services['cloudcontrol'], '2021-09-30', { get: function get() { - var model = __nccwpck_require__(71566); - model.paginators = (__nccwpck_require__(45198)/* .pagination */ .o); + var model = __nccwpck_require__(24689); + model.paginators = (__nccwpck_require__(16041)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(31933)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ConnectCampaigns; +module.exports = AWS.CloudControl; /***/ }), -/***/ 72223: +/***/ 56231: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9494,24 +9342,33 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['connectcases'] = {}; -AWS.ConnectCases = Service.defineService('connectcases', ['2022-10-03']); -Object.defineProperty(apiLoader.services['connectcases'], '2022-10-03', { +apiLoader.services['clouddirectory'] = {}; +AWS.CloudDirectory = Service.defineService('clouddirectory', ['2016-05-10', '2016-05-10*', '2017-01-11']); +Object.defineProperty(apiLoader.services['clouddirectory'], '2016-05-10', { get: function get() { - var model = __nccwpck_require__(3923); - model.paginators = (__nccwpck_require__(8429)/* .pagination */ .o); + var model = __nccwpck_require__(72862); + model.paginators = (__nccwpck_require__(87597)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['clouddirectory'], '2017-01-11', { + get: function get() { + var model = __nccwpck_require__(88729); + model.paginators = (__nccwpck_require__(10156)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ConnectCases; +module.exports = AWS.CloudDirectory; /***/ }), -/***/ 41847: +/***/ 74643: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9519,24 +9376,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['connectcontactlens'] = {}; -AWS.ConnectContactLens = Service.defineService('connectcontactlens', ['2020-08-21']); -Object.defineProperty(apiLoader.services['connectcontactlens'], '2020-08-21', { +apiLoader.services['cloudformation'] = {}; +AWS.CloudFormation = Service.defineService('cloudformation', ['2010-05-15']); +Object.defineProperty(apiLoader.services['cloudformation'], '2010-05-15', { get: function get() { - var model = __nccwpck_require__(16527); - model.paginators = (__nccwpck_require__(76658)/* .pagination */ .o); + var model = __nccwpck_require__(31930); + model.paginators = (__nccwpck_require__(10611)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(53732)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ConnectContactLens; +module.exports = AWS.CloudFormation; /***/ }), -/***/ 94198: +/***/ 48058: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9544,24 +9402,86 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['connectparticipant'] = {}; -AWS.ConnectParticipant = Service.defineService('connectparticipant', ['2018-09-07']); -Object.defineProperty(apiLoader.services['connectparticipant'], '2018-09-07', { +apiLoader.services['cloudfront'] = {}; +AWS.CloudFront = Service.defineService('cloudfront', ['2013-05-12*', '2013-11-11*', '2014-05-31*', '2014-10-21*', '2014-11-06*', '2015-04-17*', '2015-07-27*', '2015-09-17*', '2016-01-13*', '2016-01-28*', '2016-08-01*', '2016-08-20*', '2016-09-07*', '2016-09-29*', '2016-11-25', '2016-11-25*', '2017-03-25', '2017-03-25*', '2017-10-30', '2017-10-30*', '2018-06-18', '2018-06-18*', '2018-11-05', '2018-11-05*', '2019-03-26', '2019-03-26*', '2020-05-31']); +__nccwpck_require__(95483); +Object.defineProperty(apiLoader.services['cloudfront'], '2016-11-25', { get: function get() { - var model = __nccwpck_require__(70132); - model.paginators = (__nccwpck_require__(29947)/* .pagination */ .o); + var model = __nccwpck_require__(64908); + model.paginators = (__nccwpck_require__(57305)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(71106)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['cloudfront'], '2017-03-25', { + get: function get() { + var model = __nccwpck_require__(76944); + model.paginators = (__nccwpck_require__(83654)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(83406)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['cloudfront'], '2017-10-30', { + get: function get() { + var model = __nccwpck_require__(80198); + model.paginators = (__nccwpck_require__(52915)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(13399)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['cloudfront'], '2018-06-18', { + get: function get() { + var model = __nccwpck_require__(29549); + model.paginators = (__nccwpck_require__(7805)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(2353)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['cloudfront'], '2018-11-05', { + get: function get() { + var model = __nccwpck_require__(22253); + model.paginators = (__nccwpck_require__(29533)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(36883)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['cloudfront'], '2019-03-26', { + get: function get() { + var model = __nccwpck_require__(29574); + model.paginators = (__nccwpck_require__(35556)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(97142)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['cloudfront'], '2020-05-31', { + get: function get() { + var model = __nccwpck_require__(66310); + model.paginators = (__nccwpck_require__(48335)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(83517)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ConnectParticipant; +module.exports = AWS.CloudFront; /***/ }), -/***/ 77574: +/***/ 59976: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9569,24 +9489,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['controltower'] = {}; -AWS.ControlTower = Service.defineService('controltower', ['2018-05-10']); -Object.defineProperty(apiLoader.services['controltower'], '2018-05-10', { +apiLoader.services['cloudhsm'] = {}; +AWS.CloudHSM = Service.defineService('cloudhsm', ['2014-05-30']); +Object.defineProperty(apiLoader.services['cloudhsm'], '2014-05-30', { get: function get() { - var model = __nccwpck_require__(1095); - model.paginators = (__nccwpck_require__(55167)/* .pagination */ .o); + var model = __nccwpck_require__(18637); + model.paginators = (__nccwpck_require__(18988)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ControlTower; +module.exports = AWS.CloudHSM; /***/ }), -/***/ 79523: +/***/ 70889: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9594,24 +9514,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['costexplorer'] = {}; -AWS.CostExplorer = Service.defineService('costexplorer', ['2017-10-25']); -Object.defineProperty(apiLoader.services['costexplorer'], '2017-10-25', { +apiLoader.services['cloudhsmv2'] = {}; +AWS.CloudHSMV2 = Service.defineService('cloudhsmv2', ['2017-04-28']); +Object.defineProperty(apiLoader.services['cloudhsmv2'], '2017-04-28', { get: function get() { - var model = __nccwpck_require__(4060); - model.paginators = (__nccwpck_require__(75642)/* .pagination */ .o); + var model = __nccwpck_require__(90554); + model.paginators = (__nccwpck_require__(77334)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CostExplorer; +module.exports = AWS.CloudHSMV2; /***/ }), -/***/ 55443: +/***/ 72321: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9619,24 +9539,33 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['costoptimizationhub'] = {}; -AWS.CostOptimizationHub = Service.defineService('costoptimizationhub', ['2022-07-26']); -Object.defineProperty(apiLoader.services['costoptimizationhub'], '2022-07-26', { +apiLoader.services['cloudsearch'] = {}; +AWS.CloudSearch = Service.defineService('cloudsearch', ['2011-02-01', '2013-01-01']); +Object.defineProperty(apiLoader.services['cloudsearch'], '2011-02-01', { get: function get() { - var model = __nccwpck_require__(56073); - model.paginators = (__nccwpck_require__(70563)/* .pagination */ .o); + var model = __nccwpck_require__(11732); + model.paginators = (__nccwpck_require__(51357)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['cloudsearch'], '2013-01-01', { + get: function get() { + var model = __nccwpck_require__(56880); + model.paginators = (__nccwpck_require__(81127)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CostOptimizationHub; +module.exports = AWS.CloudSearch; /***/ }), -/***/ 5026: +/***/ 64072: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9644,24 +9573,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['cur'] = {}; -AWS.CUR = Service.defineService('cur', ['2017-01-06']); -Object.defineProperty(apiLoader.services['cur'], '2017-01-06', { +apiLoader.services['cloudsearchdomain'] = {}; +AWS.CloudSearchDomain = Service.defineService('cloudsearchdomain', ['2013-01-01']); +__nccwpck_require__(48571); +Object.defineProperty(apiLoader.services['cloudsearchdomain'], '2013-01-01', { get: function get() { - var model = __nccwpck_require__(46858); - model.paginators = (__nccwpck_require__(40528)/* .pagination */ .o); + var model = __nccwpck_require__(78255); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CUR; +module.exports = AWS.CloudSearchDomain; /***/ }), -/***/ 28379: +/***/ 65512: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9669,24 +9598,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['customerprofiles'] = {}; -AWS.CustomerProfiles = Service.defineService('customerprofiles', ['2020-08-15']); -Object.defineProperty(apiLoader.services['customerprofiles'], '2020-08-15', { +apiLoader.services['cloudtrail'] = {}; +AWS.CloudTrail = Service.defineService('cloudtrail', ['2013-11-01']); +Object.defineProperty(apiLoader.services['cloudtrail'], '2013-11-01', { get: function get() { - var model = __nccwpck_require__(56793); - model.paginators = (__nccwpck_require__(53892)/* .pagination */ .o); + var model = __nccwpck_require__(11506); + model.paginators = (__nccwpck_require__(27523)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.CustomerProfiles; +module.exports = AWS.CloudTrail; /***/ }), -/***/ 35846: +/***/ 31191: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9694,24 +9623,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['databrew'] = {}; -AWS.DataBrew = Service.defineService('databrew', ['2017-07-25']); -Object.defineProperty(apiLoader.services['databrew'], '2017-07-25', { +apiLoader.services['cloudtraildata'] = {}; +AWS.CloudTrailData = Service.defineService('cloudtraildata', ['2021-08-11']); +Object.defineProperty(apiLoader.services['cloudtraildata'], '2021-08-11', { get: function get() { - var model = __nccwpck_require__(96089); - model.paginators = (__nccwpck_require__(92224)/* .pagination */ .o); + var model = __nccwpck_require__(27372); + model.paginators = (__nccwpck_require__(79223)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DataBrew; +module.exports = AWS.CloudTrailData; /***/ }), -/***/ 11024: +/***/ 6763: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9719,25 +9648,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['dataexchange'] = {}; -AWS.DataExchange = Service.defineService('dataexchange', ['2017-07-25']); -Object.defineProperty(apiLoader.services['dataexchange'], '2017-07-25', { +apiLoader.services['cloudwatch'] = {}; +AWS.CloudWatch = Service.defineService('cloudwatch', ['2010-08-01']); +Object.defineProperty(apiLoader.services['cloudwatch'], '2010-08-01', { get: function get() { - var model = __nccwpck_require__(42346); - model.paginators = (__nccwpck_require__(55607)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(43176)/* .waiters */ .V); + var model = __nccwpck_require__(16363); + model.paginators = (__nccwpck_require__(46675)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(21466)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DataExchange; +module.exports = AWS.CloudWatch; /***/ }), -/***/ 65688: +/***/ 38124: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9745,24 +9674,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['datapipeline'] = {}; -AWS.DataPipeline = Service.defineService('datapipeline', ['2012-10-29']); -Object.defineProperty(apiLoader.services['datapipeline'], '2012-10-29', { +apiLoader.services['cloudwatchevents'] = {}; +AWS.CloudWatchEvents = Service.defineService('cloudwatchevents', ['2014-02-03*', '2015-10-07']); +Object.defineProperty(apiLoader.services['cloudwatchevents'], '2015-10-07', { get: function get() { - var model = __nccwpck_require__(79908); - model.paginators = (__nccwpck_require__(89659)/* .pagination */ .o); + var model = __nccwpck_require__(40299); + model.paginators = (__nccwpck_require__(54031)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DataPipeline; +module.exports = AWS.CloudWatchEvents; /***/ }), -/***/ 25308: +/***/ 96693: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9770,24 +9699,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['datasync'] = {}; -AWS.DataSync = Service.defineService('datasync', ['2018-11-09']); -Object.defineProperty(apiLoader.services['datasync'], '2018-11-09', { +apiLoader.services['cloudwatchlogs'] = {}; +AWS.CloudWatchLogs = Service.defineService('cloudwatchlogs', ['2014-03-28']); +Object.defineProperty(apiLoader.services['cloudwatchlogs'], '2014-03-28', { get: function get() { - var model = __nccwpck_require__(93640); - model.paginators = (__nccwpck_require__(80063)/* .pagination */ .o); + var model = __nccwpck_require__(73044); + model.paginators = (__nccwpck_require__(15472)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DataSync; +module.exports = AWS.CloudWatchLogs; /***/ }), -/***/ 31763: +/***/ 91983: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9795,24 +9724,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['datazone'] = {}; -AWS.DataZone = Service.defineService('datazone', ['2018-05-10']); -Object.defineProperty(apiLoader.services['datazone'], '2018-05-10', { +apiLoader.services['codeartifact'] = {}; +AWS.CodeArtifact = Service.defineService('codeartifact', ['2018-09-22']); +Object.defineProperty(apiLoader.services['codeartifact'], '2018-09-22', { get: function get() { - var model = __nccwpck_require__(70813); - model.paginators = (__nccwpck_require__(10509)/* .pagination */ .o); + var model = __nccwpck_require__(87923); + model.paginators = (__nccwpck_require__(40983)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DataZone; +module.exports = AWS.CodeArtifact; /***/ }), -/***/ 71398: +/***/ 60450: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9820,24 +9749,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['dax'] = {}; -AWS.DAX = Service.defineService('dax', ['2017-04-19']); -Object.defineProperty(apiLoader.services['dax'], '2017-04-19', { +apiLoader.services['codebuild'] = {}; +AWS.CodeBuild = Service.defineService('codebuild', ['2016-10-06']); +Object.defineProperty(apiLoader.services['codebuild'], '2016-10-06', { get: function get() { - var model = __nccwpck_require__(24709); - model.paginators = (__nccwpck_require__(87564)/* .pagination */ .o); + var model = __nccwpck_require__(40893); + model.paginators = (__nccwpck_require__(23010)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DAX; +module.exports = AWS.CodeBuild; /***/ }), -/***/ 60674: +/***/ 19499: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9845,24 +9774,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['detective'] = {}; -AWS.Detective = Service.defineService('detective', ['2018-10-26']); -Object.defineProperty(apiLoader.services['detective'], '2018-10-26', { +apiLoader.services['codecatalyst'] = {}; +AWS.CodeCatalyst = Service.defineService('codecatalyst', ['2022-09-28']); +Object.defineProperty(apiLoader.services['codecatalyst'], '2022-09-28', { get: function get() { - var model = __nccwpck_require__(25236); - model.paginators = (__nccwpck_require__(46384)/* .pagination */ .o); + var model = __nccwpck_require__(22999); + model.paginators = (__nccwpck_require__(14522)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(42522)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Detective; +module.exports = AWS.CodeCatalyst; /***/ }), -/***/ 26272: +/***/ 71323: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9870,24 +9800,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['devicefarm'] = {}; -AWS.DeviceFarm = Service.defineService('devicefarm', ['2015-06-23']); -Object.defineProperty(apiLoader.services['devicefarm'], '2015-06-23', { +apiLoader.services['codecommit'] = {}; +AWS.CodeCommit = Service.defineService('codecommit', ['2015-04-13']); +Object.defineProperty(apiLoader.services['codecommit'], '2015-04-13', { get: function get() { - var model = __nccwpck_require__(34023); - model.paginators = (__nccwpck_require__(37161)/* .pagination */ .o); + var model = __nccwpck_require__(57144); + model.paginators = (__nccwpck_require__(62599)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DeviceFarm; +module.exports = AWS.CodeCommit; /***/ }), -/***/ 90673: +/***/ 19123: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9895,24 +9825,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['devopsguru'] = {}; -AWS.DevOpsGuru = Service.defineService('devopsguru', ['2020-12-01']); -Object.defineProperty(apiLoader.services['devopsguru'], '2020-12-01', { +apiLoader.services['codeconnections'] = {}; +AWS.CodeConnections = Service.defineService('codeconnections', ['2023-12-01']); +Object.defineProperty(apiLoader.services['codeconnections'], '2023-12-01', { get: function get() { - var model = __nccwpck_require__(36592); - model.paginators = (__nccwpck_require__(95551)/* .pagination */ .o); + var model = __nccwpck_require__(21781); + model.paginators = (__nccwpck_require__(96720)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DevOpsGuru; +module.exports = AWS.CodeConnections; /***/ }), -/***/ 73783: +/***/ 54599: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9920,24 +9850,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['directconnect'] = {}; -AWS.DirectConnect = Service.defineService('directconnect', ['2012-10-25']); -Object.defineProperty(apiLoader.services['directconnect'], '2012-10-25', { +apiLoader.services['codedeploy'] = {}; +AWS.CodeDeploy = Service.defineService('codedeploy', ['2014-10-06']); +Object.defineProperty(apiLoader.services['codedeploy'], '2014-10-06', { get: function get() { - var model = __nccwpck_require__(45125); - model.paginators = (__nccwpck_require__(26404)/* .pagination */ .o); + var model = __nccwpck_require__(10967); + model.paginators = (__nccwpck_require__(1917)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(52416)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DirectConnect; +module.exports = AWS.CodeDeploy; /***/ }), -/***/ 83908: +/***/ 65704: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9945,24 +9876,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['directoryservice'] = {}; -AWS.DirectoryService = Service.defineService('directoryservice', ['2015-04-16']); -Object.defineProperty(apiLoader.services['directoryservice'], '2015-04-16', { +apiLoader.services['codeguruprofiler'] = {}; +AWS.CodeGuruProfiler = Service.defineService('codeguruprofiler', ['2019-07-18']); +Object.defineProperty(apiLoader.services['codeguruprofiler'], '2019-07-18', { get: function get() { - var model = __nccwpck_require__(47357); - model.paginators = (__nccwpck_require__(93412)/* .pagination */ .o); + var model = __nccwpck_require__(34890); + model.paginators = (__nccwpck_require__(25274)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DirectoryService; +module.exports = AWS.CodeGuruProfiler; /***/ }), -/***/ 81690: +/***/ 60070: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9970,24 +9901,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['discovery'] = {}; -AWS.Discovery = Service.defineService('discovery', ['2015-11-01']); -Object.defineProperty(apiLoader.services['discovery'], '2015-11-01', { +apiLoader.services['codegurureviewer'] = {}; +AWS.CodeGuruReviewer = Service.defineService('codegurureviewer', ['2019-09-19']); +Object.defineProperty(apiLoader.services['codegurureviewer'], '2019-09-19', { get: function get() { - var model = __nccwpck_require__(68951); - model.paginators = (__nccwpck_require__(19822)/* .pagination */ .o); + var model = __nccwpck_require__(66739); + model.paginators = (__nccwpck_require__(37775)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(69276)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Discovery; +module.exports = AWS.CodeGuruReviewer; /***/ }), -/***/ 24958: +/***/ 32620: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -9995,24 +9927,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['dlm'] = {}; -AWS.DLM = Service.defineService('dlm', ['2018-01-12']); -Object.defineProperty(apiLoader.services['dlm'], '2018-01-12', { +apiLoader.services['codegurusecurity'] = {}; +AWS.CodeGuruSecurity = Service.defineService('codegurusecurity', ['2018-05-10']); +Object.defineProperty(apiLoader.services['codegurusecurity'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(75485); - model.paginators = (__nccwpck_require__(98881)/* .pagination */ .o); + var model = __nccwpck_require__(7662); + model.paginators = (__nccwpck_require__(77755)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DLM; +module.exports = AWS.CodeGuruSecurity; /***/ }), -/***/ 69868: +/***/ 22938: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10020,25 +9952,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['dms'] = {}; -AWS.DMS = Service.defineService('dms', ['2016-01-01']); -Object.defineProperty(apiLoader.services['dms'], '2016-01-01', { +apiLoader.services['codepipeline'] = {}; +AWS.CodePipeline = Service.defineService('codepipeline', ['2015-07-09']); +Object.defineProperty(apiLoader.services['codepipeline'], '2015-07-09', { get: function get() { - var model = __nccwpck_require__(77953); - model.paginators = (__nccwpck_require__(36772)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(3500)/* .waiters */ .V); + var model = __nccwpck_require__(4039); + model.paginators = (__nccwpck_require__(78953)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DMS; +module.exports = AWS.CodePipeline; /***/ }), -/***/ 55129: +/***/ 78270: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10046,26 +9977,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['docdb'] = {}; -AWS.DocDB = Service.defineService('docdb', ['2014-10-31']); -__nccwpck_require__(59050); -Object.defineProperty(apiLoader.services['docdb'], '2014-10-31', { +apiLoader.services['codestarconnections'] = {}; +AWS.CodeStarconnections = Service.defineService('codestarconnections', ['2019-12-01']); +Object.defineProperty(apiLoader.services['codestarconnections'], '2019-12-01', { get: function get() { - var model = __nccwpck_require__(4932); - model.paginators = (__nccwpck_require__(41408)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(36607)/* .waiters */ .V); + var model = __nccwpck_require__(88428); + model.paginators = (__nccwpck_require__(31506)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DocDB; +module.exports = AWS.CodeStarconnections; /***/ }), -/***/ 20792: +/***/ 15141: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10073,24 +10002,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['docdbelastic'] = {}; -AWS.DocDBElastic = Service.defineService('docdbelastic', ['2022-11-28']); -Object.defineProperty(apiLoader.services['docdbelastic'], '2022-11-28', { +apiLoader.services['codestarnotifications'] = {}; +AWS.CodeStarNotifications = Service.defineService('codestarnotifications', ['2019-10-15']); +Object.defineProperty(apiLoader.services['codestarnotifications'], '2019-10-15', { get: function get() { - var model = __nccwpck_require__(34162); - model.paginators = (__nccwpck_require__(89093)/* .pagination */ .o); + var model = __nccwpck_require__(33362); + model.paginators = (__nccwpck_require__(44301)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DocDBElastic; +module.exports = AWS.CodeStarNotifications; /***/ }), -/***/ 41116: +/***/ 58291: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10098,24 +10027,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['drs'] = {}; -AWS.Drs = Service.defineService('drs', ['2020-02-26']); -Object.defineProperty(apiLoader.services['drs'], '2020-02-26', { +apiLoader.services['cognitoidentity'] = {}; +AWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']); +Object.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', { get: function get() { - var model = __nccwpck_require__(42548); - model.paginators = (__nccwpck_require__(44057)/* .pagination */ .o); + var model = __nccwpck_require__(57377); + model.paginators = (__nccwpck_require__(85010)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Drs; +module.exports = AWS.CognitoIdentity; /***/ }), -/***/ 14347: +/***/ 31379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10123,36 +10052,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['dynamodb'] = {}; -AWS.DynamoDB = Service.defineService('dynamodb', ['2011-12-05', '2012-08-10']); -__nccwpck_require__(17101); -Object.defineProperty(apiLoader.services['dynamodb'], '2011-12-05', { - get: function get() { - var model = __nccwpck_require__(46148); - model.paginators = (__nccwpck_require__(86884)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(24864)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['dynamodb'], '2012-08-10', { +apiLoader.services['cognitoidentityserviceprovider'] = {}; +AWS.CognitoIdentityServiceProvider = Service.defineService('cognitoidentityserviceprovider', ['2016-04-18']); +Object.defineProperty(apiLoader.services['cognitoidentityserviceprovider'], '2016-04-18', { get: function get() { - var model = __nccwpck_require__(54047); - model.paginators = (__nccwpck_require__(30482)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(48411)/* .waiters */ .V); + var model = __nccwpck_require__(53166); + model.paginators = (__nccwpck_require__(17149)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DynamoDB; +module.exports = AWS.CognitoIdentityServiceProvider; /***/ }), -/***/ 88090: +/***/ 74770: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10160,24 +10077,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['dynamodbstreams'] = {}; -AWS.DynamoDBStreams = Service.defineService('dynamodbstreams', ['2012-08-10']); -Object.defineProperty(apiLoader.services['dynamodbstreams'], '2012-08-10', { +apiLoader.services['cognitosync'] = {}; +AWS.CognitoSync = Service.defineService('cognitosync', ['2014-06-30']); +Object.defineProperty(apiLoader.services['cognitosync'], '2014-06-30', { get: function get() { - var model = __nccwpck_require__(26098); - model.paginators = (__nccwpck_require__(40549)/* .pagination */ .o); + var model = __nccwpck_require__(29128); + model.paginators = (__nccwpck_require__(5865)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.DynamoDBStreams; +module.exports = AWS.CognitoSync; /***/ }), -/***/ 62837: +/***/ 62878: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10185,24 +10102,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ebs'] = {}; -AWS.EBS = Service.defineService('ebs', ['2019-11-02']); -Object.defineProperty(apiLoader.services['ebs'], '2019-11-02', { +apiLoader.services['comprehend'] = {}; +AWS.Comprehend = Service.defineService('comprehend', ['2017-11-27']); +Object.defineProperty(apiLoader.services['comprehend'], '2017-11-27', { get: function get() { - var model = __nccwpck_require__(72220); - model.paginators = (__nccwpck_require__(85366)/* .pagination */ .o); + var model = __nccwpck_require__(24433); + model.paginators = (__nccwpck_require__(82518)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EBS; +module.exports = AWS.Comprehend; /***/ }), -/***/ 7778: +/***/ 32349: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10210,26 +10127,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ec2'] = {}; -AWS.EC2 = Service.defineService('ec2', ['2013-06-15*', '2013-10-15*', '2014-02-01*', '2014-05-01*', '2014-06-15*', '2014-09-01*', '2014-10-01*', '2015-03-01*', '2015-04-15*', '2015-10-01*', '2016-04-01*', '2016-09-15*', '2016-11-15']); -__nccwpck_require__(92501); -Object.defineProperty(apiLoader.services['ec2'], '2016-11-15', { +apiLoader.services['comprehendmedical'] = {}; +AWS.ComprehendMedical = Service.defineService('comprehendmedical', ['2018-10-30']); +Object.defineProperty(apiLoader.services['comprehendmedical'], '2018-10-30', { get: function get() { - var model = __nccwpck_require__(2658); - model.paginators = (__nccwpck_require__(82477)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(19153)/* .waiters */ .V); + var model = __nccwpck_require__(96649); + model.paginators = (__nccwpck_require__(43172)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EC2; +module.exports = AWS.ComprehendMedical; /***/ }), -/***/ 92209: +/***/ 64459: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10237,24 +10152,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ec2instanceconnect'] = {}; -AWS.EC2InstanceConnect = Service.defineService('ec2instanceconnect', ['2018-04-02']); -Object.defineProperty(apiLoader.services['ec2instanceconnect'], '2018-04-02', { +apiLoader.services['computeoptimizer'] = {}; +AWS.ComputeOptimizer = Service.defineService('computeoptimizer', ['2019-11-01']); +Object.defineProperty(apiLoader.services['computeoptimizer'], '2019-11-01', { get: function get() { - var model = __nccwpck_require__(36007); - model.paginators = (__nccwpck_require__(38333)/* .pagination */ .o); + var model = __nccwpck_require__(85802); + model.paginators = (__nccwpck_require__(6831)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EC2InstanceConnect; +module.exports = AWS.ComputeOptimizer; /***/ }), -/***/ 15211: +/***/ 34061: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10262,25 +10177,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ecr'] = {}; -AWS.ECR = Service.defineService('ecr', ['2015-09-21']); -Object.defineProperty(apiLoader.services['ecr'], '2015-09-21', { +apiLoader.services['configservice'] = {}; +AWS.ConfigService = Service.defineService('configservice', ['2014-11-12']); +Object.defineProperty(apiLoader.services['configservice'], '2014-11-12', { get: function get() { - var model = __nccwpck_require__(92405); - model.paginators = (__nccwpck_require__(25504)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(78925)/* .waiters */ .V); + var model = __nccwpck_require__(47124); + model.paginators = (__nccwpck_require__(85980)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ECR; +module.exports = AWS.ConfigService; /***/ }), -/***/ 90244: +/***/ 13879: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10288,24 +10202,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ecrpublic'] = {}; -AWS.ECRPUBLIC = Service.defineService('ecrpublic', ['2020-10-30']); -Object.defineProperty(apiLoader.services['ecrpublic'], '2020-10-30', { +apiLoader.services['connect'] = {}; +AWS.Connect = Service.defineService('connect', ['2017-08-08']); +Object.defineProperty(apiLoader.services['connect'], '2017-08-08', { get: function get() { - var model = __nccwpck_require__(9668); - model.paginators = (__nccwpck_require__(81193)/* .pagination */ .o); + var model = __nccwpck_require__(54511); + model.paginators = (__nccwpck_require__(19742)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ECRPUBLIC; +module.exports = AWS.Connect; /***/ }), -/***/ 16615: +/***/ 42789: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10313,25 +10227,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ecs'] = {}; -AWS.ECS = Service.defineService('ecs', ['2014-11-13']); -Object.defineProperty(apiLoader.services['ecs'], '2014-11-13', { +apiLoader.services['connectcampaigns'] = {}; +AWS.ConnectCampaigns = Service.defineService('connectcampaigns', ['2021-01-30']); +Object.defineProperty(apiLoader.services['connectcampaigns'], '2021-01-30', { get: function get() { - var model = __nccwpck_require__(44208); - model.paginators = (__nccwpck_require__(15738)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(1299)/* .waiters */ .V); + var model = __nccwpck_require__(71566); + model.paginators = (__nccwpck_require__(45198)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ECS; +module.exports = AWS.ConnectCampaigns; /***/ }), -/***/ 34375: +/***/ 72223: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10339,24 +10252,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['efs'] = {}; -AWS.EFS = Service.defineService('efs', ['2015-02-01']); -Object.defineProperty(apiLoader.services['efs'], '2015-02-01', { +apiLoader.services['connectcases'] = {}; +AWS.ConnectCases = Service.defineService('connectcases', ['2022-10-03']); +Object.defineProperty(apiLoader.services['connectcases'], '2022-10-03', { get: function get() { - var model = __nccwpck_require__(54784); - model.paginators = (__nccwpck_require__(40174)/* .pagination */ .o); + var model = __nccwpck_require__(3923); + model.paginators = (__nccwpck_require__(8429)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EFS; +module.exports = AWS.ConnectCases; /***/ }), -/***/ 23337: +/***/ 41847: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10364,25 +10277,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['eks'] = {}; -AWS.EKS = Service.defineService('eks', ['2017-11-01']); -Object.defineProperty(apiLoader.services['eks'], '2017-11-01', { +apiLoader.services['connectcontactlens'] = {}; +AWS.ConnectContactLens = Service.defineService('connectcontactlens', ['2020-08-21']); +Object.defineProperty(apiLoader.services['connectcontactlens'], '2020-08-21', { get: function get() { - var model = __nccwpck_require__(51370); - model.paginators = (__nccwpck_require__(36490)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(88058)/* .waiters */ .V); + var model = __nccwpck_require__(16527); + model.paginators = (__nccwpck_require__(76658)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EKS; +module.exports = AWS.ConnectContactLens; /***/ }), -/***/ 66164: +/***/ 94198: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10390,25 +10302,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['eksauth'] = {}; -AWS.EKSAuth = Service.defineService('eksauth', ['2023-11-26']); -Object.defineProperty(apiLoader.services['eksauth'], '2023-11-26', { +apiLoader.services['connectparticipant'] = {}; +AWS.ConnectParticipant = Service.defineService('connectparticipant', ['2018-09-07']); +Object.defineProperty(apiLoader.services['connectparticipant'], '2018-09-07', { get: function get() { - var model = __nccwpck_require__(92414); - model.paginators = (__nccwpck_require__(8222)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(33480)/* .waiters */ .V); + var model = __nccwpck_require__(70132); + model.paginators = (__nccwpck_require__(29947)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EKSAuth; +module.exports = AWS.ConnectParticipant; /***/ }), -/***/ 81065: +/***/ 87324: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10416,25 +10327,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['elasticache'] = {}; -AWS.ElastiCache = Service.defineService('elasticache', ['2012-11-15*', '2014-03-24*', '2014-07-15*', '2014-09-30*', '2015-02-02']); -Object.defineProperty(apiLoader.services['elasticache'], '2015-02-02', { +apiLoader.services['controlcatalog'] = {}; +AWS.ControlCatalog = Service.defineService('controlcatalog', ['2018-05-10']); +Object.defineProperty(apiLoader.services['controlcatalog'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(58426); - model.paginators = (__nccwpck_require__(79559)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(29787)/* .waiters */ .V); + var model = __nccwpck_require__(65015); + model.paginators = (__nccwpck_require__(31095)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(7580)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ElastiCache; +module.exports = AWS.ControlCatalog; /***/ }), -/***/ 14897: +/***/ 77574: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10442,25 +10353,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['elasticbeanstalk'] = {}; -AWS.ElasticBeanstalk = Service.defineService('elasticbeanstalk', ['2010-12-01']); -Object.defineProperty(apiLoader.services['elasticbeanstalk'], '2010-12-01', { +apiLoader.services['controltower'] = {}; +AWS.ControlTower = Service.defineService('controltower', ['2018-05-10']); +Object.defineProperty(apiLoader.services['controltower'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(72508); - model.paginators = (__nccwpck_require__(72305)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(62534)/* .waiters */ .V); + var model = __nccwpck_require__(1095); + model.paginators = (__nccwpck_require__(55167)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ElasticBeanstalk; +module.exports = AWS.ControlTower; /***/ }), -/***/ 37708: +/***/ 79523: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10468,24 +10378,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['elasticinference'] = {}; -AWS.ElasticInference = Service.defineService('elasticinference', ['2017-07-25']); -Object.defineProperty(apiLoader.services['elasticinference'], '2017-07-25', { +apiLoader.services['costexplorer'] = {}; +AWS.CostExplorer = Service.defineService('costexplorer', ['2017-10-25']); +Object.defineProperty(apiLoader.services['costexplorer'], '2017-10-25', { get: function get() { - var model = __nccwpck_require__(83967); - model.paginators = (__nccwpck_require__(64906)/* .pagination */ .o); + var model = __nccwpck_require__(4060); + model.paginators = (__nccwpck_require__(75642)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ElasticInference; +module.exports = AWS.CostExplorer; /***/ }), -/***/ 40745: +/***/ 55443: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10493,25 +10403,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['elastictranscoder'] = {}; -AWS.ElasticTranscoder = Service.defineService('elastictranscoder', ['2012-09-25']); -Object.defineProperty(apiLoader.services['elastictranscoder'], '2012-09-25', { +apiLoader.services['costoptimizationhub'] = {}; +AWS.CostOptimizationHub = Service.defineService('costoptimizationhub', ['2022-07-26']); +Object.defineProperty(apiLoader.services['costoptimizationhub'], '2022-07-26', { get: function get() { - var model = __nccwpck_require__(23463); - model.paginators = (__nccwpck_require__(36121)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(59345)/* .waiters */ .V); + var model = __nccwpck_require__(56073); + model.paginators = (__nccwpck_require__(70563)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(17029)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ElasticTranscoder; +module.exports = AWS.CostOptimizationHub; /***/ }), -/***/ 10907: +/***/ 5026: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10519,25 +10429,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['elb'] = {}; -AWS.ELB = Service.defineService('elb', ['2012-06-01']); -Object.defineProperty(apiLoader.services['elb'], '2012-06-01', { +apiLoader.services['cur'] = {}; +AWS.CUR = Service.defineService('cur', ['2017-01-06']); +Object.defineProperty(apiLoader.services['cur'], '2017-01-06', { get: function get() { - var model = __nccwpck_require__(66258); - model.paginators = (__nccwpck_require__(77372)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(56717)/* .waiters */ .V); + var model = __nccwpck_require__(46858); + model.paginators = (__nccwpck_require__(40528)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ELB; +module.exports = AWS.CUR; /***/ }), -/***/ 44311: +/***/ 28379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10545,25 +10454,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['elbv2'] = {}; -AWS.ELBv2 = Service.defineService('elbv2', ['2015-12-01']); -Object.defineProperty(apiLoader.services['elbv2'], '2015-12-01', { +apiLoader.services['customerprofiles'] = {}; +AWS.CustomerProfiles = Service.defineService('customerprofiles', ['2020-08-15']); +Object.defineProperty(apiLoader.services['customerprofiles'], '2020-08-15', { get: function get() { - var model = __nccwpck_require__(42628); - model.paginators = (__nccwpck_require__(12274)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(56106)/* .waiters */ .V); + var model = __nccwpck_require__(56793); + model.paginators = (__nccwpck_require__(53892)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ELBv2; +module.exports = AWS.CustomerProfiles; /***/ }), -/***/ 50470: +/***/ 35846: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10571,25 +10479,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['emr'] = {}; -AWS.EMR = Service.defineService('emr', ['2009-03-31']); -Object.defineProperty(apiLoader.services['emr'], '2009-03-31', { +apiLoader.services['databrew'] = {}; +AWS.DataBrew = Service.defineService('databrew', ['2017-07-25']); +Object.defineProperty(apiLoader.services['databrew'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(91298); - model.paginators = (__nccwpck_require__(62965)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(86792)/* .waiters */ .V); + var model = __nccwpck_require__(96089); + model.paginators = (__nccwpck_require__(92224)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EMR; +module.exports = AWS.DataBrew; /***/ }), -/***/ 49984: +/***/ 11024: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10597,24 +10504,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['emrcontainers'] = {}; -AWS.EMRcontainers = Service.defineService('emrcontainers', ['2020-10-01']); -Object.defineProperty(apiLoader.services['emrcontainers'], '2020-10-01', { +apiLoader.services['dataexchange'] = {}; +AWS.DataExchange = Service.defineService('dataexchange', ['2017-07-25']); +Object.defineProperty(apiLoader.services['dataexchange'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(33922); - model.paginators = (__nccwpck_require__(87789)/* .pagination */ .o); + var model = __nccwpck_require__(42346); + model.paginators = (__nccwpck_require__(55607)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(43176)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EMRcontainers; +module.exports = AWS.DataExchange; /***/ }), -/***/ 219: +/***/ 65688: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10622,24 +10530,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['emrserverless'] = {}; -AWS.EMRServerless = Service.defineService('emrserverless', ['2021-07-13']); -Object.defineProperty(apiLoader.services['emrserverless'], '2021-07-13', { +apiLoader.services['datapipeline'] = {}; +AWS.DataPipeline = Service.defineService('datapipeline', ['2012-10-29']); +Object.defineProperty(apiLoader.services['datapipeline'], '2012-10-29', { get: function get() { - var model = __nccwpck_require__(41070); - model.paginators = (__nccwpck_require__(39521)/* .pagination */ .o); + var model = __nccwpck_require__(79908); + model.paginators = (__nccwpck_require__(89659)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EMRServerless; +module.exports = AWS.DataPipeline; /***/ }), -/***/ 22697: +/***/ 25308: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10647,24 +10555,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['entityresolution'] = {}; -AWS.EntityResolution = Service.defineService('entityresolution', ['2018-05-10']); -Object.defineProperty(apiLoader.services['entityresolution'], '2018-05-10', { +apiLoader.services['datasync'] = {}; +AWS.DataSync = Service.defineService('datasync', ['2018-11-09']); +Object.defineProperty(apiLoader.services['datasync'], '2018-11-09', { get: function get() { - var model = __nccwpck_require__(61033); - model.paginators = (__nccwpck_require__(37403)/* .pagination */ .o); + var model = __nccwpck_require__(93640); + model.paginators = (__nccwpck_require__(80063)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EntityResolution; +module.exports = AWS.DataSync; /***/ }), -/***/ 84462: +/***/ 31763: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10672,24 +10580,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['es'] = {}; -AWS.ES = Service.defineService('es', ['2015-01-01']); -Object.defineProperty(apiLoader.services['es'], '2015-01-01', { +apiLoader.services['datazone'] = {}; +AWS.DataZone = Service.defineService('datazone', ['2018-05-10']); +Object.defineProperty(apiLoader.services['datazone'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(33943); - model.paginators = (__nccwpck_require__(78836)/* .pagination */ .o); + var model = __nccwpck_require__(70813); + model.paginators = (__nccwpck_require__(10509)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ES; +module.exports = AWS.DataZone; /***/ }), -/***/ 898: +/***/ 71398: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10697,25 +10605,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['eventbridge'] = {}; -AWS.EventBridge = Service.defineService('eventbridge', ['2015-10-07']); -__nccwpck_require__(3034); -Object.defineProperty(apiLoader.services['eventbridge'], '2015-10-07', { +apiLoader.services['dax'] = {}; +AWS.DAX = Service.defineService('dax', ['2017-04-19']); +Object.defineProperty(apiLoader.services['dax'], '2017-04-19', { get: function get() { - var model = __nccwpck_require__(9659); - model.paginators = (__nccwpck_require__(10871)/* .pagination */ .o); + var model = __nccwpck_require__(24709); + model.paginators = (__nccwpck_require__(87564)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.EventBridge; +module.exports = AWS.DAX; /***/ }), -/***/ 21440: +/***/ 29242: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10723,24 +10630,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['evidently'] = {}; -AWS.Evidently = Service.defineService('evidently', ['2021-02-01']); -Object.defineProperty(apiLoader.services['evidently'], '2021-02-01', { +apiLoader.services['deadline'] = {}; +AWS.Deadline = Service.defineService('deadline', ['2023-10-12']); +Object.defineProperty(apiLoader.services['deadline'], '2023-10-12', { get: function get() { - var model = __nccwpck_require__(41971); - model.paginators = (__nccwpck_require__(72960)/* .pagination */ .o); + var model = __nccwpck_require__(27799); + model.paginators = (__nccwpck_require__(60855)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(54096)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Evidently; +module.exports = AWS.Deadline; /***/ }), -/***/ 3052: +/***/ 60674: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10748,24 +10656,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['finspace'] = {}; -AWS.Finspace = Service.defineService('finspace', ['2021-03-12']); -Object.defineProperty(apiLoader.services['finspace'], '2021-03-12', { +apiLoader.services['detective'] = {}; +AWS.Detective = Service.defineService('detective', ['2018-10-26']); +Object.defineProperty(apiLoader.services['detective'], '2018-10-26', { get: function get() { - var model = __nccwpck_require__(37836); - model.paginators = (__nccwpck_require__(7328)/* .pagination */ .o); + var model = __nccwpck_require__(25236); + model.paginators = (__nccwpck_require__(46384)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Finspace; +module.exports = AWS.Detective; /***/ }), -/***/ 96869: +/***/ 26272: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10773,24 +10681,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['finspacedata'] = {}; -AWS.Finspacedata = Service.defineService('finspacedata', ['2020-07-13']); -Object.defineProperty(apiLoader.services['finspacedata'], '2020-07-13', { +apiLoader.services['devicefarm'] = {}; +AWS.DeviceFarm = Service.defineService('devicefarm', ['2015-06-23']); +Object.defineProperty(apiLoader.services['devicefarm'], '2015-06-23', { get: function get() { - var model = __nccwpck_require__(83394); - model.paginators = (__nccwpck_require__(70371)/* .pagination */ .o); + var model = __nccwpck_require__(34023); + model.paginators = (__nccwpck_require__(37161)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Finspacedata; +module.exports = AWS.DeviceFarm; /***/ }), -/***/ 92831: +/***/ 90673: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10798,24 +10706,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['firehose'] = {}; -AWS.Firehose = Service.defineService('firehose', ['2015-08-04']); -Object.defineProperty(apiLoader.services['firehose'], '2015-08-04', { +apiLoader.services['devopsguru'] = {}; +AWS.DevOpsGuru = Service.defineService('devopsguru', ['2020-12-01']); +Object.defineProperty(apiLoader.services['devopsguru'], '2020-12-01', { get: function get() { - var model = __nccwpck_require__(48886); - model.paginators = (__nccwpck_require__(47400)/* .pagination */ .o); + var model = __nccwpck_require__(36592); + model.paginators = (__nccwpck_require__(95551)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Firehose; +module.exports = AWS.DevOpsGuru; /***/ }), -/***/ 73003: +/***/ 73783: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10823,24 +10731,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['fis'] = {}; -AWS.Fis = Service.defineService('fis', ['2020-12-01']); -Object.defineProperty(apiLoader.services['fis'], '2020-12-01', { +apiLoader.services['directconnect'] = {}; +AWS.DirectConnect = Service.defineService('directconnect', ['2012-10-25']); +Object.defineProperty(apiLoader.services['directconnect'], '2012-10-25', { get: function get() { - var model = __nccwpck_require__(98356); - model.paginators = (__nccwpck_require__(6544)/* .pagination */ .o); + var model = __nccwpck_require__(45125); + model.paginators = (__nccwpck_require__(26404)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Fis; +module.exports = AWS.DirectConnect; /***/ }), -/***/ 11316: +/***/ 83908: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10848,24 +10756,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['fms'] = {}; -AWS.FMS = Service.defineService('fms', ['2018-01-01']); -Object.defineProperty(apiLoader.services['fms'], '2018-01-01', { +apiLoader.services['directoryservice'] = {}; +AWS.DirectoryService = Service.defineService('directoryservice', ['2015-04-16']); +Object.defineProperty(apiLoader.services['directoryservice'], '2015-04-16', { get: function get() { - var model = __nccwpck_require__(22212); - model.paginators = (__nccwpck_require__(49570)/* .pagination */ .o); + var model = __nccwpck_require__(47357); + model.paginators = (__nccwpck_require__(93412)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.FMS; +module.exports = AWS.DirectoryService; /***/ }), -/***/ 36822: +/***/ 81690: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10873,24 +10781,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['forecastqueryservice'] = {}; -AWS.ForecastQueryService = Service.defineService('forecastqueryservice', ['2018-06-26']); -Object.defineProperty(apiLoader.services['forecastqueryservice'], '2018-06-26', { +apiLoader.services['discovery'] = {}; +AWS.Discovery = Service.defineService('discovery', ['2015-11-01']); +Object.defineProperty(apiLoader.services['discovery'], '2015-11-01', { get: function get() { - var model = __nccwpck_require__(23865); - model.paginators = (__nccwpck_require__(98135)/* .pagination */ .o); + var model = __nccwpck_require__(68951); + model.paginators = (__nccwpck_require__(19822)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ForecastQueryService; +module.exports = AWS.Discovery; /***/ }), -/***/ 12942: +/***/ 24958: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10898,24 +10806,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['forecastservice'] = {}; -AWS.ForecastService = Service.defineService('forecastservice', ['2018-06-26']); -Object.defineProperty(apiLoader.services['forecastservice'], '2018-06-26', { +apiLoader.services['dlm'] = {}; +AWS.DLM = Service.defineService('dlm', ['2018-01-12']); +Object.defineProperty(apiLoader.services['dlm'], '2018-01-12', { get: function get() { - var model = __nccwpck_require__(6468); - model.paginators = (__nccwpck_require__(45338)/* .pagination */ .o); + var model = __nccwpck_require__(75485); + model.paginators = (__nccwpck_require__(98881)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ForecastService; +module.exports = AWS.DLM; /***/ }), -/***/ 99830: +/***/ 69868: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10923,24 +10831,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['frauddetector'] = {}; -AWS.FraudDetector = Service.defineService('frauddetector', ['2019-11-15']); -Object.defineProperty(apiLoader.services['frauddetector'], '2019-11-15', { +apiLoader.services['dms'] = {}; +AWS.DMS = Service.defineService('dms', ['2016-01-01']); +Object.defineProperty(apiLoader.services['dms'], '2016-01-01', { get: function get() { - var model = __nccwpck_require__(96105); - model.paginators = (__nccwpck_require__(9177)/* .pagination */ .o); + var model = __nccwpck_require__(77953); + model.paginators = (__nccwpck_require__(36772)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(3500)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.FraudDetector; +module.exports = AWS.DMS; /***/ }), -/***/ 11681: +/***/ 55129: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10948,24 +10857,26 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['freetier'] = {}; -AWS.FreeTier = Service.defineService('freetier', ['2023-09-07']); -Object.defineProperty(apiLoader.services['freetier'], '2023-09-07', { +apiLoader.services['docdb'] = {}; +AWS.DocDB = Service.defineService('docdb', ['2014-10-31']); +__nccwpck_require__(59050); +Object.defineProperty(apiLoader.services['docdb'], '2014-10-31', { get: function get() { - var model = __nccwpck_require__(50797); - model.paginators = (__nccwpck_require__(52266)/* .pagination */ .o); + var model = __nccwpck_require__(4932); + model.paginators = (__nccwpck_require__(41408)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(36607)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.FreeTier; +module.exports = AWS.DocDB; /***/ }), -/***/ 60642: +/***/ 20792: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10973,24 +10884,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['fsx'] = {}; -AWS.FSx = Service.defineService('fsx', ['2018-03-01']); -Object.defineProperty(apiLoader.services['fsx'], '2018-03-01', { +apiLoader.services['docdbelastic'] = {}; +AWS.DocDBElastic = Service.defineService('docdbelastic', ['2022-11-28']); +Object.defineProperty(apiLoader.services['docdbelastic'], '2022-11-28', { get: function get() { - var model = __nccwpck_require__(58245); - model.paginators = (__nccwpck_require__(19882)/* .pagination */ .o); + var model = __nccwpck_require__(34162); + model.paginators = (__nccwpck_require__(89093)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.FSx; +module.exports = AWS.DocDBElastic; /***/ }), -/***/ 8085: +/***/ 41116: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -10998,24 +10909,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['gamelift'] = {}; -AWS.GameLift = Service.defineService('gamelift', ['2015-10-01']); -Object.defineProperty(apiLoader.services['gamelift'], '2015-10-01', { +apiLoader.services['drs'] = {}; +AWS.Drs = Service.defineService('drs', ['2020-02-26']); +Object.defineProperty(apiLoader.services['drs'], '2020-02-26', { get: function get() { - var model = __nccwpck_require__(69257); - model.paginators = (__nccwpck_require__(88381)/* .pagination */ .o); + var model = __nccwpck_require__(42548); + model.paginators = (__nccwpck_require__(44057)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.GameLift; +module.exports = AWS.Drs; /***/ }), -/***/ 63249: +/***/ 14347: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11023,26 +10934,36 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['glacier'] = {}; -AWS.Glacier = Service.defineService('glacier', ['2012-06-01']); -__nccwpck_require__(14472); -Object.defineProperty(apiLoader.services['glacier'], '2012-06-01', { +apiLoader.services['dynamodb'] = {}; +AWS.DynamoDB = Service.defineService('dynamodb', ['2011-12-05', '2012-08-10']); +__nccwpck_require__(17101); +Object.defineProperty(apiLoader.services['dynamodb'], '2011-12-05', { get: function get() { - var model = __nccwpck_require__(11545); - model.paginators = (__nccwpck_require__(54145)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(65182)/* .waiters */ .V); + var model = __nccwpck_require__(46148); + model.paginators = (__nccwpck_require__(86884)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(24864)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['dynamodb'], '2012-08-10', { + get: function get() { + var model = __nccwpck_require__(54047); + model.paginators = (__nccwpck_require__(30482)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(48411)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Glacier; +module.exports = AWS.DynamoDB; /***/ }), -/***/ 19306: +/***/ 88090: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11050,24 +10971,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['globalaccelerator'] = {}; -AWS.GlobalAccelerator = Service.defineService('globalaccelerator', ['2018-08-08']); -Object.defineProperty(apiLoader.services['globalaccelerator'], '2018-08-08', { +apiLoader.services['dynamodbstreams'] = {}; +AWS.DynamoDBStreams = Service.defineService('dynamodbstreams', ['2012-08-10']); +Object.defineProperty(apiLoader.services['dynamodbstreams'], '2012-08-10', { get: function get() { - var model = __nccwpck_require__(35365); - model.paginators = (__nccwpck_require__(14796)/* .pagination */ .o); + var model = __nccwpck_require__(26098); + model.paginators = (__nccwpck_require__(40549)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.GlobalAccelerator; +module.exports = AWS.DynamoDBStreams; /***/ }), -/***/ 31658: +/***/ 62837: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11075,24 +10996,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['glue'] = {}; -AWS.Glue = Service.defineService('glue', ['2017-03-31']); -Object.defineProperty(apiLoader.services['glue'], '2017-03-31', { +apiLoader.services['ebs'] = {}; +AWS.EBS = Service.defineService('ebs', ['2019-11-02']); +Object.defineProperty(apiLoader.services['ebs'], '2019-11-02', { get: function get() { - var model = __nccwpck_require__(72268); - model.paginators = (__nccwpck_require__(26545)/* .pagination */ .o); + var model = __nccwpck_require__(72220); + model.paginators = (__nccwpck_require__(85366)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Glue; +module.exports = AWS.EBS; /***/ }), -/***/ 51050: +/***/ 7778: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11100,24 +11021,26 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['grafana'] = {}; -AWS.Grafana = Service.defineService('grafana', ['2020-08-18']); -Object.defineProperty(apiLoader.services['grafana'], '2020-08-18', { +apiLoader.services['ec2'] = {}; +AWS.EC2 = Service.defineService('ec2', ['2013-06-15*', '2013-10-15*', '2014-02-01*', '2014-05-01*', '2014-06-15*', '2014-09-01*', '2014-10-01*', '2015-03-01*', '2015-04-15*', '2015-10-01*', '2016-04-01*', '2016-09-15*', '2016-11-15']); +__nccwpck_require__(92501); +Object.defineProperty(apiLoader.services['ec2'], '2016-11-15', { get: function get() { - var model = __nccwpck_require__(29655); - model.paginators = (__nccwpck_require__(83188)/* .pagination */ .o); + var model = __nccwpck_require__(2658); + model.paginators = (__nccwpck_require__(82477)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(19153)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Grafana; +module.exports = AWS.EC2; /***/ }), -/***/ 20690: +/***/ 92209: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11125,23 +11048,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['greengrass'] = {}; -AWS.Greengrass = Service.defineService('greengrass', ['2017-06-07']); -Object.defineProperty(apiLoader.services['greengrass'], '2017-06-07', { +apiLoader.services['ec2instanceconnect'] = {}; +AWS.EC2InstanceConnect = Service.defineService('ec2instanceconnect', ['2018-04-02']); +Object.defineProperty(apiLoader.services['ec2instanceconnect'], '2018-04-02', { get: function get() { - var model = __nccwpck_require__(72575); + var model = __nccwpck_require__(36007); + model.paginators = (__nccwpck_require__(38333)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Greengrass; +module.exports = AWS.EC2InstanceConnect; /***/ }), -/***/ 45126: +/***/ 15211: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11149,24 +11073,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['greengrassv2'] = {}; -AWS.GreengrassV2 = Service.defineService('greengrassv2', ['2020-11-30']); -Object.defineProperty(apiLoader.services['greengrassv2'], '2020-11-30', { +apiLoader.services['ecr'] = {}; +AWS.ECR = Service.defineService('ecr', ['2015-09-21']); +Object.defineProperty(apiLoader.services['ecr'], '2015-09-21', { get: function get() { - var model = __nccwpck_require__(57546); - model.paginators = (__nccwpck_require__(47961)/* .pagination */ .o); + var model = __nccwpck_require__(92405); + model.paginators = (__nccwpck_require__(25504)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(78925)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.GreengrassV2; +module.exports = AWS.ECR; /***/ }), -/***/ 80494: +/***/ 90244: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11174,25 +11099,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['groundstation'] = {}; -AWS.GroundStation = Service.defineService('groundstation', ['2019-05-23']); -Object.defineProperty(apiLoader.services['groundstation'], '2019-05-23', { +apiLoader.services['ecrpublic'] = {}; +AWS.ECRPUBLIC = Service.defineService('ecrpublic', ['2020-10-30']); +Object.defineProperty(apiLoader.services['ecrpublic'], '2020-10-30', { get: function get() { - var model = __nccwpck_require__(27733); - model.paginators = (__nccwpck_require__(55974)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(77815)/* .waiters */ .V); + var model = __nccwpck_require__(9668); + model.paginators = (__nccwpck_require__(81193)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.GroundStation; +module.exports = AWS.ECRPUBLIC; /***/ }), -/***/ 40755: +/***/ 16615: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11200,24 +11124,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['guardduty'] = {}; -AWS.GuardDuty = Service.defineService('guardduty', ['2017-11-28']); -Object.defineProperty(apiLoader.services['guardduty'], '2017-11-28', { +apiLoader.services['ecs'] = {}; +AWS.ECS = Service.defineService('ecs', ['2014-11-13']); +Object.defineProperty(apiLoader.services['ecs'], '2014-11-13', { get: function get() { - var model = __nccwpck_require__(37793); - model.paginators = (__nccwpck_require__(87510)/* .pagination */ .o); + var model = __nccwpck_require__(44208); + model.paginators = (__nccwpck_require__(15738)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(1299)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.GuardDuty; +module.exports = AWS.ECS; /***/ }), -/***/ 21834: +/***/ 34375: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11225,24 +11150,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['health'] = {}; -AWS.Health = Service.defineService('health', ['2016-08-04']); -Object.defineProperty(apiLoader.services['health'], '2016-08-04', { +apiLoader.services['efs'] = {}; +AWS.EFS = Service.defineService('efs', ['2015-02-01']); +Object.defineProperty(apiLoader.services['efs'], '2015-02-01', { get: function get() { - var model = __nccwpck_require__(8618); - model.paginators = (__nccwpck_require__(46725)/* .pagination */ .o); + var model = __nccwpck_require__(54784); + model.paginators = (__nccwpck_require__(40174)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Health; +module.exports = AWS.EFS; /***/ }), -/***/ 64254: +/***/ 23337: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11250,24 +11175,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['healthlake'] = {}; -AWS.HealthLake = Service.defineService('healthlake', ['2017-07-01']); -Object.defineProperty(apiLoader.services['healthlake'], '2017-07-01', { +apiLoader.services['eks'] = {}; +AWS.EKS = Service.defineService('eks', ['2017-11-01']); +Object.defineProperty(apiLoader.services['eks'], '2017-11-01', { get: function get() { - var model = __nccwpck_require__(13637); - model.paginators = (__nccwpck_require__(92834)/* .pagination */ .o); + var model = __nccwpck_require__(51370); + model.paginators = (__nccwpck_require__(36490)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(88058)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.HealthLake; +module.exports = AWS.EKS; /***/ }), -/***/ 38889: +/***/ 66164: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11275,24 +11201,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['honeycode'] = {}; -AWS.Honeycode = Service.defineService('honeycode', ['2020-03-01']); -Object.defineProperty(apiLoader.services['honeycode'], '2020-03-01', { +apiLoader.services['eksauth'] = {}; +AWS.EKSAuth = Service.defineService('eksauth', ['2023-11-26']); +Object.defineProperty(apiLoader.services['eksauth'], '2023-11-26', { get: function get() { - var model = __nccwpck_require__(27577); - model.paginators = (__nccwpck_require__(12243)/* .pagination */ .o); + var model = __nccwpck_require__(92414); + model.paginators = (__nccwpck_require__(8222)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(33480)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Honeycode; +module.exports = AWS.EKSAuth; /***/ }), -/***/ 50058: +/***/ 81065: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11300,25 +11227,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iam'] = {}; -AWS.IAM = Service.defineService('iam', ['2010-05-08']); -Object.defineProperty(apiLoader.services['iam'], '2010-05-08', { +apiLoader.services['elasticache'] = {}; +AWS.ElastiCache = Service.defineService('elasticache', ['2012-11-15*', '2014-03-24*', '2014-07-15*', '2014-09-30*', '2015-02-02']); +Object.defineProperty(apiLoader.services['elasticache'], '2015-02-02', { get: function get() { - var model = __nccwpck_require__(27041); - model.paginators = (__nccwpck_require__(97583)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(37757)/* .waiters */ .V); + var model = __nccwpck_require__(58426); + model.paginators = (__nccwpck_require__(79559)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(29787)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IAM; +module.exports = AWS.ElastiCache; /***/ }), -/***/ 60222: +/***/ 14897: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11326,24 +11253,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['identitystore'] = {}; -AWS.IdentityStore = Service.defineService('identitystore', ['2020-06-15']); -Object.defineProperty(apiLoader.services['identitystore'], '2020-06-15', { +apiLoader.services['elasticbeanstalk'] = {}; +AWS.ElasticBeanstalk = Service.defineService('elasticbeanstalk', ['2010-12-01']); +Object.defineProperty(apiLoader.services['elasticbeanstalk'], '2010-12-01', { get: function get() { - var model = __nccwpck_require__(75797); - model.paginators = (__nccwpck_require__(44872)/* .pagination */ .o); + var model = __nccwpck_require__(72508); + model.paginators = (__nccwpck_require__(72305)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(62534)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IdentityStore; +module.exports = AWS.ElasticBeanstalk; /***/ }), -/***/ 57511: +/***/ 37708: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11351,24 +11279,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['imagebuilder'] = {}; -AWS.Imagebuilder = Service.defineService('imagebuilder', ['2019-12-02']); -Object.defineProperty(apiLoader.services['imagebuilder'], '2019-12-02', { +apiLoader.services['elasticinference'] = {}; +AWS.ElasticInference = Service.defineService('elasticinference', ['2017-07-25']); +Object.defineProperty(apiLoader.services['elasticinference'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(98139); - model.paginators = (__nccwpck_require__(60410)/* .pagination */ .o); + var model = __nccwpck_require__(83967); + model.paginators = (__nccwpck_require__(64906)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Imagebuilder; +module.exports = AWS.ElasticInference; /***/ }), -/***/ 6769: +/***/ 40745: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11376,24 +11304,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['importexport'] = {}; -AWS.ImportExport = Service.defineService('importexport', ['2010-06-01']); -Object.defineProperty(apiLoader.services['importexport'], '2010-06-01', { +apiLoader.services['elastictranscoder'] = {}; +AWS.ElasticTranscoder = Service.defineService('elastictranscoder', ['2012-09-25']); +Object.defineProperty(apiLoader.services['elastictranscoder'], '2012-09-25', { get: function get() { - var model = __nccwpck_require__(80317); - model.paginators = (__nccwpck_require__(58037)/* .pagination */ .o); + var model = __nccwpck_require__(23463); + model.paginators = (__nccwpck_require__(36121)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(59345)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ImportExport; +module.exports = AWS.ElasticTranscoder; /***/ }), -/***/ 89439: +/***/ 10907: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11401,24 +11330,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['inspector'] = {}; -AWS.Inspector = Service.defineService('inspector', ['2015-08-18*', '2016-02-16']); -Object.defineProperty(apiLoader.services['inspector'], '2016-02-16', { +apiLoader.services['elb'] = {}; +AWS.ELB = Service.defineService('elb', ['2012-06-01']); +Object.defineProperty(apiLoader.services['elb'], '2012-06-01', { get: function get() { - var model = __nccwpck_require__(71649); - model.paginators = (__nccwpck_require__(69242)/* .pagination */ .o); + var model = __nccwpck_require__(66258); + model.paginators = (__nccwpck_require__(77372)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(56717)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Inspector; +module.exports = AWS.ELB; /***/ }), -/***/ 98650: +/***/ 44311: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11426,24 +11356,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['inspector2'] = {}; -AWS.Inspector2 = Service.defineService('inspector2', ['2020-06-08']); -Object.defineProperty(apiLoader.services['inspector2'], '2020-06-08', { +apiLoader.services['elbv2'] = {}; +AWS.ELBv2 = Service.defineService('elbv2', ['2015-12-01']); +Object.defineProperty(apiLoader.services['elbv2'], '2015-12-01', { get: function get() { - var model = __nccwpck_require__(61291); - model.paginators = (__nccwpck_require__(17472)/* .pagination */ .o); + var model = __nccwpck_require__(42628); + model.paginators = (__nccwpck_require__(12274)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(56106)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Inspector2; +module.exports = AWS.ELBv2; /***/ }), -/***/ 25467: +/***/ 50470: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11451,24 +11382,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['inspectorscan'] = {}; -AWS.InspectorScan = Service.defineService('inspectorscan', ['2023-08-08']); -Object.defineProperty(apiLoader.services['inspectorscan'], '2023-08-08', { +apiLoader.services['emr'] = {}; +AWS.EMR = Service.defineService('emr', ['2009-03-31']); +Object.defineProperty(apiLoader.services['emr'], '2009-03-31', { get: function get() { - var model = __nccwpck_require__(17875); - model.paginators = (__nccwpck_require__(35037)/* .pagination */ .o); + var model = __nccwpck_require__(91298); + model.paginators = (__nccwpck_require__(62965)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(86792)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.InspectorScan; +module.exports = AWS.EMR; /***/ }), -/***/ 84099: +/***/ 49984: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11476,25 +11408,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['internetmonitor'] = {}; -AWS.InternetMonitor = Service.defineService('internetmonitor', ['2021-06-03']); -Object.defineProperty(apiLoader.services['internetmonitor'], '2021-06-03', { +apiLoader.services['emrcontainers'] = {}; +AWS.EMRcontainers = Service.defineService('emrcontainers', ['2020-10-01']); +Object.defineProperty(apiLoader.services['emrcontainers'], '2020-10-01', { get: function get() { - var model = __nccwpck_require__(62158); - model.paginators = (__nccwpck_require__(64409)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(76543)/* .waiters */ .V); + var model = __nccwpck_require__(33922); + model.paginators = (__nccwpck_require__(87789)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.InternetMonitor; +module.exports = AWS.EMRcontainers; /***/ }), -/***/ 98392: +/***/ 219: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11502,24 +11433,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iot'] = {}; -AWS.Iot = Service.defineService('iot', ['2015-05-28']); -Object.defineProperty(apiLoader.services['iot'], '2015-05-28', { +apiLoader.services['emrserverless'] = {}; +AWS.EMRServerless = Service.defineService('emrserverless', ['2021-07-13']); +Object.defineProperty(apiLoader.services['emrserverless'], '2021-07-13', { get: function get() { - var model = __nccwpck_require__(40063); - model.paginators = (__nccwpck_require__(43999)/* .pagination */ .o); + var model = __nccwpck_require__(41070); + model.paginators = (__nccwpck_require__(39521)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Iot; +module.exports = AWS.EMRServerless; /***/ }), -/***/ 39474: +/***/ 22697: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11527,23 +11458,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iot1clickdevicesservice'] = {}; -AWS.IoT1ClickDevicesService = Service.defineService('iot1clickdevicesservice', ['2018-05-14']); -Object.defineProperty(apiLoader.services['iot1clickdevicesservice'], '2018-05-14', { +apiLoader.services['entityresolution'] = {}; +AWS.EntityResolution = Service.defineService('entityresolution', ['2018-05-10']); +Object.defineProperty(apiLoader.services['entityresolution'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(26663); + var model = __nccwpck_require__(61033); + model.paginators = (__nccwpck_require__(37403)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoT1ClickDevicesService; +module.exports = AWS.EntityResolution; /***/ }), -/***/ 4686: +/***/ 84462: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11551,24 +11483,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iot1clickprojects'] = {}; -AWS.IoT1ClickProjects = Service.defineService('iot1clickprojects', ['2018-05-14']); -Object.defineProperty(apiLoader.services['iot1clickprojects'], '2018-05-14', { +apiLoader.services['es'] = {}; +AWS.ES = Service.defineService('es', ['2015-01-01']); +Object.defineProperty(apiLoader.services['es'], '2015-01-01', { get: function get() { - var model = __nccwpck_require__(17364); - model.paginators = (__nccwpck_require__(54033)/* .pagination */ .o); + var model = __nccwpck_require__(33943); + model.paginators = (__nccwpck_require__(78836)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoT1ClickProjects; +module.exports = AWS.ES; /***/ }), -/***/ 67409: +/***/ 898: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11576,24 +11508,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotanalytics'] = {}; -AWS.IoTAnalytics = Service.defineService('iotanalytics', ['2017-11-27']); -Object.defineProperty(apiLoader.services['iotanalytics'], '2017-11-27', { +apiLoader.services['eventbridge'] = {}; +AWS.EventBridge = Service.defineService('eventbridge', ['2015-10-07']); +__nccwpck_require__(3034); +Object.defineProperty(apiLoader.services['eventbridge'], '2015-10-07', { get: function get() { - var model = __nccwpck_require__(84609); - model.paginators = (__nccwpck_require__(45498)/* .pagination */ .o); + var model = __nccwpck_require__(9659); + model.paginators = (__nccwpck_require__(10871)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTAnalytics; +module.exports = AWS.EventBridge; /***/ }), -/***/ 6564: +/***/ 21440: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11601,25 +11534,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotdata'] = {}; -AWS.IotData = Service.defineService('iotdata', ['2015-05-28']); -__nccwpck_require__(27062); -Object.defineProperty(apiLoader.services['iotdata'], '2015-05-28', { +apiLoader.services['evidently'] = {}; +AWS.Evidently = Service.defineService('evidently', ['2021-02-01']); +Object.defineProperty(apiLoader.services['evidently'], '2021-02-01', { get: function get() { - var model = __nccwpck_require__(21717); - model.paginators = (__nccwpck_require__(31896)/* .pagination */ .o); + var model = __nccwpck_require__(41971); + model.paginators = (__nccwpck_require__(72960)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IotData; +module.exports = AWS.Evidently; /***/ }), -/***/ 97569: +/***/ 3052: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11627,24 +11559,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotdeviceadvisor'] = {}; -AWS.IotDeviceAdvisor = Service.defineService('iotdeviceadvisor', ['2020-09-18']); -Object.defineProperty(apiLoader.services['iotdeviceadvisor'], '2020-09-18', { +apiLoader.services['finspace'] = {}; +AWS.Finspace = Service.defineService('finspace', ['2021-03-12']); +Object.defineProperty(apiLoader.services['finspace'], '2021-03-12', { get: function get() { - var model = __nccwpck_require__(71394); - model.paginators = (__nccwpck_require__(49057)/* .pagination */ .o); + var model = __nccwpck_require__(37836); + model.paginators = (__nccwpck_require__(7328)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IotDeviceAdvisor; +module.exports = AWS.Finspace; /***/ }), -/***/ 88065: +/***/ 96869: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11652,24 +11584,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotevents'] = {}; -AWS.IoTEvents = Service.defineService('iotevents', ['2018-07-27']); -Object.defineProperty(apiLoader.services['iotevents'], '2018-07-27', { +apiLoader.services['finspacedata'] = {}; +AWS.Finspacedata = Service.defineService('finspacedata', ['2020-07-13']); +Object.defineProperty(apiLoader.services['finspacedata'], '2020-07-13', { get: function get() { - var model = __nccwpck_require__(4483); - model.paginators = (__nccwpck_require__(39844)/* .pagination */ .o); + var model = __nccwpck_require__(83394); + model.paginators = (__nccwpck_require__(70371)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTEvents; +module.exports = AWS.Finspacedata; /***/ }), -/***/ 56973: +/***/ 92831: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11677,24 +11609,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ioteventsdata'] = {}; -AWS.IoTEventsData = Service.defineService('ioteventsdata', ['2018-10-23']); -Object.defineProperty(apiLoader.services['ioteventsdata'], '2018-10-23', { +apiLoader.services['firehose'] = {}; +AWS.Firehose = Service.defineService('firehose', ['2015-08-04']); +Object.defineProperty(apiLoader.services['firehose'], '2015-08-04', { get: function get() { - var model = __nccwpck_require__(94282); - model.paginators = (__nccwpck_require__(11632)/* .pagination */ .o); + var model = __nccwpck_require__(48886); + model.paginators = (__nccwpck_require__(47400)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTEventsData; +module.exports = AWS.Firehose; /***/ }), -/***/ 42513: +/***/ 73003: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11702,24 +11634,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotfleethub'] = {}; -AWS.IoTFleetHub = Service.defineService('iotfleethub', ['2020-11-03']); -Object.defineProperty(apiLoader.services['iotfleethub'], '2020-11-03', { +apiLoader.services['fis'] = {}; +AWS.Fis = Service.defineService('fis', ['2020-12-01']); +Object.defineProperty(apiLoader.services['fis'], '2020-12-01', { get: function get() { - var model = __nccwpck_require__(56534); - model.paginators = (__nccwpck_require__(76120)/* .pagination */ .o); + var model = __nccwpck_require__(98356); + model.paginators = (__nccwpck_require__(6544)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTFleetHub; +module.exports = AWS.Fis; /***/ }), -/***/ 94329: +/***/ 11316: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11727,25 +11659,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotfleetwise'] = {}; -AWS.IoTFleetWise = Service.defineService('iotfleetwise', ['2021-06-17']); -Object.defineProperty(apiLoader.services['iotfleetwise'], '2021-06-17', { +apiLoader.services['fms'] = {}; +AWS.FMS = Service.defineService('fms', ['2018-01-01']); +Object.defineProperty(apiLoader.services['fms'], '2018-01-01', { get: function get() { - var model = __nccwpck_require__(68937); - model.paginators = (__nccwpck_require__(85715)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(23391)/* .waiters */ .V); + var model = __nccwpck_require__(22212); + model.paginators = (__nccwpck_require__(49570)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTFleetWise; +module.exports = AWS.FMS; /***/ }), -/***/ 42332: +/***/ 36822: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11753,24 +11684,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotjobsdataplane'] = {}; -AWS.IoTJobsDataPlane = Service.defineService('iotjobsdataplane', ['2017-09-29']); -Object.defineProperty(apiLoader.services['iotjobsdataplane'], '2017-09-29', { +apiLoader.services['forecastqueryservice'] = {}; +AWS.ForecastQueryService = Service.defineService('forecastqueryservice', ['2018-06-26']); +Object.defineProperty(apiLoader.services['forecastqueryservice'], '2018-06-26', { get: function get() { - var model = __nccwpck_require__(12147); - model.paginators = (__nccwpck_require__(58593)/* .pagination */ .o); + var model = __nccwpck_require__(23865); + model.paginators = (__nccwpck_require__(98135)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTJobsDataPlane; +module.exports = AWS.ForecastQueryService; /***/ }), -/***/ 22163: +/***/ 12942: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11778,24 +11709,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotroborunner'] = {}; -AWS.IoTRoboRunner = Service.defineService('iotroborunner', ['2018-05-10']); -Object.defineProperty(apiLoader.services['iotroborunner'], '2018-05-10', { +apiLoader.services['forecastservice'] = {}; +AWS.ForecastService = Service.defineService('forecastservice', ['2018-06-26']); +Object.defineProperty(apiLoader.services['forecastservice'], '2018-06-26', { get: function get() { - var model = __nccwpck_require__(11483); - model.paginators = (__nccwpck_require__(82393)/* .pagination */ .o); + var model = __nccwpck_require__(6468); + model.paginators = (__nccwpck_require__(45338)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTRoboRunner; +module.exports = AWS.ForecastService; /***/ }), -/***/ 98562: +/***/ 99830: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11803,24 +11734,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotsecuretunneling'] = {}; -AWS.IoTSecureTunneling = Service.defineService('iotsecuretunneling', ['2018-10-05']); -Object.defineProperty(apiLoader.services['iotsecuretunneling'], '2018-10-05', { +apiLoader.services['frauddetector'] = {}; +AWS.FraudDetector = Service.defineService('frauddetector', ['2019-11-15']); +Object.defineProperty(apiLoader.services['frauddetector'], '2019-11-15', { get: function get() { - var model = __nccwpck_require__(99946); - model.paginators = (__nccwpck_require__(97884)/* .pagination */ .o); + var model = __nccwpck_require__(96105); + model.paginators = (__nccwpck_require__(9177)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTSecureTunneling; +module.exports = AWS.FraudDetector; /***/ }), -/***/ 89690: +/***/ 11681: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11828,25 +11759,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotsitewise'] = {}; -AWS.IoTSiteWise = Service.defineService('iotsitewise', ['2019-12-02']); -Object.defineProperty(apiLoader.services['iotsitewise'], '2019-12-02', { +apiLoader.services['freetier'] = {}; +AWS.FreeTier = Service.defineService('freetier', ['2023-09-07']); +Object.defineProperty(apiLoader.services['freetier'], '2023-09-07', { get: function get() { - var model = __nccwpck_require__(44429); - model.paginators = (__nccwpck_require__(27558)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(80458)/* .waiters */ .V); + var model = __nccwpck_require__(50797); + model.paginators = (__nccwpck_require__(52266)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTSiteWise; +module.exports = AWS.FreeTier; /***/ }), -/***/ 58905: +/***/ 60642: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11854,24 +11784,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotthingsgraph'] = {}; -AWS.IoTThingsGraph = Service.defineService('iotthingsgraph', ['2018-09-06']); -Object.defineProperty(apiLoader.services['iotthingsgraph'], '2018-09-06', { +apiLoader.services['fsx'] = {}; +AWS.FSx = Service.defineService('fsx', ['2018-03-01']); +Object.defineProperty(apiLoader.services['fsx'], '2018-03-01', { get: function get() { - var model = __nccwpck_require__(84893); - model.paginators = (__nccwpck_require__(99418)/* .pagination */ .o); + var model = __nccwpck_require__(58245); + model.paginators = (__nccwpck_require__(19882)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTThingsGraph; +module.exports = AWS.FSx; /***/ }), -/***/ 65010: +/***/ 8085: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11879,25 +11809,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iottwinmaker'] = {}; -AWS.IoTTwinMaker = Service.defineService('iottwinmaker', ['2021-11-29']); -Object.defineProperty(apiLoader.services['iottwinmaker'], '2021-11-29', { +apiLoader.services['gamelift'] = {}; +AWS.GameLift = Service.defineService('gamelift', ['2015-10-01']); +Object.defineProperty(apiLoader.services['gamelift'], '2015-10-01', { get: function get() { - var model = __nccwpck_require__(30382); - model.paginators = (__nccwpck_require__(93389)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(41496)/* .waiters */ .V); + var model = __nccwpck_require__(69257); + model.paginators = (__nccwpck_require__(88381)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTTwinMaker; +module.exports = AWS.GameLift; /***/ }), -/***/ 8226: +/***/ 63249: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11905,24 +11834,26 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['iotwireless'] = {}; -AWS.IoTWireless = Service.defineService('iotwireless', ['2020-11-22']); -Object.defineProperty(apiLoader.services['iotwireless'], '2020-11-22', { +apiLoader.services['glacier'] = {}; +AWS.Glacier = Service.defineService('glacier', ['2012-06-01']); +__nccwpck_require__(14472); +Object.defineProperty(apiLoader.services['glacier'], '2012-06-01', { get: function get() { - var model = __nccwpck_require__(78052); - model.paginators = (__nccwpck_require__(13156)/* .pagination */ .o); + var model = __nccwpck_require__(11545); + model.paginators = (__nccwpck_require__(54145)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(65182)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IoTWireless; +module.exports = AWS.Glacier; /***/ }), -/***/ 67701: +/***/ 19306: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11930,24 +11861,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ivs'] = {}; -AWS.IVS = Service.defineService('ivs', ['2020-07-14']); -Object.defineProperty(apiLoader.services['ivs'], '2020-07-14', { +apiLoader.services['globalaccelerator'] = {}; +AWS.GlobalAccelerator = Service.defineService('globalaccelerator', ['2018-08-08']); +Object.defineProperty(apiLoader.services['globalaccelerator'], '2018-08-08', { get: function get() { - var model = __nccwpck_require__(34175); - model.paginators = (__nccwpck_require__(45289)/* .pagination */ .o); + var model = __nccwpck_require__(35365); + model.paginators = (__nccwpck_require__(14796)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IVS; +module.exports = AWS.GlobalAccelerator; /***/ }), -/***/ 17077: +/***/ 31658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11955,24 +11886,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ivschat'] = {}; -AWS.Ivschat = Service.defineService('ivschat', ['2020-07-14']); -Object.defineProperty(apiLoader.services['ivschat'], '2020-07-14', { +apiLoader.services['glue'] = {}; +AWS.Glue = Service.defineService('glue', ['2017-03-31']); +Object.defineProperty(apiLoader.services['glue'], '2017-03-31', { get: function get() { - var model = __nccwpck_require__(77512); - model.paginators = (__nccwpck_require__(85556)/* .pagination */ .o); + var model = __nccwpck_require__(72268); + model.paginators = (__nccwpck_require__(26545)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Ivschat; +module.exports = AWS.Glue; /***/ }), -/***/ 51946: +/***/ 51050: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -11980,24 +11911,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ivsrealtime'] = {}; -AWS.IVSRealTime = Service.defineService('ivsrealtime', ['2020-07-14']); -Object.defineProperty(apiLoader.services['ivsrealtime'], '2020-07-14', { +apiLoader.services['grafana'] = {}; +AWS.Grafana = Service.defineService('grafana', ['2020-08-18']); +Object.defineProperty(apiLoader.services['grafana'], '2020-08-18', { get: function get() { - var model = __nccwpck_require__(23084); - model.paginators = (__nccwpck_require__(64507)/* .pagination */ .o); + var model = __nccwpck_require__(29655); + model.paginators = (__nccwpck_require__(83188)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.IVSRealTime; +module.exports = AWS.Grafana; /***/ }), -/***/ 56775: +/***/ 20690: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12005,24 +11936,23 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kafka'] = {}; -AWS.Kafka = Service.defineService('kafka', ['2018-11-14']); -Object.defineProperty(apiLoader.services['kafka'], '2018-11-14', { +apiLoader.services['greengrass'] = {}; +AWS.Greengrass = Service.defineService('greengrass', ['2017-06-07']); +Object.defineProperty(apiLoader.services['greengrass'], '2017-06-07', { get: function get() { - var model = __nccwpck_require__(38473); - model.paginators = (__nccwpck_require__(79729)/* .pagination */ .o); + var model = __nccwpck_require__(72575); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Kafka; +module.exports = AWS.Greengrass; /***/ }), -/***/ 61879: +/***/ 45126: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12030,24 +11960,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kafkaconnect'] = {}; -AWS.KafkaConnect = Service.defineService('kafkaconnect', ['2021-09-14']); -Object.defineProperty(apiLoader.services['kafkaconnect'], '2021-09-14', { +apiLoader.services['greengrassv2'] = {}; +AWS.GreengrassV2 = Service.defineService('greengrassv2', ['2020-11-30']); +Object.defineProperty(apiLoader.services['greengrassv2'], '2020-11-30', { get: function get() { - var model = __nccwpck_require__(80867); - model.paginators = (__nccwpck_require__(32924)/* .pagination */ .o); + var model = __nccwpck_require__(57546); + model.paginators = (__nccwpck_require__(47961)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KafkaConnect; +module.exports = AWS.GreengrassV2; /***/ }), -/***/ 66122: +/***/ 80494: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12055,24 +11985,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kendra'] = {}; -AWS.Kendra = Service.defineService('kendra', ['2019-02-03']); -Object.defineProperty(apiLoader.services['kendra'], '2019-02-03', { +apiLoader.services['groundstation'] = {}; +AWS.GroundStation = Service.defineService('groundstation', ['2019-05-23']); +Object.defineProperty(apiLoader.services['groundstation'], '2019-05-23', { get: function get() { - var model = __nccwpck_require__(80100); - model.paginators = (__nccwpck_require__(64519)/* .pagination */ .o); + var model = __nccwpck_require__(27733); + model.paginators = (__nccwpck_require__(55974)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(77815)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Kendra; +module.exports = AWS.GroundStation; /***/ }), -/***/ 46255: +/***/ 40755: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12080,24 +12011,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kendraranking'] = {}; -AWS.KendraRanking = Service.defineService('kendraranking', ['2022-10-19']); -Object.defineProperty(apiLoader.services['kendraranking'], '2022-10-19', { +apiLoader.services['guardduty'] = {}; +AWS.GuardDuty = Service.defineService('guardduty', ['2017-11-28']); +Object.defineProperty(apiLoader.services['guardduty'], '2017-11-28', { get: function get() { - var model = __nccwpck_require__(66044); - model.paginators = (__nccwpck_require__(38563)/* .pagination */ .o); + var model = __nccwpck_require__(37793); + model.paginators = (__nccwpck_require__(87510)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KendraRanking; +module.exports = AWS.GuardDuty; /***/ }), -/***/ 24789: +/***/ 21834: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12105,25 +12036,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['keyspaces'] = {}; -AWS.Keyspaces = Service.defineService('keyspaces', ['2022-02-10']); -Object.defineProperty(apiLoader.services['keyspaces'], '2022-02-10', { +apiLoader.services['health'] = {}; +AWS.Health = Service.defineService('health', ['2016-08-04']); +Object.defineProperty(apiLoader.services['health'], '2016-08-04', { get: function get() { - var model = __nccwpck_require__(59857); - model.paginators = (__nccwpck_require__(19252)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(53164)/* .waiters */ .V); + var model = __nccwpck_require__(8618); + model.paginators = (__nccwpck_require__(46725)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Keyspaces; +module.exports = AWS.Health; /***/ }), -/***/ 49876: +/***/ 64254: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12131,25 +12061,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesis'] = {}; -AWS.Kinesis = Service.defineService('kinesis', ['2013-12-02']); -Object.defineProperty(apiLoader.services['kinesis'], '2013-12-02', { +apiLoader.services['healthlake'] = {}; +AWS.HealthLake = Service.defineService('healthlake', ['2017-07-01']); +Object.defineProperty(apiLoader.services['healthlake'], '2017-07-01', { get: function get() { - var model = __nccwpck_require__(648); - model.paginators = (__nccwpck_require__(10424)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(54059)/* .waiters */ .V); + var model = __nccwpck_require__(13637); + model.paginators = (__nccwpck_require__(92834)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Kinesis; +module.exports = AWS.HealthLake; /***/ }), -/***/ 90042: +/***/ 50058: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12157,24 +12086,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesisanalytics'] = {}; -AWS.KinesisAnalytics = Service.defineService('kinesisanalytics', ['2015-08-14']); -Object.defineProperty(apiLoader.services['kinesisanalytics'], '2015-08-14', { +apiLoader.services['iam'] = {}; +AWS.IAM = Service.defineService('iam', ['2010-05-08']); +Object.defineProperty(apiLoader.services['iam'], '2010-05-08', { get: function get() { - var model = __nccwpck_require__(72653); - model.paginators = (__nccwpck_require__(73535)/* .pagination */ .o); + var model = __nccwpck_require__(27041); + model.paginators = (__nccwpck_require__(97583)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(37757)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KinesisAnalytics; +module.exports = AWS.IAM; /***/ }), -/***/ 74631: +/***/ 60222: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12182,24 +12112,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesisanalyticsv2'] = {}; -AWS.KinesisAnalyticsV2 = Service.defineService('kinesisanalyticsv2', ['2018-05-23']); -Object.defineProperty(apiLoader.services['kinesisanalyticsv2'], '2018-05-23', { +apiLoader.services['identitystore'] = {}; +AWS.IdentityStore = Service.defineService('identitystore', ['2020-06-15']); +Object.defineProperty(apiLoader.services['identitystore'], '2020-06-15', { get: function get() { - var model = __nccwpck_require__(56485); - model.paginators = (__nccwpck_require__(52495)/* .pagination */ .o); + var model = __nccwpck_require__(75797); + model.paginators = (__nccwpck_require__(44872)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KinesisAnalyticsV2; +module.exports = AWS.IdentityStore; /***/ }), -/***/ 89927: +/***/ 57511: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12207,24 +12137,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesisvideo'] = {}; -AWS.KinesisVideo = Service.defineService('kinesisvideo', ['2017-09-30']); -Object.defineProperty(apiLoader.services['kinesisvideo'], '2017-09-30', { +apiLoader.services['imagebuilder'] = {}; +AWS.Imagebuilder = Service.defineService('imagebuilder', ['2019-12-02']); +Object.defineProperty(apiLoader.services['imagebuilder'], '2019-12-02', { get: function get() { - var model = __nccwpck_require__(96305); - model.paginators = (__nccwpck_require__(50061)/* .pagination */ .o); + var model = __nccwpck_require__(98139); + model.paginators = (__nccwpck_require__(60410)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KinesisVideo; +module.exports = AWS.Imagebuilder; /***/ }), -/***/ 5580: +/***/ 6769: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12232,24 +12162,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesisvideoarchivedmedia'] = {}; -AWS.KinesisVideoArchivedMedia = Service.defineService('kinesisvideoarchivedmedia', ['2017-09-30']); -Object.defineProperty(apiLoader.services['kinesisvideoarchivedmedia'], '2017-09-30', { +apiLoader.services['importexport'] = {}; +AWS.ImportExport = Service.defineService('importexport', ['2010-06-01']); +Object.defineProperty(apiLoader.services['importexport'], '2010-06-01', { get: function get() { - var model = __nccwpck_require__(78868); - model.paginators = (__nccwpck_require__(27352)/* .pagination */ .o); + var model = __nccwpck_require__(80317); + model.paginators = (__nccwpck_require__(58037)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KinesisVideoArchivedMedia; +module.exports = AWS.ImportExport; /***/ }), -/***/ 81308: +/***/ 89439: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12257,24 +12187,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesisvideomedia'] = {}; -AWS.KinesisVideoMedia = Service.defineService('kinesisvideomedia', ['2017-09-30']); -Object.defineProperty(apiLoader.services['kinesisvideomedia'], '2017-09-30', { +apiLoader.services['inspector'] = {}; +AWS.Inspector = Service.defineService('inspector', ['2015-08-18*', '2016-02-16']); +Object.defineProperty(apiLoader.services['inspector'], '2016-02-16', { get: function get() { - var model = __nccwpck_require__(18898); - model.paginators = (__nccwpck_require__(85061)/* .pagination */ .o); + var model = __nccwpck_require__(71649); + model.paginators = (__nccwpck_require__(69242)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KinesisVideoMedia; +module.exports = AWS.Inspector; /***/ }), -/***/ 12710: +/***/ 98650: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12282,24 +12212,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesisvideosignalingchannels'] = {}; -AWS.KinesisVideoSignalingChannels = Service.defineService('kinesisvideosignalingchannels', ['2019-12-04']); -Object.defineProperty(apiLoader.services['kinesisvideosignalingchannels'], '2019-12-04', { +apiLoader.services['inspector2'] = {}; +AWS.Inspector2 = Service.defineService('inspector2', ['2020-06-08']); +Object.defineProperty(apiLoader.services['inspector2'], '2020-06-08', { get: function get() { - var model = __nccwpck_require__(89769); - model.paginators = (__nccwpck_require__(41939)/* .pagination */ .o); + var model = __nccwpck_require__(61291); + model.paginators = (__nccwpck_require__(17472)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KinesisVideoSignalingChannels; +module.exports = AWS.Inspector2; /***/ }), -/***/ 52642: +/***/ 25467: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12307,24 +12237,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kinesisvideowebrtcstorage'] = {}; -AWS.KinesisVideoWebRTCStorage = Service.defineService('kinesisvideowebrtcstorage', ['2018-05-10']); -Object.defineProperty(apiLoader.services['kinesisvideowebrtcstorage'], '2018-05-10', { +apiLoader.services['inspectorscan'] = {}; +AWS.InspectorScan = Service.defineService('inspectorscan', ['2023-08-08']); +Object.defineProperty(apiLoader.services['inspectorscan'], '2023-08-08', { get: function get() { - var model = __nccwpck_require__(62761); - model.paginators = (__nccwpck_require__(3540)/* .pagination */ .o); + var model = __nccwpck_require__(17875); + model.paginators = (__nccwpck_require__(35037)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KinesisVideoWebRTCStorage; +module.exports = AWS.InspectorScan; /***/ }), -/***/ 56782: +/***/ 84099: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12332,24 +12262,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['kms'] = {}; -AWS.KMS = Service.defineService('kms', ['2014-11-01']); -Object.defineProperty(apiLoader.services['kms'], '2014-11-01', { +apiLoader.services['internetmonitor'] = {}; +AWS.InternetMonitor = Service.defineService('internetmonitor', ['2021-06-03']); +Object.defineProperty(apiLoader.services['internetmonitor'], '2021-06-03', { get: function get() { - var model = __nccwpck_require__(1219); - model.paginators = (__nccwpck_require__(71402)/* .pagination */ .o); + var model = __nccwpck_require__(62158); + model.paginators = (__nccwpck_require__(64409)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(76543)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.KMS; +module.exports = AWS.InternetMonitor; /***/ }), -/***/ 6726: +/***/ 98392: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12357,24 +12288,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lakeformation'] = {}; -AWS.LakeFormation = Service.defineService('lakeformation', ['2017-03-31']); -Object.defineProperty(apiLoader.services['lakeformation'], '2017-03-31', { +apiLoader.services['iot'] = {}; +AWS.Iot = Service.defineService('iot', ['2015-05-28']); +Object.defineProperty(apiLoader.services['iot'], '2015-05-28', { get: function get() { - var model = __nccwpck_require__(82210); - model.paginators = (__nccwpck_require__(61488)/* .pagination */ .o); + var model = __nccwpck_require__(40063); + model.paginators = (__nccwpck_require__(43999)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LakeFormation; +module.exports = AWS.Iot; /***/ }), -/***/ 13321: +/***/ 39474: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12382,35 +12313,23 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lambda'] = {}; -AWS.Lambda = Service.defineService('lambda', ['2014-11-11', '2015-03-31']); -__nccwpck_require__(8452); -Object.defineProperty(apiLoader.services['lambda'], '2014-11-11', { - get: function get() { - var model = __nccwpck_require__(91251); - model.paginators = (__nccwpck_require__(79210)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['lambda'], '2015-03-31', { +apiLoader.services['iot1clickdevicesservice'] = {}; +AWS.IoT1ClickDevicesService = Service.defineService('iot1clickdevicesservice', ['2018-05-14']); +Object.defineProperty(apiLoader.services['iot1clickdevicesservice'], '2018-05-14', { get: function get() { - var model = __nccwpck_require__(29103); - model.paginators = (__nccwpck_require__(32057)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(40626)/* .waiters */ .V); + var model = __nccwpck_require__(26663); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Lambda; +module.exports = AWS.IoT1ClickDevicesService; /***/ }), -/***/ 71060: +/***/ 4686: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12418,24 +12337,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['launchwizard'] = {}; -AWS.LaunchWizard = Service.defineService('launchwizard', ['2018-05-10']); -Object.defineProperty(apiLoader.services['launchwizard'], '2018-05-10', { +apiLoader.services['iot1clickprojects'] = {}; +AWS.IoT1ClickProjects = Service.defineService('iot1clickprojects', ['2018-05-14']); +Object.defineProperty(apiLoader.services['iot1clickprojects'], '2018-05-14', { get: function get() { - var model = __nccwpck_require__(67108); - model.paginators = (__nccwpck_require__(50601)/* .pagination */ .o); + var model = __nccwpck_require__(17364); + model.paginators = (__nccwpck_require__(54033)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LaunchWizard; +module.exports = AWS.IoT1ClickProjects; /***/ }), -/***/ 37397: +/***/ 67409: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12443,24 +12362,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lexmodelbuildingservice'] = {}; -AWS.LexModelBuildingService = Service.defineService('lexmodelbuildingservice', ['2017-04-19']); -Object.defineProperty(apiLoader.services['lexmodelbuildingservice'], '2017-04-19', { +apiLoader.services['iotanalytics'] = {}; +AWS.IoTAnalytics = Service.defineService('iotanalytics', ['2017-11-27']); +Object.defineProperty(apiLoader.services['iotanalytics'], '2017-11-27', { get: function get() { - var model = __nccwpck_require__(96327); - model.paginators = (__nccwpck_require__(12348)/* .pagination */ .o); + var model = __nccwpck_require__(84609); + model.paginators = (__nccwpck_require__(45498)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LexModelBuildingService; +module.exports = AWS.IoTAnalytics; /***/ }), -/***/ 27254: +/***/ 6564: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12468,25 +12387,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lexmodelsv2'] = {}; -AWS.LexModelsV2 = Service.defineService('lexmodelsv2', ['2020-08-07']); -Object.defineProperty(apiLoader.services['lexmodelsv2'], '2020-08-07', { +apiLoader.services['iotdata'] = {}; +AWS.IotData = Service.defineService('iotdata', ['2015-05-28']); +__nccwpck_require__(27062); +Object.defineProperty(apiLoader.services['iotdata'], '2015-05-28', { get: function get() { - var model = __nccwpck_require__(98781); - model.paginators = (__nccwpck_require__(49461)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(55520)/* .waiters */ .V); + var model = __nccwpck_require__(21717); + model.paginators = (__nccwpck_require__(31896)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LexModelsV2; +module.exports = AWS.IotData; /***/ }), -/***/ 62716: +/***/ 97569: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12494,24 +12413,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lexruntime'] = {}; -AWS.LexRuntime = Service.defineService('lexruntime', ['2016-11-28']); -Object.defineProperty(apiLoader.services['lexruntime'], '2016-11-28', { +apiLoader.services['iotdeviceadvisor'] = {}; +AWS.IotDeviceAdvisor = Service.defineService('iotdeviceadvisor', ['2020-09-18']); +Object.defineProperty(apiLoader.services['iotdeviceadvisor'], '2020-09-18', { get: function get() { - var model = __nccwpck_require__(11059); - model.paginators = (__nccwpck_require__(97715)/* .pagination */ .o); + var model = __nccwpck_require__(71394); + model.paginators = (__nccwpck_require__(49057)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LexRuntime; +module.exports = AWS.IotDeviceAdvisor; /***/ }), -/***/ 33855: +/***/ 88065: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12519,24 +12438,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lexruntimev2'] = {}; -AWS.LexRuntimeV2 = Service.defineService('lexruntimev2', ['2020-08-07']); -Object.defineProperty(apiLoader.services['lexruntimev2'], '2020-08-07', { +apiLoader.services['iotevents'] = {}; +AWS.IoTEvents = Service.defineService('iotevents', ['2018-07-27']); +Object.defineProperty(apiLoader.services['iotevents'], '2018-07-27', { get: function get() { - var model = __nccwpck_require__(17908); - model.paginators = (__nccwpck_require__(469)/* .pagination */ .o); + var model = __nccwpck_require__(4483); + model.paginators = (__nccwpck_require__(39844)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LexRuntimeV2; +module.exports = AWS.IoTEvents; /***/ }), -/***/ 34693: +/***/ 56973: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12544,24 +12463,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['licensemanager'] = {}; -AWS.LicenseManager = Service.defineService('licensemanager', ['2018-08-01']); -Object.defineProperty(apiLoader.services['licensemanager'], '2018-08-01', { +apiLoader.services['ioteventsdata'] = {}; +AWS.IoTEventsData = Service.defineService('ioteventsdata', ['2018-10-23']); +Object.defineProperty(apiLoader.services['ioteventsdata'], '2018-10-23', { get: function get() { - var model = __nccwpck_require__(19160); - model.paginators = (__nccwpck_require__(77552)/* .pagination */ .o); + var model = __nccwpck_require__(94282); + model.paginators = (__nccwpck_require__(11632)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LicenseManager; +module.exports = AWS.IoTEventsData; /***/ }), -/***/ 52687: +/***/ 42513: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12569,24 +12488,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['licensemanagerlinuxsubscriptions'] = {}; -AWS.LicenseManagerLinuxSubscriptions = Service.defineService('licensemanagerlinuxsubscriptions', ['2018-05-10']); -Object.defineProperty(apiLoader.services['licensemanagerlinuxsubscriptions'], '2018-05-10', { +apiLoader.services['iotfleethub'] = {}; +AWS.IoTFleetHub = Service.defineService('iotfleethub', ['2020-11-03']); +Object.defineProperty(apiLoader.services['iotfleethub'], '2020-11-03', { get: function get() { - var model = __nccwpck_require__(94260); - model.paginators = (__nccwpck_require__(60467)/* .pagination */ .o); + var model = __nccwpck_require__(56534); + model.paginators = (__nccwpck_require__(76120)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LicenseManagerLinuxSubscriptions; +module.exports = AWS.IoTFleetHub; /***/ }), -/***/ 37725: +/***/ 94329: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12594,24 +12513,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['licensemanagerusersubscriptions'] = {}; -AWS.LicenseManagerUserSubscriptions = Service.defineService('licensemanagerusersubscriptions', ['2018-05-10']); -Object.defineProperty(apiLoader.services['licensemanagerusersubscriptions'], '2018-05-10', { +apiLoader.services['iotfleetwise'] = {}; +AWS.IoTFleetWise = Service.defineService('iotfleetwise', ['2021-06-17']); +Object.defineProperty(apiLoader.services['iotfleetwise'], '2021-06-17', { get: function get() { - var model = __nccwpck_require__(48338); - model.paginators = (__nccwpck_require__(84416)/* .pagination */ .o); + var model = __nccwpck_require__(68937); + model.paginators = (__nccwpck_require__(85715)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(23391)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LicenseManagerUserSubscriptions; +module.exports = AWS.IoTFleetWise; /***/ }), -/***/ 22718: +/***/ 42332: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12619,24 +12539,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lightsail'] = {}; -AWS.Lightsail = Service.defineService('lightsail', ['2016-11-28']); -Object.defineProperty(apiLoader.services['lightsail'], '2016-11-28', { +apiLoader.services['iotjobsdataplane'] = {}; +AWS.IoTJobsDataPlane = Service.defineService('iotjobsdataplane', ['2017-09-29']); +Object.defineProperty(apiLoader.services['iotjobsdataplane'], '2017-09-29', { get: function get() { - var model = __nccwpck_require__(94784); - model.paginators = (__nccwpck_require__(17528)/* .pagination */ .o); + var model = __nccwpck_require__(12147); + model.paginators = (__nccwpck_require__(58593)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Lightsail; +module.exports = AWS.IoTJobsDataPlane; /***/ }), -/***/ 44594: +/***/ 98562: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12644,24 +12564,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['location'] = {}; -AWS.Location = Service.defineService('location', ['2020-11-19']); -Object.defineProperty(apiLoader.services['location'], '2020-11-19', { +apiLoader.services['iotsecuretunneling'] = {}; +AWS.IoTSecureTunneling = Service.defineService('iotsecuretunneling', ['2018-10-05']); +Object.defineProperty(apiLoader.services['iotsecuretunneling'], '2018-10-05', { get: function get() { - var model = __nccwpck_require__(79257); - model.paginators = (__nccwpck_require__(53350)/* .pagination */ .o); + var model = __nccwpck_require__(99946); + model.paginators = (__nccwpck_require__(97884)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Location; +module.exports = AWS.IoTSecureTunneling; /***/ }), -/***/ 21843: +/***/ 89690: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12669,24 +12589,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lookoutequipment'] = {}; -AWS.LookoutEquipment = Service.defineService('lookoutequipment', ['2020-12-15']); -Object.defineProperty(apiLoader.services['lookoutequipment'], '2020-12-15', { +apiLoader.services['iotsitewise'] = {}; +AWS.IoTSiteWise = Service.defineService('iotsitewise', ['2019-12-02']); +Object.defineProperty(apiLoader.services['iotsitewise'], '2019-12-02', { get: function get() { - var model = __nccwpck_require__(50969); - model.paginators = (__nccwpck_require__(92858)/* .pagination */ .o); + var model = __nccwpck_require__(44429); + model.paginators = (__nccwpck_require__(27558)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(80458)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LookoutEquipment; +module.exports = AWS.IoTSiteWise; /***/ }), -/***/ 78708: +/***/ 58905: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12694,24 +12615,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lookoutmetrics'] = {}; -AWS.LookoutMetrics = Service.defineService('lookoutmetrics', ['2017-07-25']); -Object.defineProperty(apiLoader.services['lookoutmetrics'], '2017-07-25', { +apiLoader.services['iotthingsgraph'] = {}; +AWS.IoTThingsGraph = Service.defineService('iotthingsgraph', ['2018-09-06']); +Object.defineProperty(apiLoader.services['iotthingsgraph'], '2018-09-06', { get: function get() { - var model = __nccwpck_require__(37749); - model.paginators = (__nccwpck_require__(13366)/* .pagination */ .o); + var model = __nccwpck_require__(84893); + model.paginators = (__nccwpck_require__(99418)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LookoutMetrics; +module.exports = AWS.IoTThingsGraph; /***/ }), -/***/ 65046: +/***/ 65010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12719,24 +12640,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['lookoutvision'] = {}; -AWS.LookoutVision = Service.defineService('lookoutvision', ['2020-11-20']); -Object.defineProperty(apiLoader.services['lookoutvision'], '2020-11-20', { +apiLoader.services['iottwinmaker'] = {}; +AWS.IoTTwinMaker = Service.defineService('iottwinmaker', ['2021-11-29']); +Object.defineProperty(apiLoader.services['iottwinmaker'], '2021-11-29', { get: function get() { - var model = __nccwpck_require__(15110); - model.paginators = (__nccwpck_require__(45644)/* .pagination */ .o); + var model = __nccwpck_require__(30382); + model.paginators = (__nccwpck_require__(93389)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(41496)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.LookoutVision; +module.exports = AWS.IoTTwinMaker; /***/ }), -/***/ 22482: +/***/ 8226: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12744,24 +12666,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['m2'] = {}; -AWS.M2 = Service.defineService('m2', ['2021-04-28']); -Object.defineProperty(apiLoader.services['m2'], '2021-04-28', { +apiLoader.services['iotwireless'] = {}; +AWS.IoTWireless = Service.defineService('iotwireless', ['2020-11-22']); +Object.defineProperty(apiLoader.services['iotwireless'], '2020-11-22', { get: function get() { - var model = __nccwpck_require__(21363); - model.paginators = (__nccwpck_require__(96286)/* .pagination */ .o); + var model = __nccwpck_require__(78052); + model.paginators = (__nccwpck_require__(13156)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.M2; +module.exports = AWS.IoTWireless; /***/ }), -/***/ 82907: +/***/ 67701: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12769,26 +12691,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['machinelearning'] = {}; -AWS.MachineLearning = Service.defineService('machinelearning', ['2014-12-12']); -__nccwpck_require__(19174); -Object.defineProperty(apiLoader.services['machinelearning'], '2014-12-12', { +apiLoader.services['ivs'] = {}; +AWS.IVS = Service.defineService('ivs', ['2020-07-14']); +Object.defineProperty(apiLoader.services['ivs'], '2020-07-14', { get: function get() { - var model = __nccwpck_require__(4069); - model.paginators = (__nccwpck_require__(95535)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(23194)/* .waiters */ .V); + var model = __nccwpck_require__(34175); + model.paginators = (__nccwpck_require__(45289)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MachineLearning; +module.exports = AWS.IVS; /***/ }), -/***/ 57330: +/***/ 17077: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12796,25 +12716,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['macie2'] = {}; -AWS.Macie2 = Service.defineService('macie2', ['2020-01-01']); -Object.defineProperty(apiLoader.services['macie2'], '2020-01-01', { +apiLoader.services['ivschat'] = {}; +AWS.Ivschat = Service.defineService('ivschat', ['2020-07-14']); +Object.defineProperty(apiLoader.services['ivschat'], '2020-07-14', { get: function get() { - var model = __nccwpck_require__(50847); - model.paginators = (__nccwpck_require__(25947)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(71131)/* .waiters */ .V); + var model = __nccwpck_require__(77512); + model.paginators = (__nccwpck_require__(85556)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(617)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Macie2; +module.exports = AWS.Ivschat; /***/ }), -/***/ 85143: +/***/ 51946: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12822,24 +12742,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['managedblockchain'] = {}; -AWS.ManagedBlockchain = Service.defineService('managedblockchain', ['2018-09-24']); -Object.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', { +apiLoader.services['ivsrealtime'] = {}; +AWS.IVSRealTime = Service.defineService('ivsrealtime', ['2020-07-14']); +Object.defineProperty(apiLoader.services['ivsrealtime'], '2020-07-14', { get: function get() { - var model = __nccwpck_require__(31229); - model.paginators = (__nccwpck_require__(57358)/* .pagination */ .o); + var model = __nccwpck_require__(23084); + model.paginators = (__nccwpck_require__(64507)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(40441)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ManagedBlockchain; +module.exports = AWS.IVSRealTime; /***/ }), -/***/ 51046: +/***/ 56775: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12847,25 +12768,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['managedblockchainquery'] = {}; -AWS.ManagedBlockchainQuery = Service.defineService('managedblockchainquery', ['2023-05-04']); -Object.defineProperty(apiLoader.services['managedblockchainquery'], '2023-05-04', { +apiLoader.services['kafka'] = {}; +AWS.Kafka = Service.defineService('kafka', ['2018-11-14']); +Object.defineProperty(apiLoader.services['kafka'], '2018-11-14', { get: function get() { - var model = __nccwpck_require__(53546); - model.paginators = (__nccwpck_require__(95929)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(17688)/* .waiters */ .V); + var model = __nccwpck_require__(38473); + model.paginators = (__nccwpck_require__(79729)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ManagedBlockchainQuery; +module.exports = AWS.Kafka; /***/ }), -/***/ 50379: +/***/ 61879: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12873,24 +12793,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['marketplaceagreement'] = {}; -AWS.MarketplaceAgreement = Service.defineService('marketplaceagreement', ['2020-03-01']); -Object.defineProperty(apiLoader.services['marketplaceagreement'], '2020-03-01', { +apiLoader.services['kafkaconnect'] = {}; +AWS.KafkaConnect = Service.defineService('kafkaconnect', ['2021-09-14']); +Object.defineProperty(apiLoader.services['kafkaconnect'], '2021-09-14', { get: function get() { - var model = __nccwpck_require__(35188); - model.paginators = (__nccwpck_require__(99220)/* .pagination */ .o); + var model = __nccwpck_require__(80867); + model.paginators = (__nccwpck_require__(32924)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MarketplaceAgreement; +module.exports = AWS.KafkaConnect; /***/ }), -/***/ 2609: +/***/ 66122: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12898,24 +12818,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['marketplacecatalog'] = {}; -AWS.MarketplaceCatalog = Service.defineService('marketplacecatalog', ['2018-09-17']); -Object.defineProperty(apiLoader.services['marketplacecatalog'], '2018-09-17', { +apiLoader.services['kendra'] = {}; +AWS.Kendra = Service.defineService('kendra', ['2019-02-03']); +Object.defineProperty(apiLoader.services['kendra'], '2019-02-03', { get: function get() { - var model = __nccwpck_require__(87122); - model.paginators = (__nccwpck_require__(30187)/* .pagination */ .o); + var model = __nccwpck_require__(80100); + model.paginators = (__nccwpck_require__(64519)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MarketplaceCatalog; +module.exports = AWS.Kendra; /***/ }), -/***/ 4540: +/***/ 46255: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12923,24 +12843,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['marketplacecommerceanalytics'] = {}; -AWS.MarketplaceCommerceAnalytics = Service.defineService('marketplacecommerceanalytics', ['2015-07-01']); -Object.defineProperty(apiLoader.services['marketplacecommerceanalytics'], '2015-07-01', { +apiLoader.services['kendraranking'] = {}; +AWS.KendraRanking = Service.defineService('kendraranking', ['2022-10-19']); +Object.defineProperty(apiLoader.services['kendraranking'], '2022-10-19', { get: function get() { - var model = __nccwpck_require__(96696); - model.paginators = (__nccwpck_require__(43265)/* .pagination */ .o); + var model = __nccwpck_require__(66044); + model.paginators = (__nccwpck_require__(38563)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MarketplaceCommerceAnalytics; +module.exports = AWS.KendraRanking; /***/ }), -/***/ 56811: +/***/ 24789: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12948,24 +12868,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['marketplacedeployment'] = {}; -AWS.MarketplaceDeployment = Service.defineService('marketplacedeployment', ['2023-01-25']); -Object.defineProperty(apiLoader.services['marketplacedeployment'], '2023-01-25', { +apiLoader.services['keyspaces'] = {}; +AWS.Keyspaces = Service.defineService('keyspaces', ['2022-02-10']); +Object.defineProperty(apiLoader.services['keyspaces'], '2022-02-10', { get: function get() { - var model = __nccwpck_require__(9966); - model.paginators = (__nccwpck_require__(31372)/* .pagination */ .o); + var model = __nccwpck_require__(59857); + model.paginators = (__nccwpck_require__(19252)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(53164)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MarketplaceDeployment; +module.exports = AWS.Keyspaces; /***/ }), -/***/ 53707: +/***/ 49876: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12973,24 +12894,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['marketplaceentitlementservice'] = {}; -AWS.MarketplaceEntitlementService = Service.defineService('marketplaceentitlementservice', ['2017-01-11']); -Object.defineProperty(apiLoader.services['marketplaceentitlementservice'], '2017-01-11', { +apiLoader.services['kinesis'] = {}; +AWS.Kinesis = Service.defineService('kinesis', ['2013-12-02']); +Object.defineProperty(apiLoader.services['kinesis'], '2013-12-02', { get: function get() { - var model = __nccwpck_require__(64253); - model.paginators = (__nccwpck_require__(67012)/* .pagination */ .o); + var model = __nccwpck_require__(648); + model.paginators = (__nccwpck_require__(10424)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(54059)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MarketplaceEntitlementService; +module.exports = AWS.Kinesis; /***/ }), -/***/ 39297: +/***/ 90042: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -12998,24 +12920,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['marketplacemetering'] = {}; -AWS.MarketplaceMetering = Service.defineService('marketplacemetering', ['2016-01-14']); -Object.defineProperty(apiLoader.services['marketplacemetering'], '2016-01-14', { +apiLoader.services['kinesisanalytics'] = {}; +AWS.KinesisAnalytics = Service.defineService('kinesisanalytics', ['2015-08-14']); +Object.defineProperty(apiLoader.services['kinesisanalytics'], '2015-08-14', { get: function get() { - var model = __nccwpck_require__(43027); - model.paginators = (__nccwpck_require__(4843)/* .pagination */ .o); + var model = __nccwpck_require__(72653); + model.paginators = (__nccwpck_require__(73535)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MarketplaceMetering; +module.exports = AWS.KinesisAnalytics; /***/ }), -/***/ 67639: +/***/ 74631: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13023,25 +12945,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediaconnect'] = {}; -AWS.MediaConnect = Service.defineService('mediaconnect', ['2018-11-14']); -Object.defineProperty(apiLoader.services['mediaconnect'], '2018-11-14', { +apiLoader.services['kinesisanalyticsv2'] = {}; +AWS.KinesisAnalyticsV2 = Service.defineService('kinesisanalyticsv2', ['2018-05-23']); +Object.defineProperty(apiLoader.services['kinesisanalyticsv2'], '2018-05-23', { get: function get() { - var model = __nccwpck_require__(85245); - model.paginators = (__nccwpck_require__(68160)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(42876)/* .waiters */ .V); + var model = __nccwpck_require__(56485); + model.paginators = (__nccwpck_require__(52495)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaConnect; +module.exports = AWS.KinesisAnalyticsV2; /***/ }), -/***/ 57220: +/***/ 89927: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13049,24 +12970,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediaconvert'] = {}; -AWS.MediaConvert = Service.defineService('mediaconvert', ['2017-08-29']); -Object.defineProperty(apiLoader.services['mediaconvert'], '2017-08-29', { +apiLoader.services['kinesisvideo'] = {}; +AWS.KinesisVideo = Service.defineService('kinesisvideo', ['2017-09-30']); +Object.defineProperty(apiLoader.services['kinesisvideo'], '2017-09-30', { get: function get() { - var model = __nccwpck_require__(41924); - model.paginators = (__nccwpck_require__(14179)/* .pagination */ .o); + var model = __nccwpck_require__(96305); + model.paginators = (__nccwpck_require__(50061)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaConvert; +module.exports = AWS.KinesisVideo; /***/ }), -/***/ 7509: +/***/ 5580: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13074,25 +12995,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['medialive'] = {}; -AWS.MediaLive = Service.defineService('medialive', ['2017-10-14']); -Object.defineProperty(apiLoader.services['medialive'], '2017-10-14', { +apiLoader.services['kinesisvideoarchivedmedia'] = {}; +AWS.KinesisVideoArchivedMedia = Service.defineService('kinesisvideoarchivedmedia', ['2017-09-30']); +Object.defineProperty(apiLoader.services['kinesisvideoarchivedmedia'], '2017-09-30', { get: function get() { - var model = __nccwpck_require__(32326); - model.paginators = (__nccwpck_require__(84652)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(17259)/* .waiters */ .V); + var model = __nccwpck_require__(78868); + model.paginators = (__nccwpck_require__(27352)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaLive; +module.exports = AWS.KinesisVideoArchivedMedia; /***/ }), -/***/ 91620: +/***/ 81308: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13100,24 +13020,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediapackage'] = {}; -AWS.MediaPackage = Service.defineService('mediapackage', ['2017-10-12']); -Object.defineProperty(apiLoader.services['mediapackage'], '2017-10-12', { +apiLoader.services['kinesisvideomedia'] = {}; +AWS.KinesisVideoMedia = Service.defineService('kinesisvideomedia', ['2017-09-30']); +Object.defineProperty(apiLoader.services['kinesisvideomedia'], '2017-09-30', { get: function get() { - var model = __nccwpck_require__(51261); - model.paginators = (__nccwpck_require__(48933)/* .pagination */ .o); + var model = __nccwpck_require__(18898); + model.paginators = (__nccwpck_require__(85061)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaPackage; +module.exports = AWS.KinesisVideoMedia; /***/ }), -/***/ 53264: +/***/ 12710: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13125,25 +13045,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediapackagev2'] = {}; -AWS.MediaPackageV2 = Service.defineService('mediapackagev2', ['2022-12-25']); -Object.defineProperty(apiLoader.services['mediapackagev2'], '2022-12-25', { +apiLoader.services['kinesisvideosignalingchannels'] = {}; +AWS.KinesisVideoSignalingChannels = Service.defineService('kinesisvideosignalingchannels', ['2019-12-04']); +Object.defineProperty(apiLoader.services['kinesisvideosignalingchannels'], '2019-12-04', { get: function get() { - var model = __nccwpck_require__(37594); - model.paginators = (__nccwpck_require__(44503)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(68906)/* .waiters */ .V); + var model = __nccwpck_require__(89769); + model.paginators = (__nccwpck_require__(41939)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaPackageV2; +module.exports = AWS.KinesisVideoSignalingChannels; /***/ }), -/***/ 14962: +/***/ 52642: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13151,24 +13070,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediapackagevod'] = {}; -AWS.MediaPackageVod = Service.defineService('mediapackagevod', ['2018-11-07']); -Object.defineProperty(apiLoader.services['mediapackagevod'], '2018-11-07', { +apiLoader.services['kinesisvideowebrtcstorage'] = {}; +AWS.KinesisVideoWebRTCStorage = Service.defineService('kinesisvideowebrtcstorage', ['2018-05-10']); +Object.defineProperty(apiLoader.services['kinesisvideowebrtcstorage'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(98877); - model.paginators = (__nccwpck_require__(48422)/* .pagination */ .o); + var model = __nccwpck_require__(62761); + model.paginators = (__nccwpck_require__(3540)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaPackageVod; +module.exports = AWS.KinesisVideoWebRTCStorage; /***/ }), -/***/ 83748: +/***/ 56782: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13176,24 +13095,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediastore'] = {}; -AWS.MediaStore = Service.defineService('mediastore', ['2017-09-01']); -Object.defineProperty(apiLoader.services['mediastore'], '2017-09-01', { +apiLoader.services['kms'] = {}; +AWS.KMS = Service.defineService('kms', ['2014-11-01']); +Object.defineProperty(apiLoader.services['kms'], '2014-11-01', { get: function get() { - var model = __nccwpck_require__(68901); - model.paginators = (__nccwpck_require__(5848)/* .pagination */ .o); + var model = __nccwpck_require__(1219); + model.paginators = (__nccwpck_require__(71402)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaStore; +module.exports = AWS.KMS; /***/ }), -/***/ 98703: +/***/ 6726: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13201,24 +13120,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediastoredata'] = {}; -AWS.MediaStoreData = Service.defineService('mediastoredata', ['2017-09-01']); -Object.defineProperty(apiLoader.services['mediastoredata'], '2017-09-01', { +apiLoader.services['lakeformation'] = {}; +AWS.LakeFormation = Service.defineService('lakeformation', ['2017-03-31']); +Object.defineProperty(apiLoader.services['lakeformation'], '2017-03-31', { get: function get() { - var model = __nccwpck_require__(55081); - model.paginators = (__nccwpck_require__(97948)/* .pagination */ .o); + var model = __nccwpck_require__(82210); + model.paginators = (__nccwpck_require__(61488)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaStoreData; +module.exports = AWS.LakeFormation; /***/ }), -/***/ 99658: +/***/ 13321: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13226,24 +13145,35 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mediatailor'] = {}; -AWS.MediaTailor = Service.defineService('mediatailor', ['2018-04-23']); -Object.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', { +apiLoader.services['lambda'] = {}; +AWS.Lambda = Service.defineService('lambda', ['2014-11-11', '2015-03-31']); +__nccwpck_require__(8452); +Object.defineProperty(apiLoader.services['lambda'], '2014-11-11', { get: function get() { - var model = __nccwpck_require__(77511); - model.paginators = (__nccwpck_require__(68557)/* .pagination */ .o); + var model = __nccwpck_require__(91251); + model.paginators = (__nccwpck_require__(79210)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['lambda'], '2015-03-31', { + get: function get() { + var model = __nccwpck_require__(29103); + model.paginators = (__nccwpck_require__(32057)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(40626)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MediaTailor; +module.exports = AWS.Lambda; /***/ }), -/***/ 79712: +/***/ 71060: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13251,25 +13181,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['medicalimaging'] = {}; -AWS.MedicalImaging = Service.defineService('medicalimaging', ['2023-07-19']); -Object.defineProperty(apiLoader.services['medicalimaging'], '2023-07-19', { +apiLoader.services['launchwizard'] = {}; +AWS.LaunchWizard = Service.defineService('launchwizard', ['2018-05-10']); +Object.defineProperty(apiLoader.services['launchwizard'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(46663); - model.paginators = (__nccwpck_require__(63177)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(63171)/* .waiters */ .V); + var model = __nccwpck_require__(67108); + model.paginators = (__nccwpck_require__(50601)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MedicalImaging; +module.exports = AWS.LaunchWizard; /***/ }), -/***/ 50782: +/***/ 37397: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13277,24 +13206,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['memorydb'] = {}; -AWS.MemoryDB = Service.defineService('memorydb', ['2021-01-01']); -Object.defineProperty(apiLoader.services['memorydb'], '2021-01-01', { +apiLoader.services['lexmodelbuildingservice'] = {}; +AWS.LexModelBuildingService = Service.defineService('lexmodelbuildingservice', ['2017-04-19']); +Object.defineProperty(apiLoader.services['lexmodelbuildingservice'], '2017-04-19', { get: function get() { - var model = __nccwpck_require__(51950); - model.paginators = (__nccwpck_require__(93809)/* .pagination */ .o); + var model = __nccwpck_require__(96327); + model.paginators = (__nccwpck_require__(12348)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MemoryDB; +module.exports = AWS.LexModelBuildingService; /***/ }), -/***/ 41339: +/***/ 27254: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13302,24 +13231,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mgn'] = {}; -AWS.Mgn = Service.defineService('mgn', ['2020-02-26']); -Object.defineProperty(apiLoader.services['mgn'], '2020-02-26', { +apiLoader.services['lexmodelsv2'] = {}; +AWS.LexModelsV2 = Service.defineService('lexmodelsv2', ['2020-08-07']); +Object.defineProperty(apiLoader.services['lexmodelsv2'], '2020-08-07', { get: function get() { - var model = __nccwpck_require__(65811); - model.paginators = (__nccwpck_require__(52443)/* .pagination */ .o); + var model = __nccwpck_require__(98781); + model.paginators = (__nccwpck_require__(49461)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(55520)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Mgn; +module.exports = AWS.LexModelsV2; /***/ }), -/***/ 14688: +/***/ 62716: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13327,24 +13257,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['migrationhub'] = {}; -AWS.MigrationHub = Service.defineService('migrationhub', ['2017-05-31']); -Object.defineProperty(apiLoader.services['migrationhub'], '2017-05-31', { +apiLoader.services['lexruntime'] = {}; +AWS.LexRuntime = Service.defineService('lexruntime', ['2016-11-28']); +Object.defineProperty(apiLoader.services['lexruntime'], '2016-11-28', { get: function get() { - var model = __nccwpck_require__(99161); - model.paginators = (__nccwpck_require__(27903)/* .pagination */ .o); + var model = __nccwpck_require__(11059); + model.paginators = (__nccwpck_require__(97715)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MigrationHub; +module.exports = AWS.LexRuntime; /***/ }), -/***/ 62658: +/***/ 33855: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13352,24 +13282,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['migrationhubconfig'] = {}; -AWS.MigrationHubConfig = Service.defineService('migrationhubconfig', ['2019-06-30']); -Object.defineProperty(apiLoader.services['migrationhubconfig'], '2019-06-30', { +apiLoader.services['lexruntimev2'] = {}; +AWS.LexRuntimeV2 = Service.defineService('lexruntimev2', ['2020-08-07']); +Object.defineProperty(apiLoader.services['lexruntimev2'], '2020-08-07', { get: function get() { - var model = __nccwpck_require__(59734); - model.paginators = (__nccwpck_require__(51497)/* .pagination */ .o); + var model = __nccwpck_require__(17908); + model.paginators = (__nccwpck_require__(469)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MigrationHubConfig; +module.exports = AWS.LexRuntimeV2; /***/ }), -/***/ 66120: +/***/ 34693: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13377,25 +13307,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['migrationhuborchestrator'] = {}; -AWS.MigrationHubOrchestrator = Service.defineService('migrationhuborchestrator', ['2021-08-28']); -Object.defineProperty(apiLoader.services['migrationhuborchestrator'], '2021-08-28', { +apiLoader.services['licensemanager'] = {}; +AWS.LicenseManager = Service.defineService('licensemanager', ['2018-08-01']); +Object.defineProperty(apiLoader.services['licensemanager'], '2018-08-01', { get: function get() { - var model = __nccwpck_require__(73093); - model.paginators = (__nccwpck_require__(24233)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(83173)/* .waiters */ .V); + var model = __nccwpck_require__(19160); + model.paginators = (__nccwpck_require__(77552)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MigrationHubOrchestrator; +module.exports = AWS.LicenseManager; /***/ }), -/***/ 2925: +/***/ 52687: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13403,24 +13332,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['migrationhubrefactorspaces'] = {}; -AWS.MigrationHubRefactorSpaces = Service.defineService('migrationhubrefactorspaces', ['2021-10-26']); -Object.defineProperty(apiLoader.services['migrationhubrefactorspaces'], '2021-10-26', { +apiLoader.services['licensemanagerlinuxsubscriptions'] = {}; +AWS.LicenseManagerLinuxSubscriptions = Service.defineService('licensemanagerlinuxsubscriptions', ['2018-05-10']); +Object.defineProperty(apiLoader.services['licensemanagerlinuxsubscriptions'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(17110); - model.paginators = (__nccwpck_require__(63789)/* .pagination */ .o); + var model = __nccwpck_require__(94260); + model.paginators = (__nccwpck_require__(60467)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MigrationHubRefactorSpaces; +module.exports = AWS.LicenseManagerLinuxSubscriptions; /***/ }), -/***/ 96533: +/***/ 37725: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13428,24 +13357,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['migrationhubstrategy'] = {}; -AWS.MigrationHubStrategy = Service.defineService('migrationhubstrategy', ['2020-02-19']); -Object.defineProperty(apiLoader.services['migrationhubstrategy'], '2020-02-19', { +apiLoader.services['licensemanagerusersubscriptions'] = {}; +AWS.LicenseManagerUserSubscriptions = Service.defineService('licensemanagerusersubscriptions', ['2018-05-10']); +Object.defineProperty(apiLoader.services['licensemanagerusersubscriptions'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(64663); - model.paginators = (__nccwpck_require__(30896)/* .pagination */ .o); + var model = __nccwpck_require__(48338); + model.paginators = (__nccwpck_require__(84416)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MigrationHubStrategy; +module.exports = AWS.LicenseManagerUserSubscriptions; /***/ }), -/***/ 39782: +/***/ 22718: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13453,24 +13382,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mobile'] = {}; -AWS.Mobile = Service.defineService('mobile', ['2017-07-01']); -Object.defineProperty(apiLoader.services['mobile'], '2017-07-01', { +apiLoader.services['lightsail'] = {}; +AWS.Lightsail = Service.defineService('lightsail', ['2016-11-28']); +Object.defineProperty(apiLoader.services['lightsail'], '2016-11-28', { get: function get() { - var model = __nccwpck_require__(51691); - model.paginators = (__nccwpck_require__(43522)/* .pagination */ .o); + var model = __nccwpck_require__(94784); + model.paginators = (__nccwpck_require__(17528)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Mobile; +module.exports = AWS.Lightsail; /***/ }), -/***/ 66690: +/***/ 44594: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13478,23 +13407,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mobileanalytics'] = {}; -AWS.MobileAnalytics = Service.defineService('mobileanalytics', ['2014-06-05']); -Object.defineProperty(apiLoader.services['mobileanalytics'], '2014-06-05', { +apiLoader.services['location'] = {}; +AWS.Location = Service.defineService('location', ['2020-11-19']); +Object.defineProperty(apiLoader.services['location'], '2020-11-19', { get: function get() { - var model = __nccwpck_require__(90338); + var model = __nccwpck_require__(79257); + model.paginators = (__nccwpck_require__(53350)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MobileAnalytics; +module.exports = AWS.Location; /***/ }), -/***/ 23093: +/***/ 21843: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13502,24 +13432,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mq'] = {}; -AWS.MQ = Service.defineService('mq', ['2017-11-27']); -Object.defineProperty(apiLoader.services['mq'], '2017-11-27', { +apiLoader.services['lookoutequipment'] = {}; +AWS.LookoutEquipment = Service.defineService('lookoutequipment', ['2020-12-15']); +Object.defineProperty(apiLoader.services['lookoutequipment'], '2020-12-15', { get: function get() { - var model = __nccwpck_require__(35102); - model.paginators = (__nccwpck_require__(46095)/* .pagination */ .o); + var model = __nccwpck_require__(50969); + model.paginators = (__nccwpck_require__(92858)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MQ; +module.exports = AWS.LookoutEquipment; /***/ }), -/***/ 79954: +/***/ 78708: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13527,24 +13457,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mturk'] = {}; -AWS.MTurk = Service.defineService('mturk', ['2017-01-17']); -Object.defineProperty(apiLoader.services['mturk'], '2017-01-17', { +apiLoader.services['lookoutmetrics'] = {}; +AWS.LookoutMetrics = Service.defineService('lookoutmetrics', ['2017-07-25']); +Object.defineProperty(apiLoader.services['lookoutmetrics'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(73064); - model.paginators = (__nccwpck_require__(42409)/* .pagination */ .o); + var model = __nccwpck_require__(37749); + model.paginators = (__nccwpck_require__(13366)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MTurk; +module.exports = AWS.LookoutMetrics; /***/ }), -/***/ 32712: +/***/ 65046: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13552,24 +13482,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['mwaa'] = {}; -AWS.MWAA = Service.defineService('mwaa', ['2020-07-01']); -Object.defineProperty(apiLoader.services['mwaa'], '2020-07-01', { +apiLoader.services['lookoutvision'] = {}; +AWS.LookoutVision = Service.defineService('lookoutvision', ['2020-11-20']); +Object.defineProperty(apiLoader.services['lookoutvision'], '2020-11-20', { get: function get() { - var model = __nccwpck_require__(56612); - model.paginators = (__nccwpck_require__(11793)/* .pagination */ .o); + var model = __nccwpck_require__(15110); + model.paginators = (__nccwpck_require__(45644)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.MWAA; +module.exports = AWS.LookoutVision; /***/ }), -/***/ 30047: +/***/ 22482: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13577,26 +13507,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['neptune'] = {}; -AWS.Neptune = Service.defineService('neptune', ['2014-10-31']); -__nccwpck_require__(73090); -Object.defineProperty(apiLoader.services['neptune'], '2014-10-31', { +apiLoader.services['m2'] = {}; +AWS.M2 = Service.defineService('m2', ['2021-04-28']); +Object.defineProperty(apiLoader.services['m2'], '2021-04-28', { get: function get() { - var model = __nccwpck_require__(50018); - model.paginators = (__nccwpck_require__(62952)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(8127)/* .waiters */ .V); + var model = __nccwpck_require__(21363); + model.paginators = (__nccwpck_require__(96286)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Neptune; +module.exports = AWS.M2; /***/ }), -/***/ 25737: +/***/ 82907: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13604,24 +13532,26 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['neptunedata'] = {}; -AWS.Neptunedata = Service.defineService('neptunedata', ['2023-08-01']); -Object.defineProperty(apiLoader.services['neptunedata'], '2023-08-01', { +apiLoader.services['machinelearning'] = {}; +AWS.MachineLearning = Service.defineService('machinelearning', ['2014-12-12']); +__nccwpck_require__(19174); +Object.defineProperty(apiLoader.services['machinelearning'], '2014-12-12', { get: function get() { - var model = __nccwpck_require__(31008); - model.paginators = (__nccwpck_require__(2363)/* .pagination */ .o); + var model = __nccwpck_require__(4069); + model.paginators = (__nccwpck_require__(95535)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(23194)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Neptunedata; +module.exports = AWS.MachineLearning; /***/ }), -/***/ 77598: +/***/ 57330: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13629,26 +13559,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['neptunegraph'] = {}; -AWS.NeptuneGraph = Service.defineService('neptunegraph', ['2023-11-29']); -__nccwpck_require__(71963); -Object.defineProperty(apiLoader.services['neptunegraph'], '2023-11-29', { +apiLoader.services['macie2'] = {}; +AWS.Macie2 = Service.defineService('macie2', ['2020-01-01']); +Object.defineProperty(apiLoader.services['macie2'], '2020-01-01', { get: function get() { - var model = __nccwpck_require__(19121); - model.paginators = (__nccwpck_require__(85871)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(91832)/* .waiters */ .V); + var model = __nccwpck_require__(50847); + model.paginators = (__nccwpck_require__(25947)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(71131)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.NeptuneGraph; +module.exports = AWS.Macie2; /***/ }), -/***/ 84626: +/***/ 46253: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13656,24 +13585,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['networkfirewall'] = {}; -AWS.NetworkFirewall = Service.defineService('networkfirewall', ['2020-11-12']); -Object.defineProperty(apiLoader.services['networkfirewall'], '2020-11-12', { +apiLoader.services['mailmanager'] = {}; +AWS.MailManager = Service.defineService('mailmanager', ['2023-10-17']); +Object.defineProperty(apiLoader.services['mailmanager'], '2023-10-17', { get: function get() { - var model = __nccwpck_require__(63757); - model.paginators = (__nccwpck_require__(74798)/* .pagination */ .o); + var model = __nccwpck_require__(69303); + model.paginators = (__nccwpck_require__(14795)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.NetworkFirewall; +module.exports = AWS.MailManager; /***/ }), -/***/ 37610: +/***/ 85143: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13681,24 +13610,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['networkmanager'] = {}; -AWS.NetworkManager = Service.defineService('networkmanager', ['2019-07-05']); -Object.defineProperty(apiLoader.services['networkmanager'], '2019-07-05', { +apiLoader.services['managedblockchain'] = {}; +AWS.ManagedBlockchain = Service.defineService('managedblockchain', ['2018-09-24']); +Object.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', { get: function get() { - var model = __nccwpck_require__(10151); - model.paginators = (__nccwpck_require__(68278)/* .pagination */ .o); + var model = __nccwpck_require__(31229); + model.paginators = (__nccwpck_require__(57358)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.NetworkManager; +module.exports = AWS.ManagedBlockchain; /***/ }), -/***/ 77614: +/***/ 51046: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13706,25 +13635,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['networkmonitor'] = {}; -AWS.NetworkMonitor = Service.defineService('networkmonitor', ['2023-08-01']); -Object.defineProperty(apiLoader.services['networkmonitor'], '2023-08-01', { +apiLoader.services['managedblockchainquery'] = {}; +AWS.ManagedBlockchainQuery = Service.defineService('managedblockchainquery', ['2023-05-04']); +Object.defineProperty(apiLoader.services['managedblockchainquery'], '2023-05-04', { get: function get() { - var model = __nccwpck_require__(37278); - model.paginators = (__nccwpck_require__(76488)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(61551)/* .waiters */ .V); + var model = __nccwpck_require__(53546); + model.paginators = (__nccwpck_require__(95929)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(17688)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.NetworkMonitor; +module.exports = AWS.ManagedBlockchainQuery; /***/ }), -/***/ 89428: +/***/ 50379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13732,25 +13661,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['nimble'] = {}; -AWS.Nimble = Service.defineService('nimble', ['2020-08-01']); -Object.defineProperty(apiLoader.services['nimble'], '2020-08-01', { +apiLoader.services['marketplaceagreement'] = {}; +AWS.MarketplaceAgreement = Service.defineService('marketplaceagreement', ['2020-03-01']); +Object.defineProperty(apiLoader.services['marketplaceagreement'], '2020-03-01', { get: function get() { - var model = __nccwpck_require__(50605); - model.paginators = (__nccwpck_require__(65300)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(42486)/* .waiters */ .V); + var model = __nccwpck_require__(35188); + model.paginators = (__nccwpck_require__(99220)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Nimble; +module.exports = AWS.MarketplaceAgreement; /***/ }), -/***/ 9319: +/***/ 2609: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13758,24 +13686,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['oam'] = {}; -AWS.OAM = Service.defineService('oam', ['2022-06-10']); -Object.defineProperty(apiLoader.services['oam'], '2022-06-10', { +apiLoader.services['marketplacecatalog'] = {}; +AWS.MarketplaceCatalog = Service.defineService('marketplacecatalog', ['2018-09-17']); +Object.defineProperty(apiLoader.services['marketplacecatalog'], '2018-09-17', { get: function get() { - var model = __nccwpck_require__(13463); - model.paginators = (__nccwpck_require__(55717)/* .pagination */ .o); + var model = __nccwpck_require__(87122); + model.paginators = (__nccwpck_require__(30187)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.OAM; +module.exports = AWS.MarketplaceCatalog; /***/ }), -/***/ 75114: +/***/ 4540: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13783,25 +13711,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['omics'] = {}; -AWS.Omics = Service.defineService('omics', ['2022-11-28']); -Object.defineProperty(apiLoader.services['omics'], '2022-11-28', { +apiLoader.services['marketplacecommerceanalytics'] = {}; +AWS.MarketplaceCommerceAnalytics = Service.defineService('marketplacecommerceanalytics', ['2015-07-01']); +Object.defineProperty(apiLoader.services['marketplacecommerceanalytics'], '2015-07-01', { get: function get() { - var model = __nccwpck_require__(74258); - model.paginators = (__nccwpck_require__(78278)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(31165)/* .waiters */ .V); + var model = __nccwpck_require__(96696); + model.paginators = (__nccwpck_require__(43265)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Omics; +module.exports = AWS.MarketplaceCommerceAnalytics; /***/ }), -/***/ 60358: +/***/ 56811: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13809,24 +13736,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['opensearch'] = {}; -AWS.OpenSearch = Service.defineService('opensearch', ['2021-01-01']); -Object.defineProperty(apiLoader.services['opensearch'], '2021-01-01', { +apiLoader.services['marketplacedeployment'] = {}; +AWS.MarketplaceDeployment = Service.defineService('marketplacedeployment', ['2023-01-25']); +Object.defineProperty(apiLoader.services['marketplacedeployment'], '2023-01-25', { get: function get() { - var model = __nccwpck_require__(90583); - model.paginators = (__nccwpck_require__(32668)/* .pagination */ .o); + var model = __nccwpck_require__(9966); + model.paginators = (__nccwpck_require__(31372)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.OpenSearch; +module.exports = AWS.MarketplaceDeployment; /***/ }), -/***/ 86277: +/***/ 53707: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13834,24 +13761,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['opensearchserverless'] = {}; -AWS.OpenSearchServerless = Service.defineService('opensearchserverless', ['2021-11-01']); -Object.defineProperty(apiLoader.services['opensearchserverless'], '2021-11-01', { +apiLoader.services['marketplaceentitlementservice'] = {}; +AWS.MarketplaceEntitlementService = Service.defineService('marketplaceentitlementservice', ['2017-01-11']); +Object.defineProperty(apiLoader.services['marketplaceentitlementservice'], '2017-01-11', { get: function get() { - var model = __nccwpck_require__(61668); - model.paginators = (__nccwpck_require__(68785)/* .pagination */ .o); + var model = __nccwpck_require__(64253); + model.paginators = (__nccwpck_require__(67012)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.OpenSearchServerless; +module.exports = AWS.MarketplaceEntitlementService; /***/ }), -/***/ 75691: +/***/ 39297: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13859,25 +13786,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['opsworks'] = {}; -AWS.OpsWorks = Service.defineService('opsworks', ['2013-02-18']); -Object.defineProperty(apiLoader.services['opsworks'], '2013-02-18', { +apiLoader.services['marketplacemetering'] = {}; +AWS.MarketplaceMetering = Service.defineService('marketplacemetering', ['2016-01-14']); +Object.defineProperty(apiLoader.services['marketplacemetering'], '2016-01-14', { get: function get() { - var model = __nccwpck_require__(22805); - model.paginators = (__nccwpck_require__(24750)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(74961)/* .waiters */ .V); + var model = __nccwpck_require__(43027); + model.paginators = (__nccwpck_require__(4843)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.OpsWorks; +module.exports = AWS.MarketplaceMetering; /***/ }), -/***/ 80388: +/***/ 67639: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13885,25 +13811,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['opsworkscm'] = {}; -AWS.OpsWorksCM = Service.defineService('opsworkscm', ['2016-11-01']); -Object.defineProperty(apiLoader.services['opsworkscm'], '2016-11-01', { +apiLoader.services['mediaconnect'] = {}; +AWS.MediaConnect = Service.defineService('mediaconnect', ['2018-11-14']); +Object.defineProperty(apiLoader.services['mediaconnect'], '2018-11-14', { get: function get() { - var model = __nccwpck_require__(56705); - model.paginators = (__nccwpck_require__(49463)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(65003)/* .waiters */ .V); + var model = __nccwpck_require__(85245); + model.paginators = (__nccwpck_require__(68160)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(42876)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.OpsWorksCM; +module.exports = AWS.MediaConnect; /***/ }), -/***/ 52560: +/***/ 57220: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13911,24 +13837,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['organizations'] = {}; -AWS.Organizations = Service.defineService('organizations', ['2016-11-28']); -Object.defineProperty(apiLoader.services['organizations'], '2016-11-28', { +apiLoader.services['mediaconvert'] = {}; +AWS.MediaConvert = Service.defineService('mediaconvert', ['2017-08-29']); +Object.defineProperty(apiLoader.services['mediaconvert'], '2017-08-29', { get: function get() { - var model = __nccwpck_require__(58874); - model.paginators = (__nccwpck_require__(43261)/* .pagination */ .o); + var model = __nccwpck_require__(41924); + model.paginators = (__nccwpck_require__(14179)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Organizations; +module.exports = AWS.MediaConvert; /***/ }), -/***/ 98021: +/***/ 7509: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13936,24 +13862,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['osis'] = {}; -AWS.OSIS = Service.defineService('osis', ['2022-01-01']); -Object.defineProperty(apiLoader.services['osis'], '2022-01-01', { +apiLoader.services['medialive'] = {}; +AWS.MediaLive = Service.defineService('medialive', ['2017-10-14']); +Object.defineProperty(apiLoader.services['medialive'], '2017-10-14', { get: function get() { - var model = __nccwpck_require__(51838); - model.paginators = (__nccwpck_require__(72472)/* .pagination */ .o); + var model = __nccwpck_require__(32326); + model.paginators = (__nccwpck_require__(84652)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(17259)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.OSIS; +module.exports = AWS.MediaLive; /***/ }), -/***/ 27551: +/***/ 91620: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13961,24 +13888,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['outposts'] = {}; -AWS.Outposts = Service.defineService('outposts', ['2019-12-03']); -Object.defineProperty(apiLoader.services['outposts'], '2019-12-03', { +apiLoader.services['mediapackage'] = {}; +AWS.MediaPackage = Service.defineService('mediapackage', ['2017-10-12']); +Object.defineProperty(apiLoader.services['mediapackage'], '2017-10-12', { get: function get() { - var model = __nccwpck_require__(4807); - model.paginators = (__nccwpck_require__(3364)/* .pagination */ .o); + var model = __nccwpck_require__(51261); + model.paginators = (__nccwpck_require__(48933)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Outposts; +module.exports = AWS.MediaPackage; /***/ }), -/***/ 20368: +/***/ 53264: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -13986,24 +13913,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['panorama'] = {}; -AWS.Panorama = Service.defineService('panorama', ['2019-07-24']); -Object.defineProperty(apiLoader.services['panorama'], '2019-07-24', { +apiLoader.services['mediapackagev2'] = {}; +AWS.MediaPackageV2 = Service.defineService('mediapackagev2', ['2022-12-25']); +Object.defineProperty(apiLoader.services['mediapackagev2'], '2022-12-25', { get: function get() { - var model = __nccwpck_require__(91489); - model.paginators = (__nccwpck_require__(77238)/* .pagination */ .o); + var model = __nccwpck_require__(37594); + model.paginators = (__nccwpck_require__(44503)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(68906)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Panorama; +module.exports = AWS.MediaPackageV2; /***/ }), -/***/ 11594: +/***/ 14962: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14011,24 +13939,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['paymentcryptography'] = {}; -AWS.PaymentCryptography = Service.defineService('paymentcryptography', ['2021-09-14']); -Object.defineProperty(apiLoader.services['paymentcryptography'], '2021-09-14', { +apiLoader.services['mediapackagevod'] = {}; +AWS.MediaPackageVod = Service.defineService('mediapackagevod', ['2018-11-07']); +Object.defineProperty(apiLoader.services['mediapackagevod'], '2018-11-07', { get: function get() { - var model = __nccwpck_require__(86072); - model.paginators = (__nccwpck_require__(17819)/* .pagination */ .o); + var model = __nccwpck_require__(98877); + model.paginators = (__nccwpck_require__(48422)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PaymentCryptography; +module.exports = AWS.MediaPackageVod; /***/ }), -/***/ 96559: +/***/ 83748: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14036,24 +13964,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['paymentcryptographydata'] = {}; -AWS.PaymentCryptographyData = Service.defineService('paymentcryptographydata', ['2022-02-03']); -Object.defineProperty(apiLoader.services['paymentcryptographydata'], '2022-02-03', { +apiLoader.services['mediastore'] = {}; +AWS.MediaStore = Service.defineService('mediastore', ['2017-09-01']); +Object.defineProperty(apiLoader.services['mediastore'], '2017-09-01', { get: function get() { - var model = __nccwpck_require__(68578); - model.paginators = (__nccwpck_require__(89757)/* .pagination */ .o); + var model = __nccwpck_require__(68901); + model.paginators = (__nccwpck_require__(5848)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PaymentCryptographyData; +module.exports = AWS.MediaStore; /***/ }), -/***/ 55959: +/***/ 98703: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14061,24 +13989,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pcaconnectorad'] = {}; -AWS.PcaConnectorAd = Service.defineService('pcaconnectorad', ['2018-05-10']); -Object.defineProperty(apiLoader.services['pcaconnectorad'], '2018-05-10', { +apiLoader.services['mediastoredata'] = {}; +AWS.MediaStoreData = Service.defineService('mediastoredata', ['2017-09-01']); +Object.defineProperty(apiLoader.services['mediastoredata'], '2017-09-01', { get: function get() { - var model = __nccwpck_require__(6901); - model.paginators = (__nccwpck_require__(33158)/* .pagination */ .o); + var model = __nccwpck_require__(55081); + model.paginators = (__nccwpck_require__(97948)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PcaConnectorAd; +module.exports = AWS.MediaStoreData; /***/ }), -/***/ 33696: +/***/ 99658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14086,24 +14014,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['personalize'] = {}; -AWS.Personalize = Service.defineService('personalize', ['2018-05-22']); -Object.defineProperty(apiLoader.services['personalize'], '2018-05-22', { +apiLoader.services['mediatailor'] = {}; +AWS.MediaTailor = Service.defineService('mediatailor', ['2018-04-23']); +Object.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', { get: function get() { - var model = __nccwpck_require__(70169); - model.paginators = (__nccwpck_require__(64441)/* .pagination */ .o); + var model = __nccwpck_require__(77511); + model.paginators = (__nccwpck_require__(68557)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Personalize; +module.exports = AWS.MediaTailor; /***/ }), -/***/ 88170: +/***/ 79712: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14111,24 +14039,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['personalizeevents'] = {}; -AWS.PersonalizeEvents = Service.defineService('personalizeevents', ['2018-03-22']); -Object.defineProperty(apiLoader.services['personalizeevents'], '2018-03-22', { +apiLoader.services['medicalimaging'] = {}; +AWS.MedicalImaging = Service.defineService('medicalimaging', ['2023-07-19']); +Object.defineProperty(apiLoader.services['medicalimaging'], '2023-07-19', { get: function get() { - var model = __nccwpck_require__(3606); - model.paginators = (__nccwpck_require__(94507)/* .pagination */ .o); + var model = __nccwpck_require__(46663); + model.paginators = (__nccwpck_require__(63177)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(63171)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PersonalizeEvents; +module.exports = AWS.MedicalImaging; /***/ }), -/***/ 66184: +/***/ 50782: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14136,24 +14065,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['personalizeruntime'] = {}; -AWS.PersonalizeRuntime = Service.defineService('personalizeruntime', ['2018-05-22']); -Object.defineProperty(apiLoader.services['personalizeruntime'], '2018-05-22', { +apiLoader.services['memorydb'] = {}; +AWS.MemoryDB = Service.defineService('memorydb', ['2021-01-01']); +Object.defineProperty(apiLoader.services['memorydb'], '2021-01-01', { get: function get() { - var model = __nccwpck_require__(18824); - model.paginators = (__nccwpck_require__(8069)/* .pagination */ .o); + var model = __nccwpck_require__(51950); + model.paginators = (__nccwpck_require__(93809)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PersonalizeRuntime; +module.exports = AWS.MemoryDB; /***/ }), -/***/ 15505: +/***/ 41339: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14161,24 +14090,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pi'] = {}; -AWS.PI = Service.defineService('pi', ['2018-02-27']); -Object.defineProperty(apiLoader.services['pi'], '2018-02-27', { +apiLoader.services['mgn'] = {}; +AWS.Mgn = Service.defineService('mgn', ['2020-02-26']); +Object.defineProperty(apiLoader.services['mgn'], '2020-02-26', { get: function get() { - var model = __nccwpck_require__(18761); - model.paginators = (__nccwpck_require__(84882)/* .pagination */ .o); + var model = __nccwpck_require__(65811); + model.paginators = (__nccwpck_require__(52443)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PI; +module.exports = AWS.Mgn; /***/ }), -/***/ 18388: +/***/ 14688: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14186,23 +14115,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pinpoint'] = {}; -AWS.Pinpoint = Service.defineService('pinpoint', ['2016-12-01']); -Object.defineProperty(apiLoader.services['pinpoint'], '2016-12-01', { +apiLoader.services['migrationhub'] = {}; +AWS.MigrationHub = Service.defineService('migrationhub', ['2017-05-31']); +Object.defineProperty(apiLoader.services['migrationhub'], '2017-05-31', { get: function get() { - var model = __nccwpck_require__(40605); + var model = __nccwpck_require__(99161); + model.paginators = (__nccwpck_require__(27903)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Pinpoint; +module.exports = AWS.MigrationHub; /***/ }), -/***/ 83060: +/***/ 62658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14210,24 +14140,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pinpointemail'] = {}; -AWS.PinpointEmail = Service.defineService('pinpointemail', ['2018-07-26']); -Object.defineProperty(apiLoader.services['pinpointemail'], '2018-07-26', { +apiLoader.services['migrationhubconfig'] = {}; +AWS.MigrationHubConfig = Service.defineService('migrationhubconfig', ['2019-06-30']); +Object.defineProperty(apiLoader.services['migrationhubconfig'], '2019-06-30', { get: function get() { - var model = __nccwpck_require__(55228); - model.paginators = (__nccwpck_require__(45172)/* .pagination */ .o); + var model = __nccwpck_require__(59734); + model.paginators = (__nccwpck_require__(51497)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PinpointEmail; +module.exports = AWS.MigrationHubConfig; /***/ }), -/***/ 46605: +/***/ 66120: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14235,23 +14165,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pinpointsmsvoice'] = {}; -AWS.PinpointSMSVoice = Service.defineService('pinpointsmsvoice', ['2018-09-05']); -Object.defineProperty(apiLoader.services['pinpointsmsvoice'], '2018-09-05', { +apiLoader.services['migrationhuborchestrator'] = {}; +AWS.MigrationHubOrchestrator = Service.defineService('migrationhuborchestrator', ['2021-08-28']); +Object.defineProperty(apiLoader.services['migrationhuborchestrator'], '2021-08-28', { get: function get() { - var model = __nccwpck_require__(98689); + var model = __nccwpck_require__(73093); + model.paginators = (__nccwpck_require__(24233)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(83173)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PinpointSMSVoice; +module.exports = AWS.MigrationHubOrchestrator; /***/ }), -/***/ 478: +/***/ 2925: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14259,25 +14191,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pinpointsmsvoicev2'] = {}; -AWS.PinpointSMSVoiceV2 = Service.defineService('pinpointsmsvoicev2', ['2022-03-31']); -Object.defineProperty(apiLoader.services['pinpointsmsvoicev2'], '2022-03-31', { +apiLoader.services['migrationhubrefactorspaces'] = {}; +AWS.MigrationHubRefactorSpaces = Service.defineService('migrationhubrefactorspaces', ['2021-10-26']); +Object.defineProperty(apiLoader.services['migrationhubrefactorspaces'], '2021-10-26', { get: function get() { - var model = __nccwpck_require__(88319); - model.paginators = (__nccwpck_require__(80650)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(6663)/* .waiters */ .V); + var model = __nccwpck_require__(17110); + model.paginators = (__nccwpck_require__(63789)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PinpointSMSVoiceV2; +module.exports = AWS.MigrationHubRefactorSpaces; /***/ }), -/***/ 14220: +/***/ 96533: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14285,24 +14216,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pipes'] = {}; -AWS.Pipes = Service.defineService('pipes', ['2015-10-07']); -Object.defineProperty(apiLoader.services['pipes'], '2015-10-07', { +apiLoader.services['migrationhubstrategy'] = {}; +AWS.MigrationHubStrategy = Service.defineService('migrationhubstrategy', ['2020-02-19']); +Object.defineProperty(apiLoader.services['migrationhubstrategy'], '2020-02-19', { get: function get() { - var model = __nccwpck_require__(40616); - model.paginators = (__nccwpck_require__(17710)/* .pagination */ .o); + var model = __nccwpck_require__(64663); + model.paginators = (__nccwpck_require__(30896)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Pipes; +module.exports = AWS.MigrationHubStrategy; /***/ }), -/***/ 97332: +/***/ 66690: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14310,25 +14241,23 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['polly'] = {}; -AWS.Polly = Service.defineService('polly', ['2016-06-10']); -__nccwpck_require__(53199); -Object.defineProperty(apiLoader.services['polly'], '2016-06-10', { +apiLoader.services['mobileanalytics'] = {}; +AWS.MobileAnalytics = Service.defineService('mobileanalytics', ['2014-06-05']); +Object.defineProperty(apiLoader.services['mobileanalytics'], '2014-06-05', { get: function get() { - var model = __nccwpck_require__(55078); - model.paginators = (__nccwpck_require__(77060)/* .pagination */ .o); + var model = __nccwpck_require__(90338); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Polly; +module.exports = AWS.MobileAnalytics; /***/ }), -/***/ 92765: +/***/ 23093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14336,25 +14265,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['pricing'] = {}; -AWS.Pricing = Service.defineService('pricing', ['2017-10-15']); -Object.defineProperty(apiLoader.services['pricing'], '2017-10-15', { +apiLoader.services['mq'] = {}; +AWS.MQ = Service.defineService('mq', ['2017-11-27']); +Object.defineProperty(apiLoader.services['mq'], '2017-11-27', { get: function get() { - var model = __nccwpck_require__(22484); - model.paginators = (__nccwpck_require__(60369)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(41996)/* .waiters */ .V); + var model = __nccwpck_require__(35102); + model.paginators = (__nccwpck_require__(46095)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Pricing; +module.exports = AWS.MQ; /***/ }), -/***/ 63088: +/***/ 79954: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14362,24 +14290,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['privatenetworks'] = {}; -AWS.PrivateNetworks = Service.defineService('privatenetworks', ['2021-12-03']); -Object.defineProperty(apiLoader.services['privatenetworks'], '2021-12-03', { +apiLoader.services['mturk'] = {}; +AWS.MTurk = Service.defineService('mturk', ['2017-01-17']); +Object.defineProperty(apiLoader.services['mturk'], '2017-01-17', { get: function get() { - var model = __nccwpck_require__(46306); - model.paginators = (__nccwpck_require__(42771)/* .pagination */ .o); + var model = __nccwpck_require__(73064); + model.paginators = (__nccwpck_require__(42409)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.PrivateNetworks; +module.exports = AWS.MTurk; /***/ }), -/***/ 9275: +/***/ 32712: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14387,25 +14315,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['proton'] = {}; -AWS.Proton = Service.defineService('proton', ['2020-07-20']); -Object.defineProperty(apiLoader.services['proton'], '2020-07-20', { +apiLoader.services['mwaa'] = {}; +AWS.MWAA = Service.defineService('mwaa', ['2020-07-01']); +Object.defineProperty(apiLoader.services['mwaa'], '2020-07-01', { get: function get() { - var model = __nccwpck_require__(78577); - model.paginators = (__nccwpck_require__(14299)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(99338)/* .waiters */ .V); + var model = __nccwpck_require__(56612); + model.paginators = (__nccwpck_require__(11793)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Proton; +module.exports = AWS.MWAA; /***/ }), -/***/ 26842: +/***/ 30047: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14413,24 +14340,26 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['qbusiness'] = {}; -AWS.QBusiness = Service.defineService('qbusiness', ['2023-11-27']); -Object.defineProperty(apiLoader.services['qbusiness'], '2023-11-27', { +apiLoader.services['neptune'] = {}; +AWS.Neptune = Service.defineService('neptune', ['2014-10-31']); +__nccwpck_require__(73090); +Object.defineProperty(apiLoader.services['neptune'], '2014-10-31', { get: function get() { - var model = __nccwpck_require__(12388); - model.paginators = (__nccwpck_require__(51051)/* .pagination */ .o); + var model = __nccwpck_require__(50018); + model.paginators = (__nccwpck_require__(62952)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(8127)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.QBusiness; +module.exports = AWS.Neptune; /***/ }), -/***/ 39094: +/***/ 25737: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14438,24 +14367,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['qconnect'] = {}; -AWS.QConnect = Service.defineService('qconnect', ['2020-10-19']); -Object.defineProperty(apiLoader.services['qconnect'], '2020-10-19', { +apiLoader.services['neptunedata'] = {}; +AWS.Neptunedata = Service.defineService('neptunedata', ['2023-08-01']); +Object.defineProperty(apiLoader.services['neptunedata'], '2023-08-01', { get: function get() { - var model = __nccwpck_require__(72266); - model.paginators = (__nccwpck_require__(95945)/* .pagination */ .o); + var model = __nccwpck_require__(31008); + model.paginators = (__nccwpck_require__(2363)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.QConnect; +module.exports = AWS.Neptunedata; /***/ }), -/***/ 71266: +/***/ 84626: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14463,24 +14392,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['qldb'] = {}; -AWS.QLDB = Service.defineService('qldb', ['2019-01-02']); -Object.defineProperty(apiLoader.services['qldb'], '2019-01-02', { +apiLoader.services['networkfirewall'] = {}; +AWS.NetworkFirewall = Service.defineService('networkfirewall', ['2020-11-12']); +Object.defineProperty(apiLoader.services['networkfirewall'], '2020-11-12', { get: function get() { - var model = __nccwpck_require__(71346); - model.paginators = (__nccwpck_require__(34265)/* .pagination */ .o); + var model = __nccwpck_require__(63757); + model.paginators = (__nccwpck_require__(74798)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.QLDB; +module.exports = AWS.NetworkFirewall; /***/ }), -/***/ 55423: +/***/ 37610: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14488,24 +14417,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['qldbsession'] = {}; -AWS.QLDBSession = Service.defineService('qldbsession', ['2019-07-11']); -Object.defineProperty(apiLoader.services['qldbsession'], '2019-07-11', { +apiLoader.services['networkmanager'] = {}; +AWS.NetworkManager = Service.defineService('networkmanager', ['2019-07-05']); +Object.defineProperty(apiLoader.services['networkmanager'], '2019-07-05', { get: function get() { - var model = __nccwpck_require__(60040); - model.paginators = (__nccwpck_require__(61051)/* .pagination */ .o); + var model = __nccwpck_require__(10151); + model.paginators = (__nccwpck_require__(68278)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.QLDBSession; +module.exports = AWS.NetworkManager; /***/ }), -/***/ 29898: +/***/ 77614: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14513,24 +14442,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['quicksight'] = {}; -AWS.QuickSight = Service.defineService('quicksight', ['2018-04-01']); -Object.defineProperty(apiLoader.services['quicksight'], '2018-04-01', { +apiLoader.services['networkmonitor'] = {}; +AWS.NetworkMonitor = Service.defineService('networkmonitor', ['2023-08-01']); +Object.defineProperty(apiLoader.services['networkmonitor'], '2023-08-01', { get: function get() { - var model = __nccwpck_require__(8419); - model.paginators = (__nccwpck_require__(43387)/* .pagination */ .o); + var model = __nccwpck_require__(37278); + model.paginators = (__nccwpck_require__(76488)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(61551)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.QuickSight; +module.exports = AWS.NetworkMonitor; /***/ }), -/***/ 94394: +/***/ 89428: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14538,24 +14468,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ram'] = {}; -AWS.RAM = Service.defineService('ram', ['2018-01-04']); -Object.defineProperty(apiLoader.services['ram'], '2018-01-04', { +apiLoader.services['nimble'] = {}; +AWS.Nimble = Service.defineService('nimble', ['2020-08-01']); +Object.defineProperty(apiLoader.services['nimble'], '2020-08-01', { get: function get() { - var model = __nccwpck_require__(61375); - model.paginators = (__nccwpck_require__(85336)/* .pagination */ .o); + var model = __nccwpck_require__(50605); + model.paginators = (__nccwpck_require__(65300)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(42486)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RAM; +module.exports = AWS.Nimble; /***/ }), -/***/ 70145: +/***/ 9319: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14563,24 +14494,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['rbin'] = {}; -AWS.Rbin = Service.defineService('rbin', ['2021-06-15']); -Object.defineProperty(apiLoader.services['rbin'], '2021-06-15', { +apiLoader.services['oam'] = {}; +AWS.OAM = Service.defineService('oam', ['2022-06-10']); +Object.defineProperty(apiLoader.services['oam'], '2022-06-10', { get: function get() { - var model = __nccwpck_require__(18897); - model.paginators = (__nccwpck_require__(57601)/* .pagination */ .o); + var model = __nccwpck_require__(13463); + model.paginators = (__nccwpck_require__(55717)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Rbin; +module.exports = AWS.OAM; /***/ }), -/***/ 71578: +/***/ 75114: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14588,63 +14519,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['rds'] = {}; -AWS.RDS = Service.defineService('rds', ['2013-01-10', '2013-02-12', '2013-09-09', '2014-09-01', '2014-09-01*', '2014-10-31']); -__nccwpck_require__(71928); -Object.defineProperty(apiLoader.services['rds'], '2013-01-10', { - get: function get() { - var model = __nccwpck_require__(59989); - model.paginators = (__nccwpck_require__(978)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['rds'], '2013-02-12', { - get: function get() { - var model = __nccwpck_require__(55061); - model.paginators = (__nccwpck_require__(39581)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['rds'], '2013-09-09', { - get: function get() { - var model = __nccwpck_require__(36331); - model.paginators = (__nccwpck_require__(14485)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(36851)/* .waiters */ .V); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['rds'], '2014-09-01', { - get: function get() { - var model = __nccwpck_require__(19226); - model.paginators = (__nccwpck_require__(49863)/* .pagination */ .o); - return model; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(apiLoader.services['rds'], '2014-10-31', { +apiLoader.services['omics'] = {}; +AWS.Omics = Service.defineService('omics', ['2022-11-28']); +Object.defineProperty(apiLoader.services['omics'], '2022-11-28', { get: function get() { - var model = __nccwpck_require__(91916); - model.paginators = (__nccwpck_require__(85082)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(20371)/* .waiters */ .V); + var model = __nccwpck_require__(74258); + model.paginators = (__nccwpck_require__(78278)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(31165)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RDS; +module.exports = AWS.Omics; /***/ }), -/***/ 30147: +/***/ 60358: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14652,25 +14545,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['rdsdataservice'] = {}; -AWS.RDSDataService = Service.defineService('rdsdataservice', ['2018-08-01']); -__nccwpck_require__(64070); -Object.defineProperty(apiLoader.services['rdsdataservice'], '2018-08-01', { +apiLoader.services['opensearch'] = {}; +AWS.OpenSearch = Service.defineService('opensearch', ['2021-01-01']); +Object.defineProperty(apiLoader.services['opensearch'], '2021-01-01', { get: function get() { - var model = __nccwpck_require__(13559); - model.paginators = (__nccwpck_require__(41160)/* .pagination */ .o); + var model = __nccwpck_require__(90583); + model.paginators = (__nccwpck_require__(32668)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RDSDataService; +module.exports = AWS.OpenSearch; /***/ }), -/***/ 84853: +/***/ 86277: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14678,25 +14570,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['redshift'] = {}; -AWS.Redshift = Service.defineService('redshift', ['2012-12-01']); -Object.defineProperty(apiLoader.services['redshift'], '2012-12-01', { +apiLoader.services['opensearchserverless'] = {}; +AWS.OpenSearchServerless = Service.defineService('opensearchserverless', ['2021-11-01']); +Object.defineProperty(apiLoader.services['opensearchserverless'], '2021-11-01', { get: function get() { - var model = __nccwpck_require__(24827); - model.paginators = (__nccwpck_require__(88012)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(79011)/* .waiters */ .V); + var model = __nccwpck_require__(61668); + model.paginators = (__nccwpck_require__(68785)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Redshift; +module.exports = AWS.OpenSearchServerless; /***/ }), -/***/ 203: +/***/ 75691: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14704,24 +14595,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['redshiftdata'] = {}; -AWS.RedshiftData = Service.defineService('redshiftdata', ['2019-12-20']); -Object.defineProperty(apiLoader.services['redshiftdata'], '2019-12-20', { +apiLoader.services['opsworks'] = {}; +AWS.OpsWorks = Service.defineService('opsworks', ['2013-02-18']); +Object.defineProperty(apiLoader.services['opsworks'], '2013-02-18', { get: function get() { - var model = __nccwpck_require__(85203); - model.paginators = (__nccwpck_require__(27797)/* .pagination */ .o); + var model = __nccwpck_require__(22805); + model.paginators = (__nccwpck_require__(24750)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(74961)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RedshiftData; +module.exports = AWS.OpsWorks; /***/ }), -/***/ 29987: +/***/ 80388: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14729,24 +14621,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['redshiftserverless'] = {}; -AWS.RedshiftServerless = Service.defineService('redshiftserverless', ['2021-04-21']); -Object.defineProperty(apiLoader.services['redshiftserverless'], '2021-04-21', { +apiLoader.services['opsworkscm'] = {}; +AWS.OpsWorksCM = Service.defineService('opsworkscm', ['2016-11-01']); +Object.defineProperty(apiLoader.services['opsworkscm'], '2016-11-01', { get: function get() { - var model = __nccwpck_require__(95705); - model.paginators = (__nccwpck_require__(892)/* .pagination */ .o); + var model = __nccwpck_require__(56705); + model.paginators = (__nccwpck_require__(49463)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(65003)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RedshiftServerless; +module.exports = AWS.OpsWorksCM; /***/ }), -/***/ 65470: +/***/ 52560: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14754,25 +14647,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['rekognition'] = {}; -AWS.Rekognition = Service.defineService('rekognition', ['2016-06-27']); -Object.defineProperty(apiLoader.services['rekognition'], '2016-06-27', { +apiLoader.services['organizations'] = {}; +AWS.Organizations = Service.defineService('organizations', ['2016-11-28']); +Object.defineProperty(apiLoader.services['organizations'], '2016-11-28', { get: function get() { - var model = __nccwpck_require__(66442); - model.paginators = (__nccwpck_require__(37753)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(78910)/* .waiters */ .V); + var model = __nccwpck_require__(58874); + model.paginators = (__nccwpck_require__(43261)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Rekognition; +module.exports = AWS.Organizations; /***/ }), -/***/ 21154: +/***/ 98021: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14780,24 +14672,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['repostspace'] = {}; -AWS.Repostspace = Service.defineService('repostspace', ['2022-05-13']); -Object.defineProperty(apiLoader.services['repostspace'], '2022-05-13', { +apiLoader.services['osis'] = {}; +AWS.OSIS = Service.defineService('osis', ['2022-01-01']); +Object.defineProperty(apiLoader.services['osis'], '2022-01-01', { get: function get() { - var model = __nccwpck_require__(59766); - model.paginators = (__nccwpck_require__(10997)/* .pagination */ .o); + var model = __nccwpck_require__(51838); + model.paginators = (__nccwpck_require__(72472)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Repostspace; +module.exports = AWS.OSIS; /***/ }), -/***/ 21173: +/***/ 27551: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14805,24 +14697,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['resiliencehub'] = {}; -AWS.Resiliencehub = Service.defineService('resiliencehub', ['2020-04-30']); -Object.defineProperty(apiLoader.services['resiliencehub'], '2020-04-30', { +apiLoader.services['outposts'] = {}; +AWS.Outposts = Service.defineService('outposts', ['2019-12-03']); +Object.defineProperty(apiLoader.services['outposts'], '2019-12-03', { get: function get() { - var model = __nccwpck_require__(3885); - model.paginators = (__nccwpck_require__(38750)/* .pagination */ .o); + var model = __nccwpck_require__(4807); + model.paginators = (__nccwpck_require__(3364)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Resiliencehub; +module.exports = AWS.Outposts; /***/ }), -/***/ 74071: +/***/ 20368: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14830,24 +14722,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['resourceexplorer2'] = {}; -AWS.ResourceExplorer2 = Service.defineService('resourceexplorer2', ['2022-07-28']); -Object.defineProperty(apiLoader.services['resourceexplorer2'], '2022-07-28', { +apiLoader.services['panorama'] = {}; +AWS.Panorama = Service.defineService('panorama', ['2019-07-24']); +Object.defineProperty(apiLoader.services['panorama'], '2019-07-24', { get: function get() { - var model = __nccwpck_require__(26515); - model.paginators = (__nccwpck_require__(8580)/* .pagination */ .o); + var model = __nccwpck_require__(91489); + model.paginators = (__nccwpck_require__(77238)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ResourceExplorer2; +module.exports = AWS.Panorama; /***/ }), -/***/ 58756: +/***/ 11594: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14855,24 +14747,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['resourcegroups'] = {}; -AWS.ResourceGroups = Service.defineService('resourcegroups', ['2017-11-27']); -Object.defineProperty(apiLoader.services['resourcegroups'], '2017-11-27', { +apiLoader.services['paymentcryptography'] = {}; +AWS.PaymentCryptography = Service.defineService('paymentcryptography', ['2021-09-14']); +Object.defineProperty(apiLoader.services['paymentcryptography'], '2021-09-14', { get: function get() { - var model = __nccwpck_require__(73621); - model.paginators = (__nccwpck_require__(24085)/* .pagination */ .o); + var model = __nccwpck_require__(86072); + model.paginators = (__nccwpck_require__(17819)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(60238)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ResourceGroups; +module.exports = AWS.PaymentCryptography; /***/ }), -/***/ 7385: +/***/ 96559: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14880,24 +14773,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['resourcegroupstaggingapi'] = {}; -AWS.ResourceGroupsTaggingAPI = Service.defineService('resourcegroupstaggingapi', ['2017-01-26']); -Object.defineProperty(apiLoader.services['resourcegroupstaggingapi'], '2017-01-26', { +apiLoader.services['paymentcryptographydata'] = {}; +AWS.PaymentCryptographyData = Service.defineService('paymentcryptographydata', ['2022-02-03']); +Object.defineProperty(apiLoader.services['paymentcryptographydata'], '2022-02-03', { get: function get() { - var model = __nccwpck_require__(71720); - model.paginators = (__nccwpck_require__(36635)/* .pagination */ .o); + var model = __nccwpck_require__(68578); + model.paginators = (__nccwpck_require__(89757)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(48855)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ResourceGroupsTaggingAPI; +module.exports = AWS.PaymentCryptographyData; /***/ }), -/***/ 18068: +/***/ 55959: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14905,24 +14799,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['robomaker'] = {}; -AWS.RoboMaker = Service.defineService('robomaker', ['2018-06-29']); -Object.defineProperty(apiLoader.services['robomaker'], '2018-06-29', { +apiLoader.services['pcaconnectorad'] = {}; +AWS.PcaConnectorAd = Service.defineService('pcaconnectorad', ['2018-05-10']); +Object.defineProperty(apiLoader.services['pcaconnectorad'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(6904); - model.paginators = (__nccwpck_require__(43495)/* .pagination */ .o); + var model = __nccwpck_require__(6901); + model.paginators = (__nccwpck_require__(33158)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RoboMaker; +module.exports = AWS.PcaConnectorAd; /***/ }), -/***/ 83604: +/***/ 72523: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14930,24 +14824,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['rolesanywhere'] = {}; -AWS.RolesAnywhere = Service.defineService('rolesanywhere', ['2018-05-10']); -Object.defineProperty(apiLoader.services['rolesanywhere'], '2018-05-10', { +apiLoader.services['pcaconnectorscep'] = {}; +AWS.PcaConnectorScep = Service.defineService('pcaconnectorscep', ['2018-05-10']); +Object.defineProperty(apiLoader.services['pcaconnectorscep'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(80801); - model.paginators = (__nccwpck_require__(65955)/* .pagination */ .o); + var model = __nccwpck_require__(99967); + model.paginators = (__nccwpck_require__(82984)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(60372)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RolesAnywhere; +module.exports = AWS.PcaConnectorScep; /***/ }), -/***/ 44968: +/***/ 6301: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14955,26 +14850,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['route53'] = {}; -AWS.Route53 = Service.defineService('route53', ['2013-04-01']); -__nccwpck_require__(69627); -Object.defineProperty(apiLoader.services['route53'], '2013-04-01', { +apiLoader.services['pcs'] = {}; +AWS.PCS = Service.defineService('pcs', ['2023-02-10']); +Object.defineProperty(apiLoader.services['pcs'], '2023-02-10', { get: function get() { - var model = __nccwpck_require__(20959); - model.paginators = (__nccwpck_require__(46456)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(28347)/* .waiters */ .V); + var model = __nccwpck_require__(54950); + model.paginators = (__nccwpck_require__(66315)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(83363)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Route53; +module.exports = AWS.PCS; /***/ }), -/***/ 51994: +/***/ 33696: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -14982,24 +14876,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['route53domains'] = {}; -AWS.Route53Domains = Service.defineService('route53domains', ['2014-05-15']); -Object.defineProperty(apiLoader.services['route53domains'], '2014-05-15', { +apiLoader.services['personalize'] = {}; +AWS.Personalize = Service.defineService('personalize', ['2018-05-22']); +Object.defineProperty(apiLoader.services['personalize'], '2018-05-22', { get: function get() { - var model = __nccwpck_require__(57598); - model.paginators = (__nccwpck_require__(52189)/* .pagination */ .o); + var model = __nccwpck_require__(70169); + model.paginators = (__nccwpck_require__(64441)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Route53Domains; +module.exports = AWS.Personalize; /***/ }), -/***/ 35738: +/***/ 88170: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15007,24 +14901,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['route53recoverycluster'] = {}; -AWS.Route53RecoveryCluster = Service.defineService('route53recoverycluster', ['2019-12-02']); -Object.defineProperty(apiLoader.services['route53recoverycluster'], '2019-12-02', { +apiLoader.services['personalizeevents'] = {}; +AWS.PersonalizeEvents = Service.defineService('personalizeevents', ['2018-03-22']); +Object.defineProperty(apiLoader.services['personalizeevents'], '2018-03-22', { get: function get() { - var model = __nccwpck_require__(73989); - model.paginators = (__nccwpck_require__(69118)/* .pagination */ .o); + var model = __nccwpck_require__(3606); + model.paginators = (__nccwpck_require__(94507)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Route53RecoveryCluster; +module.exports = AWS.PersonalizeEvents; /***/ }), -/***/ 16063: +/***/ 66184: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15032,25 +14926,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['route53recoverycontrolconfig'] = {}; -AWS.Route53RecoveryControlConfig = Service.defineService('route53recoverycontrolconfig', ['2020-11-02']); -Object.defineProperty(apiLoader.services['route53recoverycontrolconfig'], '2020-11-02', { +apiLoader.services['personalizeruntime'] = {}; +AWS.PersonalizeRuntime = Service.defineService('personalizeruntime', ['2018-05-22']); +Object.defineProperty(apiLoader.services['personalizeruntime'], '2018-05-22', { get: function get() { - var model = __nccwpck_require__(38334); - model.paginators = (__nccwpck_require__(19728)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(57184)/* .waiters */ .V); + var model = __nccwpck_require__(18824); + model.paginators = (__nccwpck_require__(8069)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Route53RecoveryControlConfig; +module.exports = AWS.PersonalizeRuntime; /***/ }), -/***/ 79106: +/***/ 15505: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15058,24 +14951,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['route53recoveryreadiness'] = {}; -AWS.Route53RecoveryReadiness = Service.defineService('route53recoveryreadiness', ['2019-12-02']); -Object.defineProperty(apiLoader.services['route53recoveryreadiness'], '2019-12-02', { +apiLoader.services['pi'] = {}; +AWS.PI = Service.defineService('pi', ['2018-02-27']); +Object.defineProperty(apiLoader.services['pi'], '2018-02-27', { get: function get() { - var model = __nccwpck_require__(40156); - model.paginators = (__nccwpck_require__(96969)/* .pagination */ .o); + var model = __nccwpck_require__(18761); + model.paginators = (__nccwpck_require__(84882)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Route53RecoveryReadiness; +module.exports = AWS.PI; /***/ }), -/***/ 25894: +/***/ 18388: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15083,24 +14976,23 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['route53resolver'] = {}; -AWS.Route53Resolver = Service.defineService('route53resolver', ['2018-04-01']); -Object.defineProperty(apiLoader.services['route53resolver'], '2018-04-01', { +apiLoader.services['pinpoint'] = {}; +AWS.Pinpoint = Service.defineService('pinpoint', ['2016-12-01']); +Object.defineProperty(apiLoader.services['pinpoint'], '2016-12-01', { get: function get() { - var model = __nccwpck_require__(89229); - model.paginators = (__nccwpck_require__(95050)/* .pagination */ .o); + var model = __nccwpck_require__(40605); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Route53Resolver; +module.exports = AWS.Pinpoint; /***/ }), -/***/ 53237: +/***/ 83060: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15108,24 +15000,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['rum'] = {}; -AWS.RUM = Service.defineService('rum', ['2018-05-10']); -Object.defineProperty(apiLoader.services['rum'], '2018-05-10', { +apiLoader.services['pinpointemail'] = {}; +AWS.PinpointEmail = Service.defineService('pinpointemail', ['2018-07-26']); +Object.defineProperty(apiLoader.services['pinpointemail'], '2018-07-26', { get: function get() { - var model = __nccwpck_require__(84126); - model.paginators = (__nccwpck_require__(79432)/* .pagination */ .o); + var model = __nccwpck_require__(55228); + model.paginators = (__nccwpck_require__(45172)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.RUM; +module.exports = AWS.PinpointEmail; /***/ }), -/***/ 83256: +/***/ 46605: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15133,26 +15025,23 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['s3'] = {}; -AWS.S3 = Service.defineService('s3', ['2006-03-01']); -__nccwpck_require__(26543); -Object.defineProperty(apiLoader.services['s3'], '2006-03-01', { +apiLoader.services['pinpointsmsvoice'] = {}; +AWS.PinpointSMSVoice = Service.defineService('pinpointsmsvoice', ['2018-09-05']); +Object.defineProperty(apiLoader.services['pinpointsmsvoice'], '2018-09-05', { get: function get() { - var model = __nccwpck_require__(1129); - model.paginators = (__nccwpck_require__(7265)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(74048)/* .waiters */ .V); + var model = __nccwpck_require__(98689); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.S3; +module.exports = AWS.PinpointSMSVoice; /***/ }), -/***/ 99817: +/***/ 478: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15160,25 +15049,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['s3control'] = {}; -AWS.S3Control = Service.defineService('s3control', ['2018-08-20']); -__nccwpck_require__(71207); -Object.defineProperty(apiLoader.services['s3control'], '2018-08-20', { +apiLoader.services['pinpointsmsvoicev2'] = {}; +AWS.PinpointSMSVoiceV2 = Service.defineService('pinpointsmsvoicev2', ['2022-03-31']); +Object.defineProperty(apiLoader.services['pinpointsmsvoicev2'], '2022-03-31', { get: function get() { - var model = __nccwpck_require__(1201); - model.paginators = (__nccwpck_require__(55527)/* .pagination */ .o); + var model = __nccwpck_require__(88319); + model.paginators = (__nccwpck_require__(80650)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(6663)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.S3Control; +module.exports = AWS.PinpointSMSVoiceV2; /***/ }), -/***/ 90493: +/***/ 14220: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15186,24 +15075,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['s3outposts'] = {}; -AWS.S3Outposts = Service.defineService('s3outposts', ['2017-07-25']); -Object.defineProperty(apiLoader.services['s3outposts'], '2017-07-25', { +apiLoader.services['pipes'] = {}; +AWS.Pipes = Service.defineService('pipes', ['2015-10-07']); +Object.defineProperty(apiLoader.services['pipes'], '2015-10-07', { get: function get() { - var model = __nccwpck_require__(79971); - model.paginators = (__nccwpck_require__(32505)/* .pagination */ .o); + var model = __nccwpck_require__(40616); + model.paginators = (__nccwpck_require__(17710)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(95823)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.S3Outposts; +module.exports = AWS.Pipes; /***/ }), -/***/ 77657: +/***/ 97332: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15211,25 +15101,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sagemaker'] = {}; -AWS.SageMaker = Service.defineService('sagemaker', ['2017-07-24']); -Object.defineProperty(apiLoader.services['sagemaker'], '2017-07-24', { +apiLoader.services['polly'] = {}; +AWS.Polly = Service.defineService('polly', ['2016-06-10']); +__nccwpck_require__(53199); +Object.defineProperty(apiLoader.services['polly'], '2016-06-10', { get: function get() { - var model = __nccwpck_require__(71132); - model.paginators = (__nccwpck_require__(69254)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(80824)/* .waiters */ .V); + var model = __nccwpck_require__(55078); + model.paginators = (__nccwpck_require__(77060)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SageMaker; +module.exports = AWS.Polly; /***/ }), -/***/ 38966: +/***/ 92765: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15237,24 +15127,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sagemakeredge'] = {}; -AWS.SagemakerEdge = Service.defineService('sagemakeredge', ['2020-09-23']); -Object.defineProperty(apiLoader.services['sagemakeredge'], '2020-09-23', { +apiLoader.services['pricing'] = {}; +AWS.Pricing = Service.defineService('pricing', ['2017-10-15']); +Object.defineProperty(apiLoader.services['pricing'], '2017-10-15', { get: function get() { - var model = __nccwpck_require__(97093); - model.paginators = (__nccwpck_require__(71636)/* .pagination */ .o); + var model = __nccwpck_require__(22484); + model.paginators = (__nccwpck_require__(60369)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(41996)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SagemakerEdge; +module.exports = AWS.Pricing; /***/ }), -/***/ 67644: +/***/ 63088: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15262,24 +15153,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sagemakerfeaturestoreruntime'] = {}; -AWS.SageMakerFeatureStoreRuntime = Service.defineService('sagemakerfeaturestoreruntime', ['2020-07-01']); -Object.defineProperty(apiLoader.services['sagemakerfeaturestoreruntime'], '2020-07-01', { +apiLoader.services['privatenetworks'] = {}; +AWS.PrivateNetworks = Service.defineService('privatenetworks', ['2021-12-03']); +Object.defineProperty(apiLoader.services['privatenetworks'], '2021-12-03', { get: function get() { - var model = __nccwpck_require__(75546); - model.paginators = (__nccwpck_require__(12151)/* .pagination */ .o); + var model = __nccwpck_require__(46306); + model.paginators = (__nccwpck_require__(42771)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SageMakerFeatureStoreRuntime; +module.exports = AWS.PrivateNetworks; /***/ }), -/***/ 4707: +/***/ 9275: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15287,24 +15178,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sagemakergeospatial'] = {}; -AWS.SageMakerGeospatial = Service.defineService('sagemakergeospatial', ['2020-05-27']); -Object.defineProperty(apiLoader.services['sagemakergeospatial'], '2020-05-27', { +apiLoader.services['proton'] = {}; +AWS.Proton = Service.defineService('proton', ['2020-07-20']); +Object.defineProperty(apiLoader.services['proton'], '2020-07-20', { get: function get() { - var model = __nccwpck_require__(26059); - model.paginators = (__nccwpck_require__(99606)/* .pagination */ .o); + var model = __nccwpck_require__(78577); + model.paginators = (__nccwpck_require__(14299)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(99338)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SageMakerGeospatial; +module.exports = AWS.Proton; /***/ }), -/***/ 28199: +/***/ 2725: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15312,24 +15204,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sagemakermetrics'] = {}; -AWS.SageMakerMetrics = Service.defineService('sagemakermetrics', ['2022-09-30']); -Object.defineProperty(apiLoader.services['sagemakermetrics'], '2022-09-30', { +apiLoader.services['qapps'] = {}; +AWS.QApps = Service.defineService('qapps', ['2023-11-27']); +Object.defineProperty(apiLoader.services['qapps'], '2023-11-27', { get: function get() { - var model = __nccwpck_require__(89834); - model.paginators = (__nccwpck_require__(80107)/* .pagination */ .o); + var model = __nccwpck_require__(41128); + model.paginators = (__nccwpck_require__(17220)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(87485)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SageMakerMetrics; +module.exports = AWS.QApps; /***/ }), -/***/ 85044: +/***/ 26842: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15337,24 +15230,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sagemakerruntime'] = {}; -AWS.SageMakerRuntime = Service.defineService('sagemakerruntime', ['2017-05-13']); -Object.defineProperty(apiLoader.services['sagemakerruntime'], '2017-05-13', { +apiLoader.services['qbusiness'] = {}; +AWS.QBusiness = Service.defineService('qbusiness', ['2023-11-27']); +Object.defineProperty(apiLoader.services['qbusiness'], '2023-11-27', { get: function get() { - var model = __nccwpck_require__(27032); - model.paginators = (__nccwpck_require__(7570)/* .pagination */ .o); + var model = __nccwpck_require__(12388); + model.paginators = (__nccwpck_require__(51051)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(81994)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SageMakerRuntime; +module.exports = AWS.QBusiness; /***/ }), -/***/ 62825: +/***/ 39094: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15362,24 +15256,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['savingsplans'] = {}; -AWS.SavingsPlans = Service.defineService('savingsplans', ['2019-06-28']); -Object.defineProperty(apiLoader.services['savingsplans'], '2019-06-28', { +apiLoader.services['qconnect'] = {}; +AWS.QConnect = Service.defineService('qconnect', ['2020-10-19']); +Object.defineProperty(apiLoader.services['qconnect'], '2020-10-19', { get: function get() { - var model = __nccwpck_require__(46879); - model.paginators = (__nccwpck_require__(78998)/* .pagination */ .o); + var model = __nccwpck_require__(72266); + model.paginators = (__nccwpck_require__(95945)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SavingsPlans; +module.exports = AWS.QConnect; /***/ }), -/***/ 94840: +/***/ 71266: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15387,24 +15281,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['scheduler'] = {}; -AWS.Scheduler = Service.defineService('scheduler', ['2021-06-30']); -Object.defineProperty(apiLoader.services['scheduler'], '2021-06-30', { +apiLoader.services['qldb'] = {}; +AWS.QLDB = Service.defineService('qldb', ['2019-01-02']); +Object.defineProperty(apiLoader.services['qldb'], '2019-01-02', { get: function get() { - var model = __nccwpck_require__(36876); - model.paginators = (__nccwpck_require__(54594)/* .pagination */ .o); + var model = __nccwpck_require__(71346); + model.paginators = (__nccwpck_require__(34265)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Scheduler; +module.exports = AWS.QLDB; /***/ }), -/***/ 55713: +/***/ 55423: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15412,25 +15306,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['schemas'] = {}; -AWS.Schemas = Service.defineService('schemas', ['2019-12-02']); -Object.defineProperty(apiLoader.services['schemas'], '2019-12-02', { +apiLoader.services['qldbsession'] = {}; +AWS.QLDBSession = Service.defineService('qldbsession', ['2019-07-11']); +Object.defineProperty(apiLoader.services['qldbsession'], '2019-07-11', { get: function get() { - var model = __nccwpck_require__(76626); - model.paginators = (__nccwpck_require__(34227)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(62213)/* .waiters */ .V); + var model = __nccwpck_require__(60040); + model.paginators = (__nccwpck_require__(61051)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Schemas; +module.exports = AWS.QLDBSession; /***/ }), -/***/ 85131: +/***/ 29898: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15438,24 +15331,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['secretsmanager'] = {}; -AWS.SecretsManager = Service.defineService('secretsmanager', ['2017-10-17']); -Object.defineProperty(apiLoader.services['secretsmanager'], '2017-10-17', { +apiLoader.services['quicksight'] = {}; +AWS.QuickSight = Service.defineService('quicksight', ['2018-04-01']); +Object.defineProperty(apiLoader.services['quicksight'], '2018-04-01', { get: function get() { - var model = __nccwpck_require__(89470); - model.paginators = (__nccwpck_require__(25613)/* .pagination */ .o); + var model = __nccwpck_require__(8419); + model.paginators = (__nccwpck_require__(43387)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SecretsManager; +module.exports = AWS.QuickSight; /***/ }), -/***/ 21550: +/***/ 94394: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15463,24 +15356,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['securityhub'] = {}; -AWS.SecurityHub = Service.defineService('securityhub', ['2018-10-26']); -Object.defineProperty(apiLoader.services['securityhub'], '2018-10-26', { +apiLoader.services['ram'] = {}; +AWS.RAM = Service.defineService('ram', ['2018-01-04']); +Object.defineProperty(apiLoader.services['ram'], '2018-01-04', { get: function get() { - var model = __nccwpck_require__(29208); - model.paginators = (__nccwpck_require__(85595)/* .pagination */ .o); + var model = __nccwpck_require__(61375); + model.paginators = (__nccwpck_require__(85336)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SecurityHub; +module.exports = AWS.RAM; /***/ }), -/***/ 84296: +/***/ 70145: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15488,24 +15381,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['securitylake'] = {}; -AWS.SecurityLake = Service.defineService('securitylake', ['2018-05-10']); -Object.defineProperty(apiLoader.services['securitylake'], '2018-05-10', { +apiLoader.services['rbin'] = {}; +AWS.Rbin = Service.defineService('rbin', ['2021-06-15']); +Object.defineProperty(apiLoader.services['rbin'], '2021-06-15', { get: function get() { - var model = __nccwpck_require__(26935); - model.paginators = (__nccwpck_require__(42170)/* .pagination */ .o); + var model = __nccwpck_require__(18897); + model.paginators = (__nccwpck_require__(57601)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SecurityLake; +module.exports = AWS.Rbin; /***/ }), -/***/ 62402: +/***/ 71578: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15513,24 +15406,63 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['serverlessapplicationrepository'] = {}; -AWS.ServerlessApplicationRepository = Service.defineService('serverlessapplicationrepository', ['2017-09-08']); -Object.defineProperty(apiLoader.services['serverlessapplicationrepository'], '2017-09-08', { +apiLoader.services['rds'] = {}; +AWS.RDS = Service.defineService('rds', ['2013-01-10', '2013-02-12', '2013-09-09', '2014-09-01', '2014-09-01*', '2014-10-31']); +__nccwpck_require__(71928); +Object.defineProperty(apiLoader.services['rds'], '2013-01-10', { get: function get() { - var model = __nccwpck_require__(68422); - model.paginators = (__nccwpck_require__(34864)/* .pagination */ .o); + var model = __nccwpck_require__(59989); + model.paginators = (__nccwpck_require__(978)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['rds'], '2013-02-12', { + get: function get() { + var model = __nccwpck_require__(55061); + model.paginators = (__nccwpck_require__(39581)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['rds'], '2013-09-09', { + get: function get() { + var model = __nccwpck_require__(36331); + model.paginators = (__nccwpck_require__(14485)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(36851)/* .waiters */ .V); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['rds'], '2014-09-01', { + get: function get() { + var model = __nccwpck_require__(19226); + model.paginators = (__nccwpck_require__(49863)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); +Object.defineProperty(apiLoader.services['rds'], '2014-10-31', { + get: function get() { + var model = __nccwpck_require__(91916); + model.paginators = (__nccwpck_require__(85082)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(20371)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ServerlessApplicationRepository; +module.exports = AWS.RDS; /***/ }), -/***/ 822: +/***/ 30147: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15538,24 +15470,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['servicecatalog'] = {}; -AWS.ServiceCatalog = Service.defineService('servicecatalog', ['2015-12-10']); -Object.defineProperty(apiLoader.services['servicecatalog'], '2015-12-10', { +apiLoader.services['rdsdataservice'] = {}; +AWS.RDSDataService = Service.defineService('rdsdataservice', ['2018-08-01']); +__nccwpck_require__(64070); +Object.defineProperty(apiLoader.services['rdsdataservice'], '2018-08-01', { get: function get() { - var model = __nccwpck_require__(95500); - model.paginators = (__nccwpck_require__(21687)/* .pagination */ .o); + var model = __nccwpck_require__(13559); + model.paginators = (__nccwpck_require__(41160)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ServiceCatalog; +module.exports = AWS.RDSDataService; /***/ }), -/***/ 79068: +/***/ 84853: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15563,24 +15496,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['servicecatalogappregistry'] = {}; -AWS.ServiceCatalogAppRegistry = Service.defineService('servicecatalogappregistry', ['2020-06-24']); -Object.defineProperty(apiLoader.services['servicecatalogappregistry'], '2020-06-24', { +apiLoader.services['redshift'] = {}; +AWS.Redshift = Service.defineService('redshift', ['2012-12-01']); +Object.defineProperty(apiLoader.services['redshift'], '2012-12-01', { get: function get() { - var model = __nccwpck_require__(25697); - model.paginators = (__nccwpck_require__(28893)/* .pagination */ .o); + var model = __nccwpck_require__(24827); + model.paginators = (__nccwpck_require__(88012)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(79011)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ServiceCatalogAppRegistry; +module.exports = AWS.Redshift; /***/ }), -/***/ 91569: +/***/ 203: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15588,24 +15522,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['servicediscovery'] = {}; -AWS.ServiceDiscovery = Service.defineService('servicediscovery', ['2017-03-14']); -Object.defineProperty(apiLoader.services['servicediscovery'], '2017-03-14', { +apiLoader.services['redshiftdata'] = {}; +AWS.RedshiftData = Service.defineService('redshiftdata', ['2019-12-20']); +Object.defineProperty(apiLoader.services['redshiftdata'], '2019-12-20', { get: function get() { - var model = __nccwpck_require__(22361); - model.paginators = (__nccwpck_require__(37798)/* .pagination */ .o); + var model = __nccwpck_require__(85203); + model.paginators = (__nccwpck_require__(27797)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ServiceDiscovery; +module.exports = AWS.RedshiftData; /***/ }), -/***/ 57800: +/***/ 29987: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15613,24 +15547,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['servicequotas'] = {}; -AWS.ServiceQuotas = Service.defineService('servicequotas', ['2019-06-24']); -Object.defineProperty(apiLoader.services['servicequotas'], '2019-06-24', { +apiLoader.services['redshiftserverless'] = {}; +AWS.RedshiftServerless = Service.defineService('redshiftserverless', ['2021-04-21']); +Object.defineProperty(apiLoader.services['redshiftserverless'], '2021-04-21', { get: function get() { - var model = __nccwpck_require__(68850); - model.paginators = (__nccwpck_require__(63074)/* .pagination */ .o); + var model = __nccwpck_require__(95705); + model.paginators = (__nccwpck_require__(892)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.ServiceQuotas; +module.exports = AWS.RedshiftServerless; /***/ }), -/***/ 46816: +/***/ 65470: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15638,25 +15572,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ses'] = {}; -AWS.SES = Service.defineService('ses', ['2010-12-01']); -Object.defineProperty(apiLoader.services['ses'], '2010-12-01', { +apiLoader.services['rekognition'] = {}; +AWS.Rekognition = Service.defineService('rekognition', ['2016-06-27']); +Object.defineProperty(apiLoader.services['rekognition'], '2016-06-27', { get: function get() { - var model = __nccwpck_require__(56693); - model.paginators = (__nccwpck_require__(9399)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(98229)/* .waiters */ .V); + var model = __nccwpck_require__(66442); + model.paginators = (__nccwpck_require__(37753)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(78910)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SES; +module.exports = AWS.Rekognition; /***/ }), -/***/ 20142: +/***/ 21154: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15664,24 +15598,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sesv2'] = {}; -AWS.SESV2 = Service.defineService('sesv2', ['2019-09-27']); -Object.defineProperty(apiLoader.services['sesv2'], '2019-09-27', { +apiLoader.services['repostspace'] = {}; +AWS.Repostspace = Service.defineService('repostspace', ['2022-05-13']); +Object.defineProperty(apiLoader.services['repostspace'], '2022-05-13', { get: function get() { - var model = __nccwpck_require__(69754); - model.paginators = (__nccwpck_require__(72405)/* .pagination */ .o); + var model = __nccwpck_require__(59766); + model.paginators = (__nccwpck_require__(10997)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SESV2; +module.exports = AWS.Repostspace; /***/ }), -/***/ 20271: +/***/ 21173: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15689,24 +15623,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['shield'] = {}; -AWS.Shield = Service.defineService('shield', ['2016-06-02']); -Object.defineProperty(apiLoader.services['shield'], '2016-06-02', { +apiLoader.services['resiliencehub'] = {}; +AWS.Resiliencehub = Service.defineService('resiliencehub', ['2020-04-30']); +Object.defineProperty(apiLoader.services['resiliencehub'], '2020-04-30', { get: function get() { - var model = __nccwpck_require__(47061); - model.paginators = (__nccwpck_require__(54893)/* .pagination */ .o); + var model = __nccwpck_require__(3885); + model.paginators = (__nccwpck_require__(38750)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Shield; +module.exports = AWS.Resiliencehub; /***/ }), -/***/ 71596: +/***/ 74071: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15714,25 +15648,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['signer'] = {}; -AWS.Signer = Service.defineService('signer', ['2017-08-25']); -Object.defineProperty(apiLoader.services['signer'], '2017-08-25', { +apiLoader.services['resourceexplorer2'] = {}; +AWS.ResourceExplorer2 = Service.defineService('resourceexplorer2', ['2022-07-28']); +Object.defineProperty(apiLoader.services['resourceexplorer2'], '2022-07-28', { get: function get() { - var model = __nccwpck_require__(97116); - model.paginators = (__nccwpck_require__(81027)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(48215)/* .waiters */ .V); + var model = __nccwpck_require__(26515); + model.paginators = (__nccwpck_require__(8580)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Signer; +module.exports = AWS.ResourceExplorer2; /***/ }), -/***/ 10120: +/***/ 58756: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15740,24 +15673,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['simpledb'] = {}; -AWS.SimpleDB = Service.defineService('simpledb', ['2009-04-15']); -Object.defineProperty(apiLoader.services['simpledb'], '2009-04-15', { +apiLoader.services['resourcegroups'] = {}; +AWS.ResourceGroups = Service.defineService('resourcegroups', ['2017-11-27']); +Object.defineProperty(apiLoader.services['resourcegroups'], '2017-11-27', { get: function get() { - var model = __nccwpck_require__(45164); - model.paginators = (__nccwpck_require__(55255)/* .pagination */ .o); + var model = __nccwpck_require__(73621); + model.paginators = (__nccwpck_require__(24085)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SimpleDB; +module.exports = AWS.ResourceGroups; /***/ }), -/***/ 37090: +/***/ 7385: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15765,24 +15698,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['simspaceweaver'] = {}; -AWS.SimSpaceWeaver = Service.defineService('simspaceweaver', ['2022-10-28']); -Object.defineProperty(apiLoader.services['simspaceweaver'], '2022-10-28', { +apiLoader.services['resourcegroupstaggingapi'] = {}; +AWS.ResourceGroupsTaggingAPI = Service.defineService('resourcegroupstaggingapi', ['2017-01-26']); +Object.defineProperty(apiLoader.services['resourcegroupstaggingapi'], '2017-01-26', { get: function get() { - var model = __nccwpck_require__(92139); - model.paginators = (__nccwpck_require__(31849)/* .pagination */ .o); + var model = __nccwpck_require__(71720); + model.paginators = (__nccwpck_require__(36635)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SimSpaceWeaver; +module.exports = AWS.ResourceGroupsTaggingAPI; /***/ }), -/***/ 57719: +/***/ 18068: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15790,24 +15723,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sms'] = {}; -AWS.SMS = Service.defineService('sms', ['2016-10-24']); -Object.defineProperty(apiLoader.services['sms'], '2016-10-24', { +apiLoader.services['robomaker'] = {}; +AWS.RoboMaker = Service.defineService('robomaker', ['2018-06-29']); +Object.defineProperty(apiLoader.services['robomaker'], '2018-06-29', { get: function get() { - var model = __nccwpck_require__(26534); - model.paginators = (__nccwpck_require__(98730)/* .pagination */ .o); + var model = __nccwpck_require__(6904); + model.paginators = (__nccwpck_require__(43495)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SMS; +module.exports = AWS.RoboMaker; /***/ }), -/***/ 510: +/***/ 83604: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15815,24 +15748,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['snowball'] = {}; -AWS.Snowball = Service.defineService('snowball', ['2016-06-30']); -Object.defineProperty(apiLoader.services['snowball'], '2016-06-30', { +apiLoader.services['rolesanywhere'] = {}; +AWS.RolesAnywhere = Service.defineService('rolesanywhere', ['2018-05-10']); +Object.defineProperty(apiLoader.services['rolesanywhere'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(96822); - model.paginators = (__nccwpck_require__(45219)/* .pagination */ .o); + var model = __nccwpck_require__(80801); + model.paginators = (__nccwpck_require__(65955)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Snowball; +module.exports = AWS.RolesAnywhere; /***/ }), -/***/ 64655: +/***/ 44968: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15840,24 +15773,26 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['snowdevicemanagement'] = {}; -AWS.SnowDeviceManagement = Service.defineService('snowdevicemanagement', ['2021-08-04']); -Object.defineProperty(apiLoader.services['snowdevicemanagement'], '2021-08-04', { +apiLoader.services['route53'] = {}; +AWS.Route53 = Service.defineService('route53', ['2013-04-01']); +__nccwpck_require__(69627); +Object.defineProperty(apiLoader.services['route53'], '2013-04-01', { get: function get() { - var model = __nccwpck_require__(97413); - model.paginators = (__nccwpck_require__(70424)/* .pagination */ .o); + var model = __nccwpck_require__(20959); + model.paginators = (__nccwpck_require__(46456)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(28347)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SnowDeviceManagement; +module.exports = AWS.Route53; /***/ }), -/***/ 28581: +/***/ 51994: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15865,24 +15800,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sns'] = {}; -AWS.SNS = Service.defineService('sns', ['2010-03-31']); -Object.defineProperty(apiLoader.services['sns'], '2010-03-31', { +apiLoader.services['route53domains'] = {}; +AWS.Route53Domains = Service.defineService('route53domains', ['2014-05-15']); +Object.defineProperty(apiLoader.services['route53domains'], '2014-05-15', { get: function get() { - var model = __nccwpck_require__(64387); - model.paginators = (__nccwpck_require__(58054)/* .pagination */ .o); + var model = __nccwpck_require__(57598); + model.paginators = (__nccwpck_require__(52189)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SNS; +module.exports = AWS.Route53Domains; /***/ }), -/***/ 63172: +/***/ 13907: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15890,25 +15825,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sqs'] = {}; -AWS.SQS = Service.defineService('sqs', ['2012-11-05']); -__nccwpck_require__(94571); -Object.defineProperty(apiLoader.services['sqs'], '2012-11-05', { +apiLoader.services['route53profiles'] = {}; +AWS.Route53Profiles = Service.defineService('route53profiles', ['2018-05-10']); +Object.defineProperty(apiLoader.services['route53profiles'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(53974); - model.paginators = (__nccwpck_require__(17249)/* .pagination */ .o); + var model = __nccwpck_require__(38685); + model.paginators = (__nccwpck_require__(18297)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SQS; +module.exports = AWS.Route53Profiles; /***/ }), -/***/ 83380: +/***/ 35738: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15916,25 +15850,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ssm'] = {}; -AWS.SSM = Service.defineService('ssm', ['2014-11-06']); -Object.defineProperty(apiLoader.services['ssm'], '2014-11-06', { +apiLoader.services['route53recoverycluster'] = {}; +AWS.Route53RecoveryCluster = Service.defineService('route53recoverycluster', ['2019-12-02']); +Object.defineProperty(apiLoader.services['route53recoverycluster'], '2019-12-02', { get: function get() { - var model = __nccwpck_require__(44596); - model.paginators = (__nccwpck_require__(5135)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(98523)/* .waiters */ .V); + var model = __nccwpck_require__(73989); + model.paginators = (__nccwpck_require__(69118)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SSM; +module.exports = AWS.Route53RecoveryCluster; /***/ }), -/***/ 12577: +/***/ 16063: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15942,24 +15875,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ssmcontacts'] = {}; -AWS.SSMContacts = Service.defineService('ssmcontacts', ['2021-05-03']); -Object.defineProperty(apiLoader.services['ssmcontacts'], '2021-05-03', { +apiLoader.services['route53recoverycontrolconfig'] = {}; +AWS.Route53RecoveryControlConfig = Service.defineService('route53recoverycontrolconfig', ['2020-11-02']); +Object.defineProperty(apiLoader.services['route53recoverycontrolconfig'], '2020-11-02', { get: function get() { - var model = __nccwpck_require__(74831); - model.paginators = (__nccwpck_require__(63938)/* .pagination */ .o); + var model = __nccwpck_require__(38334); + model.paginators = (__nccwpck_require__(19728)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(57184)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SSMContacts; +module.exports = AWS.Route53RecoveryControlConfig; /***/ }), -/***/ 20590: +/***/ 79106: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15967,25 +15901,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ssmincidents'] = {}; -AWS.SSMIncidents = Service.defineService('ssmincidents', ['2018-05-10']); -Object.defineProperty(apiLoader.services['ssmincidents'], '2018-05-10', { +apiLoader.services['route53recoveryreadiness'] = {}; +AWS.Route53RecoveryReadiness = Service.defineService('route53recoveryreadiness', ['2019-12-02']); +Object.defineProperty(apiLoader.services['route53recoveryreadiness'], '2019-12-02', { get: function get() { - var model = __nccwpck_require__(18719); - model.paginators = (__nccwpck_require__(4502)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(97755)/* .waiters */ .V); + var model = __nccwpck_require__(40156); + model.paginators = (__nccwpck_require__(96969)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SSMIncidents; +module.exports = AWS.Route53RecoveryReadiness; /***/ }), -/***/ 44552: +/***/ 25894: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -15993,24 +15926,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ssmsap'] = {}; -AWS.SsmSap = Service.defineService('ssmsap', ['2018-05-10']); -Object.defineProperty(apiLoader.services['ssmsap'], '2018-05-10', { +apiLoader.services['route53resolver'] = {}; +AWS.Route53Resolver = Service.defineService('route53resolver', ['2018-04-01']); +Object.defineProperty(apiLoader.services['route53resolver'], '2018-04-01', { get: function get() { - var model = __nccwpck_require__(49218); - model.paginators = (__nccwpck_require__(94718)/* .pagination */ .o); + var model = __nccwpck_require__(89229); + model.paginators = (__nccwpck_require__(95050)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SsmSap; +module.exports = AWS.Route53Resolver; /***/ }), -/***/ 71096: +/***/ 53237: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16018,24 +15951,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sso'] = {}; -AWS.SSO = Service.defineService('sso', ['2019-06-10']); -Object.defineProperty(apiLoader.services['sso'], '2019-06-10', { +apiLoader.services['rum'] = {}; +AWS.RUM = Service.defineService('rum', ['2018-05-10']); +Object.defineProperty(apiLoader.services['rum'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(8027); - model.paginators = (__nccwpck_require__(36610)/* .pagination */ .o); + var model = __nccwpck_require__(84126); + model.paginators = (__nccwpck_require__(79432)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SSO; +module.exports = AWS.RUM; /***/ }), -/***/ 66644: +/***/ 83256: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16043,24 +15976,26 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ssoadmin'] = {}; -AWS.SSOAdmin = Service.defineService('ssoadmin', ['2020-07-20']); -Object.defineProperty(apiLoader.services['ssoadmin'], '2020-07-20', { +apiLoader.services['s3'] = {}; +AWS.S3 = Service.defineService('s3', ['2006-03-01']); +__nccwpck_require__(26543); +Object.defineProperty(apiLoader.services['s3'], '2006-03-01', { get: function get() { - var model = __nccwpck_require__(7239); - model.paginators = (__nccwpck_require__(49402)/* .pagination */ .o); + var model = __nccwpck_require__(1129); + model.paginators = (__nccwpck_require__(7265)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(74048)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SSOAdmin; +module.exports = AWS.S3; /***/ }), -/***/ 49870: +/***/ 99817: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16068,24 +16003,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['ssooidc'] = {}; -AWS.SSOOIDC = Service.defineService('ssooidc', ['2019-06-10']); -Object.defineProperty(apiLoader.services['ssooidc'], '2019-06-10', { +apiLoader.services['s3control'] = {}; +AWS.S3Control = Service.defineService('s3control', ['2018-08-20']); +__nccwpck_require__(71207); +Object.defineProperty(apiLoader.services['s3control'], '2018-08-20', { get: function get() { - var model = __nccwpck_require__(62343); - model.paginators = (__nccwpck_require__(50215)/* .pagination */ .o); + var model = __nccwpck_require__(1201); + model.paginators = (__nccwpck_require__(55527)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SSOOIDC; +module.exports = AWS.S3Control; /***/ }), -/***/ 8136: +/***/ 90493: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16093,24 +16029,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['stepfunctions'] = {}; -AWS.StepFunctions = Service.defineService('stepfunctions', ['2016-11-23']); -Object.defineProperty(apiLoader.services['stepfunctions'], '2016-11-23', { +apiLoader.services['s3outposts'] = {}; +AWS.S3Outposts = Service.defineService('s3outposts', ['2017-07-25']); +Object.defineProperty(apiLoader.services['s3outposts'], '2017-07-25', { get: function get() { - var model = __nccwpck_require__(85693); - model.paginators = (__nccwpck_require__(24818)/* .pagination */ .o); + var model = __nccwpck_require__(79971); + model.paginators = (__nccwpck_require__(32505)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.StepFunctions; +module.exports = AWS.S3Outposts; /***/ }), -/***/ 89190: +/***/ 77657: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16118,24 +16054,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['storagegateway'] = {}; -AWS.StorageGateway = Service.defineService('storagegateway', ['2013-06-30']); -Object.defineProperty(apiLoader.services['storagegateway'], '2013-06-30', { +apiLoader.services['sagemaker'] = {}; +AWS.SageMaker = Service.defineService('sagemaker', ['2017-07-24']); +Object.defineProperty(apiLoader.services['sagemaker'], '2017-07-24', { get: function get() { - var model = __nccwpck_require__(11069); - model.paginators = (__nccwpck_require__(33999)/* .pagination */ .o); + var model = __nccwpck_require__(71132); + model.paginators = (__nccwpck_require__(69254)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(80824)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.StorageGateway; +module.exports = AWS.SageMaker; /***/ }), -/***/ 57513: +/***/ 38966: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16143,25 +16080,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['sts'] = {}; -AWS.STS = Service.defineService('sts', ['2011-06-15']); -__nccwpck_require__(91055); -Object.defineProperty(apiLoader.services['sts'], '2011-06-15', { +apiLoader.services['sagemakeredge'] = {}; +AWS.SagemakerEdge = Service.defineService('sagemakeredge', ['2020-09-23']); +Object.defineProperty(apiLoader.services['sagemakeredge'], '2020-09-23', { get: function get() { - var model = __nccwpck_require__(80753); - model.paginators = (__nccwpck_require__(93639)/* .pagination */ .o); + var model = __nccwpck_require__(97093); + model.paginators = (__nccwpck_require__(71636)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.STS; +module.exports = AWS.SagemakerEdge; /***/ }), -/***/ 39674: +/***/ 67644: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16169,24 +16105,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['supplychain'] = {}; -AWS.SupplyChain = Service.defineService('supplychain', ['2024-01-01']); -Object.defineProperty(apiLoader.services['supplychain'], '2024-01-01', { +apiLoader.services['sagemakerfeaturestoreruntime'] = {}; +AWS.SageMakerFeatureStoreRuntime = Service.defineService('sagemakerfeaturestoreruntime', ['2020-07-01']); +Object.defineProperty(apiLoader.services['sagemakerfeaturestoreruntime'], '2020-07-01', { get: function get() { - var model = __nccwpck_require__(78323); - model.paginators = (__nccwpck_require__(25916)/* .pagination */ .o); + var model = __nccwpck_require__(75546); + model.paginators = (__nccwpck_require__(12151)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SupplyChain; +module.exports = AWS.SageMakerFeatureStoreRuntime; /***/ }), -/***/ 1099: +/***/ 4707: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16194,24 +16130,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['support'] = {}; -AWS.Support = Service.defineService('support', ['2013-04-15']); -Object.defineProperty(apiLoader.services['support'], '2013-04-15', { +apiLoader.services['sagemakergeospatial'] = {}; +AWS.SageMakerGeospatial = Service.defineService('sagemakergeospatial', ['2020-05-27']); +Object.defineProperty(apiLoader.services['sagemakergeospatial'], '2020-05-27', { get: function get() { - var model = __nccwpck_require__(20767); - model.paginators = (__nccwpck_require__(62491)/* .pagination */ .o); + var model = __nccwpck_require__(26059); + model.paginators = (__nccwpck_require__(99606)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Support; +module.exports = AWS.SageMakerGeospatial; /***/ }), -/***/ 51288: +/***/ 28199: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16219,24 +16155,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['supportapp'] = {}; -AWS.SupportApp = Service.defineService('supportapp', ['2021-08-20']); -Object.defineProperty(apiLoader.services['supportapp'], '2021-08-20', { +apiLoader.services['sagemakermetrics'] = {}; +AWS.SageMakerMetrics = Service.defineService('sagemakermetrics', ['2022-09-30']); +Object.defineProperty(apiLoader.services['sagemakermetrics'], '2022-09-30', { get: function get() { - var model = __nccwpck_require__(94851); - model.paginators = (__nccwpck_require__(60546)/* .pagination */ .o); + var model = __nccwpck_require__(89834); + model.paginators = (__nccwpck_require__(80107)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SupportApp; +module.exports = AWS.SageMakerMetrics; /***/ }), -/***/ 32327: +/***/ 85044: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16244,25 +16180,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['swf'] = {}; -AWS.SWF = Service.defineService('swf', ['2012-01-25']); -__nccwpck_require__(31987); -Object.defineProperty(apiLoader.services['swf'], '2012-01-25', { +apiLoader.services['sagemakerruntime'] = {}; +AWS.SageMakerRuntime = Service.defineService('sagemakerruntime', ['2017-05-13']); +Object.defineProperty(apiLoader.services['sagemakerruntime'], '2017-05-13', { get: function get() { - var model = __nccwpck_require__(11144); - model.paginators = (__nccwpck_require__(48039)/* .pagination */ .o); + var model = __nccwpck_require__(27032); + model.paginators = (__nccwpck_require__(7570)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.SWF; +module.exports = AWS.SageMakerRuntime; /***/ }), -/***/ 25910: +/***/ 62825: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16270,24 +16205,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['synthetics'] = {}; -AWS.Synthetics = Service.defineService('synthetics', ['2017-10-11']); -Object.defineProperty(apiLoader.services['synthetics'], '2017-10-11', { +apiLoader.services['savingsplans'] = {}; +AWS.SavingsPlans = Service.defineService('savingsplans', ['2019-06-28']); +Object.defineProperty(apiLoader.services['savingsplans'], '2019-06-28', { get: function get() { - var model = __nccwpck_require__(78752); - model.paginators = (__nccwpck_require__(61615)/* .pagination */ .o); + var model = __nccwpck_require__(46879); + model.paginators = (__nccwpck_require__(78998)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Synthetics; +module.exports = AWS.SavingsPlans; /***/ }), -/***/ 58523: +/***/ 94840: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16295,24 +16230,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['textract'] = {}; -AWS.Textract = Service.defineService('textract', ['2018-06-27']); -Object.defineProperty(apiLoader.services['textract'], '2018-06-27', { +apiLoader.services['scheduler'] = {}; +AWS.Scheduler = Service.defineService('scheduler', ['2021-06-30']); +Object.defineProperty(apiLoader.services['scheduler'], '2021-06-30', { get: function get() { - var model = __nccwpck_require__(49753); - model.paginators = (__nccwpck_require__(16270)/* .pagination */ .o); + var model = __nccwpck_require__(36876); + model.paginators = (__nccwpck_require__(54594)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Textract; +module.exports = AWS.Scheduler; /***/ }), -/***/ 24529: +/***/ 55713: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16320,24 +16255,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['timestreamquery'] = {}; -AWS.TimestreamQuery = Service.defineService('timestreamquery', ['2018-11-01']); -Object.defineProperty(apiLoader.services['timestreamquery'], '2018-11-01', { +apiLoader.services['schemas'] = {}; +AWS.Schemas = Service.defineService('schemas', ['2019-12-02']); +Object.defineProperty(apiLoader.services['schemas'], '2019-12-02', { get: function get() { - var model = __nccwpck_require__(70457); - model.paginators = (__nccwpck_require__(97217)/* .pagination */ .o); + var model = __nccwpck_require__(76626); + model.paginators = (__nccwpck_require__(34227)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(62213)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.TimestreamQuery; +module.exports = AWS.Schemas; /***/ }), -/***/ 1573: +/***/ 85131: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16345,24 +16281,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['timestreamwrite'] = {}; -AWS.TimestreamWrite = Service.defineService('timestreamwrite', ['2018-11-01']); -Object.defineProperty(apiLoader.services['timestreamwrite'], '2018-11-01', { +apiLoader.services['secretsmanager'] = {}; +AWS.SecretsManager = Service.defineService('secretsmanager', ['2017-10-17']); +Object.defineProperty(apiLoader.services['secretsmanager'], '2017-10-17', { get: function get() { - var model = __nccwpck_require__(8368); - model.paginators = (__nccwpck_require__(89653)/* .pagination */ .o); + var model = __nccwpck_require__(89470); + model.paginators = (__nccwpck_require__(25613)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.TimestreamWrite; +module.exports = AWS.SecretsManager; /***/ }), -/***/ 15300: +/***/ 21550: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16370,24 +16306,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['tnb'] = {}; -AWS.Tnb = Service.defineService('tnb', ['2008-10-21']); -Object.defineProperty(apiLoader.services['tnb'], '2008-10-21', { +apiLoader.services['securityhub'] = {}; +AWS.SecurityHub = Service.defineService('securityhub', ['2018-10-26']); +Object.defineProperty(apiLoader.services['securityhub'], '2018-10-26', { get: function get() { - var model = __nccwpck_require__(1433); - model.paginators = (__nccwpck_require__(55995)/* .pagination */ .o); + var model = __nccwpck_require__(29208); + model.paginators = (__nccwpck_require__(85595)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Tnb; +module.exports = AWS.SecurityHub; /***/ }), -/***/ 75811: +/***/ 84296: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16395,24 +16331,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['transcribeservice'] = {}; -AWS.TranscribeService = Service.defineService('transcribeservice', ['2017-10-26']); -Object.defineProperty(apiLoader.services['transcribeservice'], '2017-10-26', { +apiLoader.services['securitylake'] = {}; +AWS.SecurityLake = Service.defineService('securitylake', ['2018-05-10']); +Object.defineProperty(apiLoader.services['securitylake'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(47294); - model.paginators = (__nccwpck_require__(25395)/* .pagination */ .o); + var model = __nccwpck_require__(26935); + model.paginators = (__nccwpck_require__(42170)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.TranscribeService; +module.exports = AWS.SecurityLake; /***/ }), -/***/ 51585: +/***/ 62402: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16420,25 +16356,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['transfer'] = {}; -AWS.Transfer = Service.defineService('transfer', ['2018-11-05']); -Object.defineProperty(apiLoader.services['transfer'], '2018-11-05', { +apiLoader.services['serverlessapplicationrepository'] = {}; +AWS.ServerlessApplicationRepository = Service.defineService('serverlessapplicationrepository', ['2017-09-08']); +Object.defineProperty(apiLoader.services['serverlessapplicationrepository'], '2017-09-08', { get: function get() { - var model = __nccwpck_require__(93419); - model.paginators = (__nccwpck_require__(65803)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(45405)/* .waiters */ .V); + var model = __nccwpck_require__(68422); + model.paginators = (__nccwpck_require__(34864)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Transfer; +module.exports = AWS.ServerlessApplicationRepository; /***/ }), -/***/ 72544: +/***/ 822: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16446,24 +16381,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['translate'] = {}; -AWS.Translate = Service.defineService('translate', ['2017-07-01']); -Object.defineProperty(apiLoader.services['translate'], '2017-07-01', { +apiLoader.services['servicecatalog'] = {}; +AWS.ServiceCatalog = Service.defineService('servicecatalog', ['2015-12-10']); +Object.defineProperty(apiLoader.services['servicecatalog'], '2015-12-10', { get: function get() { - var model = __nccwpck_require__(61084); - model.paginators = (__nccwpck_require__(40304)/* .pagination */ .o); + var model = __nccwpck_require__(95500); + model.paginators = (__nccwpck_require__(21687)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Translate; +module.exports = AWS.ServiceCatalog; /***/ }), -/***/ 4992: +/***/ 79068: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16471,24 +16406,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['trustedadvisor'] = {}; -AWS.TrustedAdvisor = Service.defineService('trustedadvisor', ['2022-09-15']); -Object.defineProperty(apiLoader.services['trustedadvisor'], '2022-09-15', { +apiLoader.services['servicecatalogappregistry'] = {}; +AWS.ServiceCatalogAppRegistry = Service.defineService('servicecatalogappregistry', ['2020-06-24']); +Object.defineProperty(apiLoader.services['servicecatalogappregistry'], '2020-06-24', { get: function get() { - var model = __nccwpck_require__(3889); - model.paginators = (__nccwpck_require__(89124)/* .pagination */ .o); + var model = __nccwpck_require__(25697); + model.paginators = (__nccwpck_require__(28893)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.TrustedAdvisor; +module.exports = AWS.ServiceCatalogAppRegistry; /***/ }), -/***/ 35604: +/***/ 91569: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16496,25 +16431,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['verifiedpermissions'] = {}; -AWS.VerifiedPermissions = Service.defineService('verifiedpermissions', ['2021-12-01']); -Object.defineProperty(apiLoader.services['verifiedpermissions'], '2021-12-01', { +apiLoader.services['servicediscovery'] = {}; +AWS.ServiceDiscovery = Service.defineService('servicediscovery', ['2017-03-14']); +Object.defineProperty(apiLoader.services['servicediscovery'], '2017-03-14', { get: function get() { - var model = __nccwpck_require__(31407); - model.paginators = (__nccwpck_require__(85997)/* .pagination */ .o); - model.waiters = (__nccwpck_require__(14021)/* .waiters */ .V); + var model = __nccwpck_require__(22361); + model.paginators = (__nccwpck_require__(37798)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.VerifiedPermissions; +module.exports = AWS.ServiceDiscovery; /***/ }), -/***/ 28747: +/***/ 57800: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16522,24 +16456,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['voiceid'] = {}; -AWS.VoiceID = Service.defineService('voiceid', ['2021-09-27']); -Object.defineProperty(apiLoader.services['voiceid'], '2021-09-27', { +apiLoader.services['servicequotas'] = {}; +AWS.ServiceQuotas = Service.defineService('servicequotas', ['2019-06-24']); +Object.defineProperty(apiLoader.services['servicequotas'], '2019-06-24', { get: function get() { - var model = __nccwpck_require__(9375); - model.paginators = (__nccwpck_require__(59512)/* .pagination */ .o); + var model = __nccwpck_require__(68850); + model.paginators = (__nccwpck_require__(63074)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.VoiceID; +module.exports = AWS.ServiceQuotas; /***/ }), -/***/ 78952: +/***/ 46816: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16547,24 +16481,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['vpclattice'] = {}; -AWS.VPCLattice = Service.defineService('vpclattice', ['2022-11-30']); -Object.defineProperty(apiLoader.services['vpclattice'], '2022-11-30', { +apiLoader.services['ses'] = {}; +AWS.SES = Service.defineService('ses', ['2010-12-01']); +Object.defineProperty(apiLoader.services['ses'], '2010-12-01', { get: function get() { - var model = __nccwpck_require__(49656); - model.paginators = (__nccwpck_require__(98717)/* .pagination */ .o); + var model = __nccwpck_require__(56693); + model.paginators = (__nccwpck_require__(9399)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(98229)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.VPCLattice; +module.exports = AWS.SES; /***/ }), -/***/ 72742: +/***/ 20142: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16572,24 +16507,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['waf'] = {}; -AWS.WAF = Service.defineService('waf', ['2015-08-24']); -Object.defineProperty(apiLoader.services['waf'], '2015-08-24', { +apiLoader.services['sesv2'] = {}; +AWS.SESV2 = Service.defineService('sesv2', ['2019-09-27']); +Object.defineProperty(apiLoader.services['sesv2'], '2019-09-27', { get: function get() { - var model = __nccwpck_require__(37925); - model.paginators = (__nccwpck_require__(65794)/* .pagination */ .o); + var model = __nccwpck_require__(69754); + model.paginators = (__nccwpck_require__(72405)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WAF; +module.exports = AWS.SESV2; /***/ }), -/***/ 23153: +/***/ 20271: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16597,24 +16532,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['wafregional'] = {}; -AWS.WAFRegional = Service.defineService('wafregional', ['2016-11-28']); -Object.defineProperty(apiLoader.services['wafregional'], '2016-11-28', { +apiLoader.services['shield'] = {}; +AWS.Shield = Service.defineService('shield', ['2016-06-02']); +Object.defineProperty(apiLoader.services['shield'], '2016-06-02', { get: function get() { - var model = __nccwpck_require__(20014); - model.paginators = (__nccwpck_require__(66829)/* .pagination */ .o); + var model = __nccwpck_require__(47061); + model.paginators = (__nccwpck_require__(54893)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WAFRegional; +module.exports = AWS.Shield; /***/ }), -/***/ 50353: +/***/ 71596: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16622,24 +16557,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['wafv2'] = {}; -AWS.WAFV2 = Service.defineService('wafv2', ['2019-07-29']); -Object.defineProperty(apiLoader.services['wafv2'], '2019-07-29', { +apiLoader.services['signer'] = {}; +AWS.Signer = Service.defineService('signer', ['2017-08-25']); +Object.defineProperty(apiLoader.services['signer'], '2017-08-25', { get: function get() { - var model = __nccwpck_require__(51872); - model.paginators = (__nccwpck_require__(33900)/* .pagination */ .o); + var model = __nccwpck_require__(97116); + model.paginators = (__nccwpck_require__(81027)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(48215)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WAFV2; +module.exports = AWS.Signer; /***/ }), -/***/ 86263: +/***/ 10120: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16647,24 +16583,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['wellarchitected'] = {}; -AWS.WellArchitected = Service.defineService('wellarchitected', ['2020-03-31']); -Object.defineProperty(apiLoader.services['wellarchitected'], '2020-03-31', { +apiLoader.services['simpledb'] = {}; +AWS.SimpleDB = Service.defineService('simpledb', ['2009-04-15']); +Object.defineProperty(apiLoader.services['simpledb'], '2009-04-15', { get: function get() { - var model = __nccwpck_require__(19249); - model.paginators = (__nccwpck_require__(54693)/* .pagination */ .o); + var model = __nccwpck_require__(45164); + model.paginators = (__nccwpck_require__(55255)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WellArchitected; +module.exports = AWS.SimpleDB; /***/ }), -/***/ 85266: +/***/ 37090: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16672,24 +16608,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['wisdom'] = {}; -AWS.Wisdom = Service.defineService('wisdom', ['2020-10-19']); -Object.defineProperty(apiLoader.services['wisdom'], '2020-10-19', { +apiLoader.services['simspaceweaver'] = {}; +AWS.SimSpaceWeaver = Service.defineService('simspaceweaver', ['2022-10-28']); +Object.defineProperty(apiLoader.services['simspaceweaver'], '2022-10-28', { get: function get() { - var model = __nccwpck_require__(94385); - model.paginators = (__nccwpck_require__(54852)/* .pagination */ .o); + var model = __nccwpck_require__(92139); + model.paginators = (__nccwpck_require__(31849)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.Wisdom; +module.exports = AWS.SimSpaceWeaver; /***/ }), -/***/ 38835: +/***/ 57719: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16697,24 +16633,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['workdocs'] = {}; -AWS.WorkDocs = Service.defineService('workdocs', ['2016-05-01']); -Object.defineProperty(apiLoader.services['workdocs'], '2016-05-01', { +apiLoader.services['sms'] = {}; +AWS.SMS = Service.defineService('sms', ['2016-10-24']); +Object.defineProperty(apiLoader.services['sms'], '2016-10-24', { get: function get() { - var model = __nccwpck_require__(41052); - model.paginators = (__nccwpck_require__(94768)/* .pagination */ .o); + var model = __nccwpck_require__(26534); + model.paginators = (__nccwpck_require__(98730)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WorkDocs; +module.exports = AWS.SMS; /***/ }), -/***/ 48579: +/***/ 510: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16722,24 +16658,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['worklink'] = {}; -AWS.WorkLink = Service.defineService('worklink', ['2018-09-25']); -Object.defineProperty(apiLoader.services['worklink'], '2018-09-25', { +apiLoader.services['snowball'] = {}; +AWS.Snowball = Service.defineService('snowball', ['2016-06-30']); +Object.defineProperty(apiLoader.services['snowball'], '2016-06-30', { get: function get() { - var model = __nccwpck_require__(37178); - model.paginators = (__nccwpck_require__(74073)/* .pagination */ .o); + var model = __nccwpck_require__(96822); + model.paginators = (__nccwpck_require__(45219)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WorkLink; +module.exports = AWS.Snowball; /***/ }), -/***/ 38374: +/***/ 64655: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16747,24 +16683,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['workmail'] = {}; -AWS.WorkMail = Service.defineService('workmail', ['2017-10-01']); -Object.defineProperty(apiLoader.services['workmail'], '2017-10-01', { +apiLoader.services['snowdevicemanagement'] = {}; +AWS.SnowDeviceManagement = Service.defineService('snowdevicemanagement', ['2021-08-04']); +Object.defineProperty(apiLoader.services['snowdevicemanagement'], '2021-08-04', { get: function get() { - var model = __nccwpck_require__(93150); - model.paginators = (__nccwpck_require__(5158)/* .pagination */ .o); + var model = __nccwpck_require__(97413); + model.paginators = (__nccwpck_require__(70424)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WorkMail; +module.exports = AWS.SnowDeviceManagement; /***/ }), -/***/ 67025: +/***/ 28581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16772,24 +16708,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['workmailmessageflow'] = {}; -AWS.WorkMailMessageFlow = Service.defineService('workmailmessageflow', ['2019-05-01']); -Object.defineProperty(apiLoader.services['workmailmessageflow'], '2019-05-01', { +apiLoader.services['sns'] = {}; +AWS.SNS = Service.defineService('sns', ['2010-03-31']); +Object.defineProperty(apiLoader.services['sns'], '2010-03-31', { get: function get() { - var model = __nccwpck_require__(57733); - model.paginators = (__nccwpck_require__(85646)/* .pagination */ .o); + var model = __nccwpck_require__(64387); + model.paginators = (__nccwpck_require__(58054)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WorkMailMessageFlow; +module.exports = AWS.SNS; /***/ }), -/***/ 25513: +/***/ 63172: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16797,24 +16733,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['workspaces'] = {}; -AWS.WorkSpaces = Service.defineService('workspaces', ['2015-04-08']); -Object.defineProperty(apiLoader.services['workspaces'], '2015-04-08', { +apiLoader.services['sqs'] = {}; +AWS.SQS = Service.defineService('sqs', ['2012-11-05']); +__nccwpck_require__(94571); +Object.defineProperty(apiLoader.services['sqs'], '2012-11-05', { get: function get() { - var model = __nccwpck_require__(97805); - model.paginators = (__nccwpck_require__(27769)/* .pagination */ .o); + var model = __nccwpck_require__(53974); + model.paginators = (__nccwpck_require__(17249)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WorkSpaces; +module.exports = AWS.SQS; /***/ }), -/***/ 22033: +/***/ 83380: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16822,24 +16759,25 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['workspacesthinclient'] = {}; -AWS.WorkSpacesThinClient = Service.defineService('workspacesthinclient', ['2023-08-22']); -Object.defineProperty(apiLoader.services['workspacesthinclient'], '2023-08-22', { +apiLoader.services['ssm'] = {}; +AWS.SSM = Service.defineService('ssm', ['2014-11-06']); +Object.defineProperty(apiLoader.services['ssm'], '2014-11-06', { get: function get() { - var model = __nccwpck_require__(24229); - model.paginators = (__nccwpck_require__(52084)/* .pagination */ .o); + var model = __nccwpck_require__(44596); + model.paginators = (__nccwpck_require__(5135)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(98523)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WorkSpacesThinClient; +module.exports = AWS.SSM; /***/ }), -/***/ 94124: +/***/ 12577: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16847,24 +16785,24 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['workspacesweb'] = {}; -AWS.WorkSpacesWeb = Service.defineService('workspacesweb', ['2020-07-08']); -Object.defineProperty(apiLoader.services['workspacesweb'], '2020-07-08', { +apiLoader.services['ssmcontacts'] = {}; +AWS.SSMContacts = Service.defineService('ssmcontacts', ['2021-05-03']); +Object.defineProperty(apiLoader.services['ssmcontacts'], '2021-05-03', { get: function get() { - var model = __nccwpck_require__(47128); - model.paginators = (__nccwpck_require__(43497)/* .pagination */ .o); + var model = __nccwpck_require__(74831); + model.paginators = (__nccwpck_require__(63938)/* .pagination */ .o); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.WorkSpacesWeb; +module.exports = AWS.SSMContacts; /***/ }), -/***/ 41548: +/***/ 20590: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); @@ -16872,3889 +16810,2560 @@ var AWS = __nccwpck_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; -apiLoader.services['xray'] = {}; -AWS.XRay = Service.defineService('xray', ['2016-04-12']); -Object.defineProperty(apiLoader.services['xray'], '2016-04-12', { +apiLoader.services['ssmincidents'] = {}; +AWS.SSMIncidents = Service.defineService('ssmincidents', ['2018-05-10']); +Object.defineProperty(apiLoader.services['ssmincidents'], '2018-05-10', { get: function get() { - var model = __nccwpck_require__(97355); - model.paginators = (__nccwpck_require__(97949)/* .pagination */ .o); + var model = __nccwpck_require__(18719); + model.paginators = (__nccwpck_require__(4502)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(97755)/* .waiters */ .V); return model; }, enumerable: true, configurable: true }); -module.exports = AWS.XRay; - - -/***/ }), - -/***/ 52793: -/***/ ((module) => { - -function apiLoader(svc, version) { - if (!apiLoader.services.hasOwnProperty(svc)) { - throw new Error('InvalidService: Failed to load api for ' + svc); - } - return apiLoader.services[svc][version]; -} - -/** - * @api private - * - * This member of AWS.apiLoader is private, but changing it will necessitate a - * change to ../scripts/services-table-generator.ts - */ -apiLoader.services = {}; - -/** - * @api private - */ -module.exports = apiLoader; +module.exports = AWS.SSMIncidents; /***/ }), -/***/ 71786: +/***/ 99330: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { __nccwpck_require__(73639); - var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -// Load all service classes -__nccwpck_require__(26296); +apiLoader.services['ssmquicksetup'] = {}; +AWS.SSMQuickSetup = Service.defineService('ssmquicksetup', ['2018-05-10']); +Object.defineProperty(apiLoader.services['ssmquicksetup'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(49291); + model.paginators = (__nccwpck_require__(73317)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); -/** - * @api private - */ -module.exports = AWS; +module.exports = AWS.SSMQuickSetup; /***/ }), -/***/ 93260: +/***/ 44552: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var AWS = __nccwpck_require__(28437), - url = AWS.util.url, - crypto = AWS.util.crypto.lib, - base64Encode = AWS.util.base64.encode, - inherit = AWS.util.inherit; - -var queryEncode = function (string) { - var replacements = { - '+': '-', - '=': '_', - '/': '~' - }; - return string.replace(/[\+=\/]/g, function (match) { - return replacements[match]; - }); -}; - -var signPolicy = function (policy, privateKey) { - var sign = crypto.createSign('RSA-SHA1'); - sign.write(policy); - return queryEncode(sign.sign(privateKey, 'base64')); -}; - -var signWithCannedPolicy = function (url, expires, keyPairId, privateKey) { - var policy = JSON.stringify({ - Statement: [ - { - Resource: url, - Condition: { DateLessThan: { 'AWS:EpochTime': expires } } - } - ] - }); - - return { - Expires: expires, - 'Key-Pair-Id': keyPairId, - Signature: signPolicy(policy.toString(), privateKey) - }; -}; - -var signWithCustomPolicy = function (policy, keyPairId, privateKey) { - policy = policy.replace(/\s/mg, ''); - - return { - Policy: queryEncode(base64Encode(policy)), - 'Key-Pair-Id': keyPairId, - Signature: signPolicy(policy, privateKey) - }; -}; - -var determineScheme = function (url) { - var parts = url.split('://'); - if (parts.length < 2) { - throw new Error('Invalid URL.'); - } - - return parts[0].replace('*', ''); -}; - -var getRtmpUrl = function (rtmpUrl) { - var parsed = url.parse(rtmpUrl); - return parsed.path.replace(/^\//, '') + (parsed.hash || ''); -}; - -var getResource = function (url) { - switch (determineScheme(url)) { - case 'http': - case 'https': - return url; - case 'rtmp': - return getRtmpUrl(url); - default: - throw new Error('Invalid URI scheme. Scheme must be one of' - + ' http, https, or rtmp'); - } -}; - -var handleError = function (err, callback) { - if (!callback || typeof callback !== 'function') { - throw err; - } - - callback(err); -}; - -var handleSuccess = function (result, callback) { - if (!callback || typeof callback !== 'function') { - return result; - } - - callback(null, result); -}; - -AWS.CloudFront.Signer = inherit({ - /** - * A signer object can be used to generate signed URLs and cookies for granting - * access to content on restricted CloudFront distributions. - * - * @see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html - * - * @param keyPairId [String] (Required) The ID of the CloudFront key pair - * being used. - * @param privateKey [String] (Required) A private key in RSA format. - */ - constructor: function Signer(keyPairId, privateKey) { - if (keyPairId === void 0 || privateKey === void 0) { - throw new Error('A key pair ID and private key are required'); - } - - this.keyPairId = keyPairId; - this.privateKey = privateKey; - }, - - /** - * Create a signed Amazon CloudFront Cookie. - * - * @param options [Object] The options to create a signed cookie. - * @option options url [String] The URL to which the signature will grant - * access. Required unless you pass in a full - * policy. - * @option options expires [Number] A Unix UTC timestamp indicating when the - * signature should expire. Required unless you - * pass in a full policy. - * @option options policy [String] A CloudFront JSON policy. Required unless - * you pass in a url and an expiry time. - * - * @param cb [Function] if a callback is provided, this function will - * pass the hash as the second parameter (after the error parameter) to - * the callback function. - * - * @return [Object] if called synchronously (with no callback), returns the - * signed cookie parameters. - * @return [null] nothing is returned if a callback is provided. - */ - getSignedCookie: function (options, cb) { - var signatureHash = 'policy' in options - ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) - : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey); - - var cookieHash = {}; - for (var key in signatureHash) { - if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { - cookieHash['CloudFront-' + key] = signatureHash[key]; - } - } - - return handleSuccess(cookieHash, cb); - }, - - /** - * Create a signed Amazon CloudFront URL. - * - * Keep in mind that URLs meant for use in media/flash players may have - * different requirements for URL formats (e.g. some require that the - * extension be removed, some require the file name to be prefixed - * - mp4:, some require you to add "/cfx/st" into your URL). - * - * @param options [Object] The options to create a signed URL. - * @option options url [String] The URL to which the signature will grant - * access. Any query params included with - * the URL should be encoded. Required. - * @option options expires [Number] A Unix UTC timestamp indicating when the - * signature should expire. Required unless you - * pass in a full policy. - * @option options policy [String] A CloudFront JSON policy. Required unless - * you pass in a url and an expiry time. - * - * @param cb [Function] if a callback is provided, this function will - * pass the URL as the second parameter (after the error parameter) to - * the callback function. - * - * @return [String] if called synchronously (with no callback), returns the - * signed URL. - * @return [null] nothing is returned if a callback is provided. - */ - getSignedUrl: function (options, cb) { - try { - var resource = getResource(options.url); - } catch (err) { - return handleError(err, cb); - } - - var parsedUrl = url.parse(options.url, true), - signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy') - ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) - : signWithCannedPolicy(resource, options.expires, this.keyPairId, this.privateKey); - - parsedUrl.search = null; - for (var key in signatureHash) { - if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { - parsedUrl.query[key] = signatureHash[key]; - } - } - - try { - var signedUrl = determineScheme(options.url) === 'rtmp' - ? getRtmpUrl(url.format(parsedUrl)) - : url.format(parsedUrl); - } catch (err) { - return handleError(err, cb); - } - - return handleSuccess(signedUrl, cb); - } -}); +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * @api private - */ -module.exports = AWS.CloudFront.Signer; +apiLoader.services['ssmsap'] = {}; +AWS.SsmSap = Service.defineService('ssmsap', ['2018-05-10']); +Object.defineProperty(apiLoader.services['ssmsap'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(49218); + model.paginators = (__nccwpck_require__(94718)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SsmSap; /***/ }), -/***/ 38110: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 71096: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); -__nccwpck_require__(53819); -__nccwpck_require__(36965); -var PromisesDependency; +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * The main configuration class used by all service objects to set - * the region, credentials, and other options for requests. - * - * By default, credentials and region settings are left unconfigured. - * This should be configured by the application before using any - * AWS service APIs. - * - * In order to set global configuration options, properties should - * be assigned to the global {AWS.config} object. - * - * @see AWS.config - * - * @!group General Configuration Options - * - * @!attribute credentials - * @return [AWS.Credentials] the AWS credentials to sign requests with. - * - * @!attribute region - * @example Set the global region setting to us-west-2 - * AWS.config.update({region: 'us-west-2'}); - * @return [AWS.Credentials] The region to send service requests to. - * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html - * A list of available endpoints for each AWS service - * - * @!attribute maxRetries - * @return [Integer] the maximum amount of retries to perform for a - * service request. By default this value is calculated by the specific - * service object that the request is being made to. - * - * @!attribute maxRedirects - * @return [Integer] the maximum amount of redirects to follow for a - * service request. Defaults to 10. - * - * @!attribute paramValidation - * @return [Boolean|map] whether input parameters should be validated against - * the operation description before sending the request. Defaults to true. - * Pass a map to enable any of the following specific validation features: - * - * * **min** [Boolean] — Validates that a value meets the min - * constraint. This is enabled by default when paramValidation is set - * to `true`. - * * **max** [Boolean] — Validates that a value meets the max - * constraint. - * * **pattern** [Boolean] — Validates that a string value matches a - * regular expression. - * * **enum** [Boolean] — Validates that a string value matches one - * of the allowable enum values. - * - * @!attribute computeChecksums - * @return [Boolean] whether to compute checksums for payload bodies when - * the service accepts it (currently supported in S3 and SQS only). - * - * @!attribute convertResponseTypes - * @return [Boolean] whether types are converted when parsing response data. - * Currently only supported for JSON based services. Turning this off may - * improve performance on large response payloads. Defaults to `true`. - * - * @!attribute correctClockSkew - * @return [Boolean] whether to apply a clock skew correction and retry - * requests that fail because of an skewed client clock. Defaults to - * `false`. - * - * @!attribute sslEnabled - * @return [Boolean] whether SSL is enabled for requests - * - * @!attribute s3ForcePathStyle - * @return [Boolean] whether to force path style URLs for S3 objects - * - * @!attribute s3BucketEndpoint - * @note Setting this configuration option requires an `endpoint` to be - * provided explicitly to the service constructor. - * @return [Boolean] whether the provided endpoint addresses an individual - * bucket (false if it addresses the root API endpoint). - * - * @!attribute s3DisableBodySigning - * @return [Boolean] whether to disable S3 body signing when using signature version `v4`. - * Body signing can only be disabled when using https. Defaults to `true`. - * - * @!attribute s3UsEast1RegionalEndpoint - * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3 - * request to global endpoints or 'us-east-1' regional endpoints. This config is only - * applicable to S3 client; - * Defaults to 'legacy' - * @!attribute s3UseArnRegion - * @return [Boolean] whether to override the request region with the region inferred - * from requested resource's ARN. Only available for S3 buckets - * Defaults to `true` - * - * @!attribute useAccelerateEndpoint - * @note This configuration option is only compatible with S3 while accessing - * dns-compatible buckets. - * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service. - * Defaults to `false`. - * - * @!attribute retryDelayOptions - * @example Set the base retry delay for all services to 300 ms - * AWS.config.update({retryDelayOptions: {base: 300}}); - * // Delays with maxRetries = 3: 300, 600, 1200 - * @example Set a custom backoff function to provide delay values on retries - * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) { - * // returns delay in ms - * }}}); - * @return [map] A set of options to configure the retry delay on retryable errors. - * Currently supported options are: - * - * * **base** [Integer] — The base number of milliseconds to use in the - * exponential backoff for operation retries. Defaults to 100 ms for all services except - * DynamoDB, where it defaults to 50ms. - * - * * **customBackoff ** [function] — A custom function that accepts a - * retry count and error and returns the amount of time to delay in - * milliseconds. If the result is a non-zero negative value, no further - * retry attempts will be made. The `base` option will be ignored if this - * option is supplied. The function is only called for retryable errors. - * - * @!attribute httpOptions - * @return [map] A set of options to pass to the low-level HTTP request. - * Currently supported options are: - * - * * **proxy** [String] — the URL to proxy requests through - * * **agent** [http.Agent, https.Agent] — the Agent object to perform - * HTTP requests with. Used for connection pooling. Note that for - * SSL connections, a special Agent object is used in order to enable - * peer certificate verification. This feature is only supported in the - * Node.js environment. - * * **connectTimeout** [Integer] — Sets the socket to timeout after - * failing to establish a connection with the server after - * `connectTimeout` milliseconds. This timeout has no effect once a socket - * connection has been established. - * * **timeout** [Integer] — The number of milliseconds a request can - * take before automatically being terminated. - * Defaults to two minutes (120000). - * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous - * HTTP requests. Used in the browser environment only. Set to false to - * send requests synchronously. Defaults to true (async on). - * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" - * property of an XMLHttpRequest object. Used in the browser environment - * only. Defaults to false. - * @!attribute logger - * @return [#write,#log] an object that responds to .write() (like a stream) - * or .log() (like the console object) in order to log information about - * requests - * - * @!attribute systemClockOffset - * @return [Number] an offset value in milliseconds to apply to all signing - * times. Use this to compensate for clock skew when your system may be - * out of sync with the service time. Note that this configuration option - * can only be applied to the global `AWS.config` object and cannot be - * overridden in service-specific configuration. Defaults to 0 milliseconds. - * - * @!attribute signatureVersion - * @return [String] the signature version to sign requests with (overriding - * the API configuration). Possible values are: 'v2', 'v3', 'v4'. - * - * @!attribute signatureCache - * @return [Boolean] whether the signature to sign requests with (overriding - * the API configuration) is cached. Only applies to the signature version 'v4'. - * Defaults to `true`. - * - * @!attribute endpointDiscoveryEnabled - * @return [Boolean|undefined] whether to call operations with endpoints - * given by service dynamically. Setting this config to `true` will enable - * endpoint discovery for all applicable operations. Setting it to `false` - * will explicitly disable endpoint discovery even though operations that - * require endpoint discovery will presumably fail. Leaving it to - * `undefined` means SDK only do endpoint discovery when it's required. - * Defaults to `undefined` - * - * @!attribute endpointCacheSize - * @return [Number] the size of the global cache storing endpoints from endpoint - * discovery operations. Once endpoint cache is created, updating this setting - * cannot change existing cache size. - * Defaults to 1000 - * - * @!attribute hostPrefixEnabled - * @return [Boolean] whether to marshal request parameters to the prefix of - * hostname. Defaults to `true`. - * - * @!attribute stsRegionalEndpoints - * @return ['legacy'|'regional'] whether to send sts request to global endpoints or - * regional endpoints. - * Defaults to 'legacy'. - * - * @!attribute useFipsEndpoint - * @return [Boolean] Enables FIPS compatible endpoints. Defaults to `false`. - * - * @!attribute useDualstackEndpoint - * @return [Boolean] Enables IPv6 dualstack endpoint. Defaults to `false`. - */ -AWS.Config = AWS.util.inherit({ - /** - * @!endgroup - */ +apiLoader.services['sso'] = {}; +AWS.SSO = Service.defineService('sso', ['2019-06-10']); +Object.defineProperty(apiLoader.services['sso'], '2019-06-10', { + get: function get() { + var model = __nccwpck_require__(8027); + model.paginators = (__nccwpck_require__(36610)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); - /** - * Creates a new configuration object. This is the object that passes - * option data along to service requests, including credentials, security, - * region information, and some service specific settings. - * - * @example Creating a new configuration object with credentials and region - * var config = new AWS.Config({ - * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2' - * }); - * @option options accessKeyId [String] your AWS access key ID. - * @option options secretAccessKey [String] your AWS secret access key. - * @option options sessionToken [AWS.Credentials] the optional AWS - * session token to sign requests with. - * @option options credentials [AWS.Credentials] the AWS credentials - * to sign requests with. You can either specify this object, or - * specify the accessKeyId and secretAccessKey options directly. - * @option options credentialProvider [AWS.CredentialProviderChain] the - * provider chain used to resolve credentials if no static `credentials` - * property is set. - * @option options region [String] the region to send service requests to. - * See {region} for more information. - * @option options maxRetries [Integer] the maximum amount of retries to - * attempt with a request. See {maxRetries} for more information. - * @option options maxRedirects [Integer] the maximum amount of redirects to - * follow with a request. See {maxRedirects} for more information. - * @option options sslEnabled [Boolean] whether to enable SSL for - * requests. - * @option options paramValidation [Boolean|map] whether input parameters - * should be validated against the operation description before sending - * the request. Defaults to true. Pass a map to enable any of the - * following specific validation features: - * - * * **min** [Boolean] — Validates that a value meets the min - * constraint. This is enabled by default when paramValidation is set - * to `true`. - * * **max** [Boolean] — Validates that a value meets the max - * constraint. - * * **pattern** [Boolean] — Validates that a string value matches a - * regular expression. - * * **enum** [Boolean] — Validates that a string value matches one - * of the allowable enum values. - * @option options computeChecksums [Boolean] whether to compute checksums - * for payload bodies when the service accepts it (currently supported - * in S3 only) - * @option options convertResponseTypes [Boolean] whether types are converted - * when parsing response data. Currently only supported for JSON based - * services. Turning this off may improve performance on large response - * payloads. Defaults to `true`. - * @option options correctClockSkew [Boolean] whether to apply a clock skew - * correction and retry requests that fail because of an skewed client - * clock. Defaults to `false`. - * @option options s3ForcePathStyle [Boolean] whether to force path - * style URLs for S3 objects. - * @option options s3BucketEndpoint [Boolean] whether the provided endpoint - * addresses an individual bucket (false if it addresses the root API - * endpoint). Note that setting this configuration option requires an - * `endpoint` to be provided explicitly to the service constructor. - * @option options s3DisableBodySigning [Boolean] whether S3 body signing - * should be disabled when using signature version `v4`. Body signing - * can only be disabled when using https. Defaults to `true`. - * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region - * is set to 'us-east-1', whether to send s3 request to global endpoints or - * 'us-east-1' regional endpoints. This config is only applicable to S3 client. - * Defaults to `legacy` - * @option options s3UseArnRegion [Boolean] whether to override the request region - * with the region inferred from requested resource's ARN. Only available for S3 buckets - * Defaults to `true` - * - * @option options retryDelayOptions [map] A set of options to configure - * the retry delay on retryable errors. Currently supported options are: - * - * * **base** [Integer] — The base number of milliseconds to use in the - * exponential backoff for operation retries. Defaults to 100 ms for all - * services except DynamoDB, where it defaults to 50ms. - * * **customBackoff ** [function] — A custom function that accepts a - * retry count and error and returns the amount of time to delay in - * milliseconds. If the result is a non-zero negative value, no further - * retry attempts will be made. The `base` option will be ignored if this - * option is supplied. The function is only called for retryable errors. - * @option options httpOptions [map] A set of options to pass to the low-level - * HTTP request. Currently supported options are: - * - * * **proxy** [String] — the URL to proxy requests through - * * **agent** [http.Agent, https.Agent] — the Agent object to perform - * HTTP requests with. Used for connection pooling. Defaults to the global - * agent (`http.globalAgent`) for non-SSL connections. Note that for - * SSL connections, a special Agent object is used in order to enable - * peer certificate verification. This feature is only available in the - * Node.js environment. - * * **connectTimeout** [Integer] — Sets the socket to timeout after - * failing to establish a connection with the server after - * `connectTimeout` milliseconds. This timeout has no effect once a socket - * connection has been established. - * * **timeout** [Integer] — Sets the socket to timeout after timeout - * milliseconds of inactivity on the socket. Defaults to two minutes - * (120000). - * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous - * HTTP requests. Used in the browser environment only. Set to false to - * send requests synchronously. Defaults to true (async on). - * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" - * property of an XMLHttpRequest object. Used in the browser environment - * only. Defaults to false. - * @option options apiVersion [String, Date] a String in YYYY-MM-DD format - * (or a date) that represents the latest possible API version that can be - * used in all services (unless overridden by `apiVersions`). Specify - * 'latest' to use the latest possible version. - * @option options apiVersions [map] a map of service - * identifiers (the lowercase service class name) with the API version to - * use when instantiating a service. Specify 'latest' for each individual - * that can use the latest available version. - * @option options logger [#write,#log] an object that responds to .write() - * (like a stream) or .log() (like the console object) in order to log - * information about requests - * @option options systemClockOffset [Number] an offset value in milliseconds - * to apply to all signing times. Use this to compensate for clock skew - * when your system may be out of sync with the service time. Note that - * this configuration option can only be applied to the global `AWS.config` - * object and cannot be overridden in service-specific configuration. - * Defaults to 0 milliseconds. - * @option options signatureVersion [String] the signature version to sign - * requests with (overriding the API configuration). Possible values are: - * 'v2', 'v3', 'v4'. - * @option options signatureCache [Boolean] whether the signature to sign - * requests with (overriding the API configuration) is cached. Only applies - * to the signature version 'v4'. Defaults to `true`. - * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32 - * checksum of HTTP response bodies returned by DynamoDB. Default: `true`. - * @option options useAccelerateEndpoint [Boolean] Whether to use the - * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`. - * @option options clientSideMonitoring [Boolean] whether to collect and - * publish this client's performance metrics of all its API requests. - * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to - * call operations with endpoints given by service dynamically. Setting this - * config to `true` will enable endpoint discovery for all applicable operations. - * Setting it to `false` will explicitly disable endpoint discovery even though - * operations that require endpoint discovery will presumably fail. Leaving it - * to `undefined` means SDK will only do endpoint discovery when it's required. - * Defaults to `undefined` - * @option options endpointCacheSize [Number] the size of the global cache storing - * endpoints from endpoint discovery operations. Once endpoint cache is created, - * updating this setting cannot change existing cache size. - * Defaults to 1000 - * @option options hostPrefixEnabled [Boolean] whether to marshal request - * parameters to the prefix of hostname. - * Defaults to `true`. - * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request - * to global endpoints or regional endpoints. - * Defaults to 'legacy'. - * @option options useFipsEndpoint [Boolean] Enables FIPS compatible endpoints. - * Defaults to `false`. - * @option options useDualstackEndpoint [Boolean] Enables IPv6 dualstack endpoint. - * Defaults to `false`. - */ - constructor: function Config(options) { - if (options === undefined) options = {}; - options = this.extractCredentials(options); +module.exports = AWS.SSO; - AWS.util.each.call(this, this.keys, function (key, value) { - this.set(key, options[key], value); - }); - }, - /** - * @!group Managing Credentials - */ +/***/ }), - /** - * Loads credentials from the configuration object. This is used internally - * by the SDK to ensure that refreshable {Credentials} objects are properly - * refreshed and loaded when sending a request. If you want to ensure that - * your credentials are loaded prior to a request, you can use this method - * directly to provide accurate credential data stored in the object. - * - * @note If you configure the SDK with static or environment credentials, - * the credential data should already be present in {credentials} attribute. - * This method is primarily necessary to load credentials from asynchronous - * sources, or sources that can refresh credentials periodically. - * @example Getting your access key - * AWS.config.getCredentials(function(err) { - * if (err) console.log(err.stack); // credentials not loaded - * else console.log("Access Key:", AWS.config.credentials.accessKeyId); - * }) - * @callback callback function(err) - * Called when the {credentials} have been properly set on the configuration - * object. - * - * @param err [Error] if this is set, credentials were not successfully - * loaded and this error provides information why. - * @see credentials - * @see Credentials - */ - getCredentials: function getCredentials(callback) { - var self = this; +/***/ 66644: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function finish(err) { - callback(err, err ? null : self.credentials); - } +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - function credError(msg, err) { - return new AWS.util.error(err || new Error(), { - code: 'CredentialsError', - message: msg, - name: 'CredentialsError' - }); - } +apiLoader.services['ssoadmin'] = {}; +AWS.SSOAdmin = Service.defineService('ssoadmin', ['2020-07-20']); +Object.defineProperty(apiLoader.services['ssoadmin'], '2020-07-20', { + get: function get() { + var model = __nccwpck_require__(7239); + model.paginators = (__nccwpck_require__(49402)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); - function getAsyncCredentials() { - self.credentials.get(function(err) { - if (err) { - var msg = 'Could not load credentials from ' + - self.credentials.constructor.name; - err = credError(msg, err); - } - finish(err); - }); - } +module.exports = AWS.SSOAdmin; - function getStaticCredentials() { - var err = null; - if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) { - err = credError('Missing credentials'); - } - finish(err); - } - if (self.credentials) { - if (typeof self.credentials.get === 'function') { - getAsyncCredentials(); - } else { // static credentials - getStaticCredentials(); - } - } else if (self.credentialProvider) { - self.credentialProvider.resolve(function(err, creds) { - if (err) { - err = credError('Could not load credentials from any providers', err); - } - self.credentials = creds; - finish(err); - }); - } else { - finish(credError('No credentials to load')); - } - }, +/***/ }), - /** - * Loads token from the configuration object. This is used internally - * by the SDK to ensure that refreshable {Token} objects are properly - * refreshed and loaded when sending a request. If you want to ensure that - * your token is loaded prior to a request, you can use this method - * directly to provide accurate token data stored in the object. - * - * @note If you configure the SDK with static token, the token data should - * already be present in {token} attribute. This method is primarily necessary - * to load token from asynchronous sources, or sources that can refresh - * token periodically. - * @example Getting your access token - * AWS.config.getToken(function(err) { - * if (err) console.log(err.stack); // token not loaded - * else console.log("Token:", AWS.config.token.token); - * }) - * @callback callback function(err) - * Called when the {token} have been properly set on the configuration object. - * - * @param err [Error] if this is set, token was not successfully loaded and - * this error provides information why. - * @see token - */ - getToken: function getToken(callback) { - var self = this; +/***/ 49870: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['ssooidc'] = {}; +AWS.SSOOIDC = Service.defineService('ssooidc', ['2019-06-10']); +Object.defineProperty(apiLoader.services['ssooidc'], '2019-06-10', { + get: function get() { + var model = __nccwpck_require__(62343); + model.paginators = (__nccwpck_require__(50215)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); - function finish(err) { - callback(err, err ? null : self.token); - } +module.exports = AWS.SSOOIDC; - function tokenError(msg, err) { - return new AWS.util.error(err || new Error(), { - code: 'TokenError', - message: msg, - name: 'TokenError' - }); - } - function getAsyncToken() { - self.token.get(function(err) { - if (err) { - var msg = 'Could not load token from ' + - self.token.constructor.name; - err = tokenError(msg, err); - } - finish(err); - }); - } +/***/ }), - function getStaticToken() { - var err = null; - if (!self.token.token) { - err = tokenError('Missing token'); - } - finish(err); - } +/***/ 8136: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (self.token) { - if (typeof self.token.get === 'function') { - getAsyncToken(); - } else { // static token - getStaticToken(); - } - } else if (self.tokenProvider) { - self.tokenProvider.resolve(function(err, token) { - if (err) { - err = tokenError('Could not load token from any providers', err); - } - self.token = token; - finish(err); - }); - } else { - finish(tokenError('No token to load')); - } +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['stepfunctions'] = {}; +AWS.StepFunctions = Service.defineService('stepfunctions', ['2016-11-23']); +Object.defineProperty(apiLoader.services['stepfunctions'], '2016-11-23', { + get: function get() { + var model = __nccwpck_require__(85693); + model.paginators = (__nccwpck_require__(24818)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @!group Loading and Setting Configuration Options - */ +module.exports = AWS.StepFunctions; - /** - * @overload update(options, allowUnknownKeys = false) - * Updates the current configuration object with new options. - * - * @example Update maxRetries property of a configuration object - * config.update({maxRetries: 10}); - * @param [Object] options a map of option keys and values. - * @param [Boolean] allowUnknownKeys whether unknown keys can be set on - * the configuration object. Defaults to `false`. - * @see constructor - */ - update: function update(options, allowUnknownKeys) { - allowUnknownKeys = allowUnknownKeys || false; - options = this.extractCredentials(options); - AWS.util.each.call(this, options, function (key, value) { - if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) || - AWS.Service.hasService(key)) { - this.set(key, value); - } - }); - }, - /** - * Loads configuration data from a JSON file into this config object. - * @note Loading configuration will reset all existing configuration - * on the object. - * @!macro nobrowser - * @param path [String] the path relative to your process's current - * working directory to load configuration from. - * @return [AWS.Config] the same configuration object - */ - loadFromPath: function loadFromPath(path) { - this.clear(); +/***/ }), - var options = JSON.parse(AWS.util.readFileSync(path)); - var fileSystemCreds = new AWS.FileSystemCredentials(path); - var chain = new AWS.CredentialProviderChain(); - chain.providers.unshift(fileSystemCreds); - chain.resolve(function (err, creds) { - if (err) throw err; - else options.credentials = creds; - }); +/***/ 89190: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.constructor(options); +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - return this; +apiLoader.services['storagegateway'] = {}; +AWS.StorageGateway = Service.defineService('storagegateway', ['2013-06-30']); +Object.defineProperty(apiLoader.services['storagegateway'], '2013-06-30', { + get: function get() { + var model = __nccwpck_require__(11069); + model.paginators = (__nccwpck_require__(33999)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * Clears configuration data on this object - * - * @api private - */ - clear: function clear() { - /*jshint forin:false */ - AWS.util.each.call(this, this.keys, function (key) { - delete this[key]; - }); +module.exports = AWS.StorageGateway; - // reset credential provider - this.set('credentials', undefined); - this.set('credentialProvider', undefined); - }, - /** - * Sets a property on the configuration object, allowing for a - * default value - * @api private - */ - set: function set(property, value, defaultValue) { - if (value === undefined) { - if (defaultValue === undefined) { - defaultValue = this.keys[property]; - } - if (typeof defaultValue === 'function') { - this[property] = defaultValue.call(this); - } else { - this[property] = defaultValue; - } - } else if (property === 'httpOptions' && this[property]) { - // deep merge httpOptions - this[property] = AWS.util.merge(this[property], value); - } else { - this[property] = value; - } - }, +/***/ }), - /** - * All of the keys with their default values. - * - * @constant - * @api private - */ - keys: { - credentials: null, - credentialProvider: null, - region: null, - logger: null, - apiVersions: {}, - apiVersion: null, - endpoint: undefined, - httpOptions: { - timeout: 120000 - }, - maxRetries: undefined, - maxRedirects: 10, - paramValidation: true, - sslEnabled: true, - s3ForcePathStyle: false, - s3BucketEndpoint: false, - s3DisableBodySigning: true, - s3UsEast1RegionalEndpoint: 'legacy', - s3UseArnRegion: undefined, - computeChecksums: true, - convertResponseTypes: true, - correctClockSkew: false, - customUserAgent: null, - dynamoDbCrc32: true, - systemClockOffset: 0, - signatureVersion: null, - signatureCache: true, - retryDelayOptions: {}, - useAccelerateEndpoint: false, - clientSideMonitoring: false, - endpointDiscoveryEnabled: undefined, - endpointCacheSize: 1000, - hostPrefixEnabled: true, - stsRegionalEndpoints: 'legacy', - useFipsEndpoint: false, - useDualstackEndpoint: false, - token: null - }, +/***/ 57513: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Extracts accessKeyId, secretAccessKey and sessionToken - * from a configuration hash. - * - * @api private - */ - extractCredentials: function extractCredentials(options) { - if (options.accessKeyId && options.secretAccessKey) { - options = AWS.util.copy(options); - options.credentials = new AWS.Credentials(options); - } - return options; - }, +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - /** - * Sets the promise dependency the SDK will use wherever Promises are returned. - * Passing `null` will force the SDK to use native Promises if they are available. - * If native Promises are not available, passing `null` will have no effect. - * @param [Constructor] dep A reference to a Promise constructor - */ - setPromisesDependency: function setPromisesDependency(dep) { - PromisesDependency = dep; - // if null was passed in, we should try to use native promises - if (dep === null && typeof Promise === 'function') { - PromisesDependency = Promise; - } - var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; - if (AWS.S3) { - constructors.push(AWS.S3); - if (AWS.S3.ManagedUpload) { - constructors.push(AWS.S3.ManagedUpload); - } - } - AWS.util.addPromises(constructors, PromisesDependency); +apiLoader.services['sts'] = {}; +AWS.STS = Service.defineService('sts', ['2011-06-15']); +__nccwpck_require__(91055); +Object.defineProperty(apiLoader.services['sts'], '2011-06-15', { + get: function get() { + var model = __nccwpck_require__(80753); + model.paginators = (__nccwpck_require__(93639)/* .pagination */ .o); + return model; }, - - /** - * Gets the promise dependency set by `AWS.config.setPromisesDependency`. - */ - getPromisesDependency: function getPromisesDependency() { - return PromisesDependency; - } + enumerable: true, + configurable: true }); -/** - * @return [AWS.Config] The global configuration object singleton instance - * @readonly - * @see AWS.Config - */ -AWS.config = new AWS.Config(); +module.exports = AWS.STS; /***/ }), -/***/ 85566: +/***/ 39674: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); -/** - * @api private - */ -function validateRegionalEndpointsFlagValue(configValue, errorOptions) { - if (typeof configValue !== 'string') return undefined; - else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) { - return configValue.toLowerCase(); - } else { - throw AWS.util.error(new Error(), errorOptions); - } -} +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * Resolve the configuration value for regional endpoint from difference sources: client - * config, environmental variable, shared config file. Value can be case-insensitive - * 'legacy' or 'reginal'. - * @param originalConfig user-supplied config object to resolve - * @param options a map of config property names from individual configuration source - * - env: name of environmental variable that refers to the config - * - sharedConfig: name of shared configuration file property that refers to the config - * - clientConfig: name of client configuration property that refers to the config - * - * @api private - */ -function resolveRegionalEndpointsFlag(originalConfig, options) { - originalConfig = originalConfig || {}; - //validate config value - var resolved; - if (originalConfig[options.clientConfig]) { - resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], { - code: 'InvalidConfiguration', - message: 'invalid "' + options.clientConfig + '" configuration. Expect "legacy" ' + - ' or "regional". Got "' + originalConfig[options.clientConfig] + '".' - }); - if (resolved) return resolved; - } - if (!AWS.util.isNode()) return resolved; - //validate environmental variable - if (Object.prototype.hasOwnProperty.call(process.env, options.env)) { - var envFlag = process.env[options.env]; - resolved = validateRegionalEndpointsFlagValue(envFlag, { - code: 'InvalidEnvironmentalVariable', - message: 'invalid ' + options.env + ' environmental variable. Expect "legacy" ' + - ' or "regional". Got "' + process.env[options.env] + '".' - }); - if (resolved) return resolved; - } - //validate shared config file - var profile = {}; - try { - var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); - profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; - } catch (e) {}; - if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) { - var fileFlag = profile[options.sharedConfig]; - resolved = validateRegionalEndpointsFlagValue(fileFlag, { - code: 'InvalidConfiguration', - message: 'invalid ' + options.sharedConfig + ' profile config. Expect "legacy" ' + - ' or "regional". Got "' + profile[options.sharedConfig] + '".' - }); - if (resolved) return resolved; - } - return resolved; -} +apiLoader.services['supplychain'] = {}; +AWS.SupplyChain = Service.defineService('supplychain', ['2024-01-01']); +Object.defineProperty(apiLoader.services['supplychain'], '2024-01-01', { + get: function get() { + var model = __nccwpck_require__(78323); + model.paginators = (__nccwpck_require__(25916)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); -module.exports = resolveRegionalEndpointsFlag; +module.exports = AWS.SupplyChain; /***/ }), -/***/ 28437: +/***/ 1099: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * The main AWS namespace - */ -var AWS = { util: __nccwpck_require__(77985) }; +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * @api private - * @!macro [new] nobrowser - * @note This feature is not supported in the browser environment of the SDK. - */ -var _hidden = {}; _hidden.toString(); // hack to parse macro +apiLoader.services['support'] = {}; +AWS.Support = Service.defineService('support', ['2013-04-15']); +Object.defineProperty(apiLoader.services['support'], '2013-04-15', { + get: function get() { + var model = __nccwpck_require__(20767); + model.paginators = (__nccwpck_require__(62491)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); -/** - * @api private - */ -module.exports = AWS; +module.exports = AWS.Support; -AWS.util.update(AWS, { - /** - * @constant - */ - VERSION: '2.1535.0', +/***/ }), - /** - * @api private - */ - Signers: {}, +/***/ 51288: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - */ - Protocol: { - Json: __nccwpck_require__(30083), - Query: __nccwpck_require__(90761), - Rest: __nccwpck_require__(98200), - RestJson: __nccwpck_require__(5883), - RestXml: __nccwpck_require__(15143) - }, +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - /** - * @api private - */ - XML: { - Builder: __nccwpck_require__(23546), - Parser: null // conditionally set based on environment +apiLoader.services['supportapp'] = {}; +AWS.SupportApp = Service.defineService('supportapp', ['2021-08-20']); +Object.defineProperty(apiLoader.services['supportapp'], '2021-08-20', { + get: function get() { + var model = __nccwpck_require__(94851); + model.paginators = (__nccwpck_require__(60546)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - JSON: { - Builder: __nccwpck_require__(47495), - Parser: __nccwpck_require__(5474) - }, +module.exports = AWS.SupportApp; - /** - * @api private - */ - Model: { - Api: __nccwpck_require__(17657), - Operation: __nccwpck_require__(28083), - Shape: __nccwpck_require__(71349), - Paginator: __nccwpck_require__(45938), - ResourceWaiter: __nccwpck_require__(41368) - }, - /** - * @api private - */ - apiLoader: __nccwpck_require__(52793), +/***/ }), - /** - * @api private - */ - EndpointCache: (__nccwpck_require__(96323)/* .EndpointCache */ .$) -}); -__nccwpck_require__(55948); -__nccwpck_require__(68903); -__nccwpck_require__(38110); -__nccwpck_require__(1556); -__nccwpck_require__(54995); -__nccwpck_require__(78652); -__nccwpck_require__(58743); -__nccwpck_require__(39925); -__nccwpck_require__(9897); -__nccwpck_require__(99127); -__nccwpck_require__(93985); +/***/ 32327: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @readonly - * @return [AWS.SequentialExecutor] a collection of global event listeners that - * are attached to every sent request. - * @see AWS.Request AWS.Request for a list of events to listen for - * @example Logging the time taken to send a request - * AWS.events.on('send', function startSend(resp) { - * resp.startTime = new Date().getTime(); - * }).on('complete', function calculateTime(resp) { - * var time = (new Date().getTime() - resp.startTime) / 1000; - * console.log('Request took ' + time + ' seconds'); - * }); - * - * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds' - */ -AWS.events = new AWS.SequentialExecutor(); +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -//create endpoint cache lazily -AWS.util.memoizedProperty(AWS, 'endpointCache', function() { - return new AWS.EndpointCache(AWS.config.endpointCacheSize); -}, true); +apiLoader.services['swf'] = {}; +AWS.SWF = Service.defineService('swf', ['2012-01-25']); +__nccwpck_require__(31987); +Object.defineProperty(apiLoader.services['swf'], '2012-01-25', { + get: function get() { + var model = __nccwpck_require__(11144); + model.paginators = (__nccwpck_require__(48039)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.SWF; /***/ }), -/***/ 53819: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 25910: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * Represents your AWS security credentials, specifically the - * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}. - * Creating a `Credentials` object allows you to pass around your - * security information to configuration and service objects. - * - * Note that this class typically does not need to be constructed manually, - * as the {AWS.Config} and {AWS.Service} classes both accept simple - * options hashes with the three keys. These structures will be converted - * into Credentials objects automatically. - * - * ## Expiring and Refreshing Credentials - * - * Occasionally credentials can expire in the middle of a long-running - * application. In this case, the SDK will automatically attempt to - * refresh the credentials from the storage location if the Credentials - * class implements the {refresh} method. - * - * If you are implementing a credential storage location, you - * will want to create a subclass of the `Credentials` class and - * override the {refresh} method. This method allows credentials to be - * retrieved from the backing store, be it a file system, database, or - * some network storage. The method should reset the credential attributes - * on the object. - * - * @!attribute expired - * @return [Boolean] whether the credentials have been expired and - * require a refresh. Used in conjunction with {expireTime}. - * @!attribute expireTime - * @return [Date] a time when credentials should be considered expired. Used - * in conjunction with {expired}. - * @!attribute accessKeyId - * @return [String] the AWS access key ID - * @!attribute secretAccessKey - * @return [String] the AWS secret access key - * @!attribute sessionToken - * @return [String] an optional AWS session token - */ -AWS.Credentials = AWS.util.inherit({ - /** - * A credentials object can be created using positional arguments or an options - * hash. - * - * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null) - * Creates a Credentials object with a given set of credential information - * as positional arguments. - * @param accessKeyId [String] the AWS access key ID - * @param secretAccessKey [String] the AWS secret access key - * @param sessionToken [String] the optional AWS session token - * @example Create a credentials object with AWS credentials - * var creds = new AWS.Credentials('akid', 'secret', 'session'); - * @overload AWS.Credentials(options) - * Creates a Credentials object with a given set of credential information - * as an options hash. - * @option options accessKeyId [String] the AWS access key ID - * @option options secretAccessKey [String] the AWS secret access key - * @option options sessionToken [String] the optional AWS session token - * @example Create a credentials object with AWS credentials - * var creds = new AWS.Credentials({ - * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session' - * }); - */ - constructor: function Credentials() { - // hide secretAccessKey from being displayed with util.inspect - AWS.util.hideProperties(this, ['secretAccessKey']); - - this.expired = false; - this.expireTime = null; - this.refreshCallbacks = []; - if (arguments.length === 1 && typeof arguments[0] === 'object') { - var creds = arguments[0].credentials || arguments[0]; - this.accessKeyId = creds.accessKeyId; - this.secretAccessKey = creds.secretAccessKey; - this.sessionToken = creds.sessionToken; - } else { - this.accessKeyId = arguments[0]; - this.secretAccessKey = arguments[1]; - this.sessionToken = arguments[2]; - } +apiLoader.services['synthetics'] = {}; +AWS.Synthetics = Service.defineService('synthetics', ['2017-10-11']); +Object.defineProperty(apiLoader.services['synthetics'], '2017-10-11', { + get: function get() { + var model = __nccwpck_require__(78752); + model.paginators = (__nccwpck_require__(61615)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @return [Integer] the number of seconds before {expireTime} during which - * the credentials will be considered expired. - */ - expiryWindow: 15, +module.exports = AWS.Synthetics; - /** - * @return [Boolean] whether the credentials object should call {refresh} - * @note Subclasses should override this method to provide custom refresh - * logic. - */ - needsRefresh: function needsRefresh() { - var currentTime = AWS.util.date.getDate().getTime(); - var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); - if (this.expireTime && adjustedTime > this.expireTime) { - return true; - } else { - return this.expired || !this.accessKeyId || !this.secretAccessKey; - } - }, +/***/ }), - /** - * Gets the existing credentials, refreshing them if they are not yet loaded - * or have expired. Users should call this method before using {refresh}, - * as this will not attempt to reload credentials when they are already - * loaded into the object. - * - * @callback callback function(err) - * When this callback is called with no error, it means either credentials - * do not need to be refreshed or refreshed credentials information has - * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, - * and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - */ - get: function get(callback) { - var self = this; - if (this.needsRefresh()) { - this.refresh(function(err) { - if (!err) self.expired = false; // reset expired flag - if (callback) callback(err); - }); - } else if (callback) { - callback(); - } +/***/ 44688: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['taxsettings'] = {}; +AWS.TaxSettings = Service.defineService('taxsettings', ['2018-05-10']); +Object.defineProperty(apiLoader.services['taxsettings'], '2018-05-10', { + get: function get() { + var model = __nccwpck_require__(82948); + model.paginators = (__nccwpck_require__(60890)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @!method getPromise() - * Returns a 'thenable' promise. - * Gets the existing credentials, refreshing them if they are not yet loaded - * or have expired. Users should call this method before using {refresh}, - * as this will not attempt to reload credentials when they are already - * loaded into the object. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function() - * Called if the promise is fulfilled. When this callback is called, it - * means either credentials do not need to be refreshed or refreshed - * credentials information has been loaded into the object (as the - * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). - * @callback rejectedCallback function(err) - * Called if the promise is rejected. - * @param err [Error] if an error occurred, this value will be filled - * @return [Promise] A promise that represents the state of the `get` call. - * @example Calling the `getPromise` method. - * var promise = credProvider.getPromise(); - * promise.then(function() { ... }, function(err) { ... }); - */ +module.exports = AWS.TaxSettings; - /** - * @!method refreshPromise() - * Returns a 'thenable' promise. - * Refreshes the credentials. Users should call {get} before attempting - * to forcibly refresh credentials. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function() - * Called if the promise is fulfilled. When this callback is called, it - * means refreshed credentials information has been loaded into the object - * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). - * @callback rejectedCallback function(err) - * Called if the promise is rejected. - * @param err [Error] if an error occurred, this value will be filled - * @return [Promise] A promise that represents the state of the `refresh` call. - * @example Calling the `refreshPromise` method. - * var promise = credProvider.refreshPromise(); - * promise.then(function() { ... }, function(err) { ... }); - */ - /** - * Refreshes the credentials. Users should call {get} before attempting - * to forcibly refresh credentials. - * - * @callback callback function(err) - * When this callback is called with no error, it means refreshed - * credentials information has been loaded into the object (as the - * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @note Subclasses should override this class to reset the - * {accessKeyId}, {secretAccessKey} and optional {sessionToken} - * on the credentials object and then call the callback with - * any error information. - * @see get - */ - refresh: function refresh(callback) { - this.expired = false; - callback(); - }, +/***/ }), - /** - * @api private - * @param callback - */ - coalesceRefresh: function coalesceRefresh(callback, sync) { - var self = this; - if (self.refreshCallbacks.push(callback) === 1) { - self.load(function onLoad(err) { - AWS.util.arrayEach(self.refreshCallbacks, function(callback) { - if (sync) { - callback(err); - } else { - // callback could throw, so defer to ensure all callbacks are notified - AWS.util.defer(function () { - callback(err); - }); - } - }); - self.refreshCallbacks.length = 0; - }); - } - }, +/***/ 58523: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - * @param callback - */ - load: function load(callback) { - callback(); - } +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['textract'] = {}; +AWS.Textract = Service.defineService('textract', ['2018-06-27']); +Object.defineProperty(apiLoader.services['textract'], '2018-06-27', { + get: function get() { + var model = __nccwpck_require__(49753); + model.paginators = (__nccwpck_require__(16270)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true }); -/** - * @api private - */ -AWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) { - this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); - this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); -}; +module.exports = AWS.Textract; -/** - * @api private - */ -AWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() { - delete this.prototype.getPromise; - delete this.prototype.refreshPromise; -}; -AWS.util.addPromises(AWS.Credentials); +/***/ }), + +/***/ 13610: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['timestreaminfluxdb'] = {}; +AWS.TimestreamInfluxDB = Service.defineService('timestreaminfluxdb', ['2023-01-27']); +Object.defineProperty(apiLoader.services['timestreaminfluxdb'], '2023-01-27', { + get: function get() { + var model = __nccwpck_require__(63987); + model.paginators = (__nccwpck_require__(25823)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.TimestreamInfluxDB; /***/ }), -/***/ 57083: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 24529: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); -var STS = __nccwpck_require__(57513); - -/** - * Represents temporary credentials retrieved from {AWS.STS}. Without any - * extra parameters, credentials will be fetched from the - * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the - * {AWS.STS.assumeRole} operation will be used to fetch credentials for the - * role instead. - * - * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in - * the way masterCredentials and refreshes are handled. - * AWS.ChainableTemporaryCredentials refreshes expired credentials using the - * masterCredentials passed by the user to support chaining of STS credentials. - * However, AWS.TemporaryCredentials recursively collapses the masterCredentials - * during instantiation, precluding the ability to refresh credentials which - * require intermediate, temporary credentials. - * - * For example, if the application should use RoleA, which must be assumed from - * RoleB, and the environment provides credentials which can assume RoleB, then - * AWS.ChainableTemporaryCredentials must be used to support refreshing the - * temporary credentials for RoleA: - * - * ```javascript - * var roleACreds = new AWS.ChainableTemporaryCredentials({ - * params: {RoleArn: 'RoleA'}, - * masterCredentials: new AWS.ChainableTemporaryCredentials({ - * params: {RoleArn: 'RoleB'}, - * masterCredentials: new AWS.EnvironmentCredentials('AWS') - * }) - * }); - * ``` - * - * If AWS.TemporaryCredentials had been used in the previous example, - * `roleACreds` would fail to refresh because `roleACreds` would - * use the environment credentials for the AssumeRole request. - * - * Another difference is that AWS.ChainableTemporaryCredentials creates the STS - * service instance during instantiation while AWS.TemporaryCredentials creates - * the STS service instance during the first refresh. Creating the service - * instance during instantiation effectively captures the master credentials - * from the global config, so that subsequent changes to the global config do - * not affect the master credentials used to refresh the temporary credentials. - * - * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned - * to AWS.config.credentials: - * - * ```javascript - * var envCreds = new AWS.EnvironmentCredentials('AWS'); - * AWS.config.credentials = envCreds; - * // masterCredentials will be envCreds - * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ - * params: {RoleArn: '...'} - * }); - * ``` - * - * Similarly, to use the CredentialProviderChain's default providers as the - * master credentials, simply create a new instance of - * AWS.ChainableTemporaryCredentials: - * - * ```javascript - * AWS.config.credentials = new ChainableTemporaryCredentials({ - * params: {RoleArn: '...'} - * }); - * ``` - * - * @!attribute service - * @return [AWS.STS] the STS service instance used to - * get and refresh temporary credentials from AWS STS. - * @note (see constructor) - */ -AWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, { - /** - * Creates a new temporary credentials object. - * - * @param options [map] a set of options - * @option options params [map] ({}) a map of options that are passed to the - * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. - * If a `RoleArn` parameter is passed in, credentials will be based on the - * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must - * also be passed in or an error will be thrown. - * @option options masterCredentials [AWS.Credentials] the master credentials - * used to get and refresh temporary credentials from AWS STS. By default, - * AWS.config.credentials or AWS.config.credentialProvider will be used. - * @option options tokenCodeFn [Function] (null) Function to provide - * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function - * is called with value of `SerialNumber` and `callback`, and should provide - * the `TokenCode` or an error to the callback in the format - * `callback(err, token)`. - * @example Creating a new credentials object for generic temporary credentials - * AWS.config.credentials = new AWS.ChainableTemporaryCredentials(); - * @example Creating a new credentials object for an IAM role - * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ - * params: { - * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials' - * } - * }); - * @see AWS.STS.assumeRole - * @see AWS.STS.getSessionToken - */ - constructor: function ChainableTemporaryCredentials(options) { - AWS.Credentials.call(this); - options = options || {}; - this.errorCode = 'ChainableTemporaryCredentialsProviderFailure'; - this.expired = true; - this.tokenCodeFn = null; +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - var params = AWS.util.copy(options.params) || {}; - if (params.RoleArn) { - params.RoleSessionName = params.RoleSessionName || 'temporary-credentials'; - } - if (params.SerialNumber) { - if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) { - throw new AWS.util.error( - new Error('tokenCodeFn must be a function when params.SerialNumber is given'), - {code: this.errorCode} - ); - } else { - this.tokenCodeFn = options.tokenCodeFn; - } - } - var config = AWS.util.merge( - { - params: params, - credentials: options.masterCredentials || AWS.config.credentials - }, - options.stsConfig || {} - ); - this.service = new STS(config); +apiLoader.services['timestreamquery'] = {}; +AWS.TimestreamQuery = Service.defineService('timestreamquery', ['2018-11-01']); +Object.defineProperty(apiLoader.services['timestreamquery'], '2018-11-01', { + get: function get() { + var model = __nccwpck_require__(70457); + model.paginators = (__nccwpck_require__(97217)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * Refreshes credentials using {AWS.STS.assumeRole} or - * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed - * to the credentials {constructor}. - * - * @callback callback function(err) - * Called when the STS service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see AWS.Credentials.get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, +module.exports = AWS.TimestreamQuery; - /** - * @api private - * @param callback - */ - load: function load(callback) { - var self = this; - var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken'; - this.getTokenCode(function (err, tokenCode) { - var params = {}; - if (err) { - callback(err); - return; - } - if (tokenCode) { - params.TokenCode = tokenCode; - } - self.service[operation](params, function (err, data) { - if (!err) { - self.service.credentialsFrom(data, self); - } - callback(err); - }); - }); - }, - /** - * @api private - */ - getTokenCode: function getTokenCode(callback) { - var self = this; - if (this.tokenCodeFn) { - this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) { - if (err) { - var message = err; - if (err instanceof Error) { - message = err.message; - } - callback( - AWS.util.error( - new Error('Error fetching MFA token: ' + message), - { code: self.errorCode} - ) - ); - return; - } - callback(null, token); - }); - } else { - callback(null); - } - } +/***/ }), + +/***/ 1573: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['timestreamwrite'] = {}; +AWS.TimestreamWrite = Service.defineService('timestreamwrite', ['2018-11-01']); +Object.defineProperty(apiLoader.services['timestreamwrite'], '2018-11-01', { + get: function get() { + var model = __nccwpck_require__(8368); + model.paginators = (__nccwpck_require__(89653)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true }); +module.exports = AWS.TimestreamWrite; + /***/ }), -/***/ 3498: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 15300: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); -var CognitoIdentity = __nccwpck_require__(58291); -var STS = __nccwpck_require__(57513); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * Represents credentials retrieved from STS Web Identity Federation using - * the Amazon Cognito Identity service. - * - * By default this provider gets credentials using the - * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which - * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito - * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to - * obtain an `IdentityId`. If the identity or identity pool is not configured in - * the Amazon Cognito Console to use IAM roles with the appropriate permissions, - * then additionally a `RoleArn` is required containing the ARN of the IAM trust - * policy for the Amazon Cognito role that the user will log into. If a `RoleArn` - * is provided, then this provider gets credentials using the - * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an - * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}. - * - * In addition, if this credential provider is used to provide authenticated - * login, the `Logins` map may be set to the tokens provided by the respective - * identity providers. See {constructor} for an example on creating a credentials - * object with proper property values. - * - * ## Refreshing Credentials from Identity Service - * - * In addition to AWS credentials expiring after a given amount of time, the - * login token from the identity provider will also expire. Once this token - * expires, it will not be usable to refresh AWS credentials, and another - * token will be needed. The SDK does not manage refreshing of the token value, - * but this can be done through a "refresh token" supported by most identity - * providers. Consult the documentation for the identity provider for refreshing - * tokens. Once the refreshed token is acquired, you should make sure to update - * this new token in the credentials object's {params} property. The following - * code will update the WebIdentityToken, assuming you have retrieved an updated - * token from the identity provider: - * - * ```javascript - * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken; - * ``` - * - * Future calls to `credentials.refresh()` will now use the new token. - * - * @!attribute params - * @return [map] the map of params passed to - * {AWS.CognitoIdentity.getId}, - * {AWS.CognitoIdentity.getOpenIdToken}, and - * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the - * `params.WebIdentityToken` property. - * @!attribute data - * @return [map] the raw data response from the call to - * {AWS.CognitoIdentity.getCredentialsForIdentity}, or - * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get - * access to other properties from the response. - * @!attribute identityId - * @return [String] the Cognito ID returned by the last call to - * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual - * final resolved identity ID from Amazon Cognito. - */ -AWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, { - /** - * @api private - */ - localStorageKey: { - id: 'aws.cognito.identity-id.', - providers: 'aws.cognito.identity-providers.' +apiLoader.services['tnb'] = {}; +AWS.Tnb = Service.defineService('tnb', ['2008-10-21']); +Object.defineProperty(apiLoader.services['tnb'], '2008-10-21', { + get: function get() { + var model = __nccwpck_require__(1433); + model.paginators = (__nccwpck_require__(55995)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * Creates a new credentials object. - * @example Creating a new credentials object - * AWS.config.credentials = new AWS.CognitoIdentityCredentials({ - * - * // either IdentityPoolId or IdentityId is required - * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below) - * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity - * // or AWS.CognitoIdentity.getOpenIdToken (linked below) - * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030', - * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f' - * - * // optional, only necessary when the identity pool is not configured - * // to use IAM roles in the Amazon Cognito Console - * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below) - * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity', - * - * // optional tokens, used for authenticated login - * // See the Logins param for AWS.CognitoIdentity.getID (linked below) - * Logins: { - * 'graph.facebook.com': 'FBTOKEN', - * 'www.amazon.com': 'AMAZONTOKEN', - * 'accounts.google.com': 'GOOGLETOKEN', - * 'api.twitter.com': 'TWITTERTOKEN', - * 'www.digits.com': 'DIGITSTOKEN' - * }, - * - * // optional name, defaults to web-identity - * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below) - * RoleSessionName: 'web', - * - * // optional, only necessary when application runs in a browser - * // and multiple users are signed in at once, used for caching - * LoginId: 'example@gmail.com' - * - * }, { - * // optionally provide configuration to apply to the underlying service clients - * // if configuration is not provided, then configuration will be pulled from AWS.config - * - * // region should match the region your identity pool is located in - * region: 'us-east-1', - * - * // specify timeout options - * httpOptions: { - * timeout: 100 - * } - * }); - * @see AWS.CognitoIdentity.getId - * @see AWS.CognitoIdentity.getCredentialsForIdentity - * @see AWS.STS.assumeRoleWithWebIdentity - * @see AWS.CognitoIdentity.getOpenIdToken - * @see AWS.Config - * @note If a region is not provided in the global AWS.config, or - * specified in the `clientConfig` to the CognitoIdentityCredentials - * constructor, you may encounter a 'Missing credentials in config' error - * when calling making a service call. - */ - constructor: function CognitoIdentityCredentials(params, clientConfig) { - AWS.Credentials.call(this); - this.expired = true; - this.params = params; - this.data = null; - this._identityId = null; - this._clientConfig = AWS.util.copy(clientConfig || {}); - this.loadCachedId(); - var self = this; - Object.defineProperty(this, 'identityId', { - get: function() { - self.loadCachedId(); - return self._identityId || self.params.IdentityId; - }, - set: function(identityId) { - self._identityId = identityId; - } - }); - }, +module.exports = AWS.Tnb; - /** - * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity}, - * or {AWS.STS.assumeRoleWithWebIdentity}. - * - * @callback callback function(err) - * Called when the STS service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see AWS.Credentials.get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, - /** - * @api private - * @param callback - */ - load: function load(callback) { - var self = this; - self.createClients(); - self.data = null; - self._identityId = null; - self.getId(function(err) { - if (!err) { - if (!self.params.RoleArn) { - self.getCredentialsForIdentity(callback); - } else { - self.getCredentialsFromSTS(callback); - } - } else { - self.clearIdOnNotAuthorized(err); - callback(err); - } - }); - }, +/***/ }), - /** - * Clears the cached Cognito ID associated with the currently configured - * identity pool ID. Use this to manually invalidate your cache if - * the identity pool ID was deleted. - */ - clearCachedId: function clearCache() { - this._identityId = null; - delete this.params.IdentityId; +/***/ 75811: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var poolId = this.params.IdentityPoolId; - var loginId = this.params.LoginId || ''; - delete this.storage[this.localStorageKey.id + poolId + loginId]; - delete this.storage[this.localStorageKey.providers + poolId + loginId]; +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['transcribeservice'] = {}; +AWS.TranscribeService = Service.defineService('transcribeservice', ['2017-10-26']); +Object.defineProperty(apiLoader.services['transcribeservice'], '2017-10-26', { + get: function get() { + var model = __nccwpck_require__(47294); + model.paginators = (__nccwpck_require__(25395)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) { - var self = this; - if (err.code == 'NotAuthorizedException') { - self.clearCachedId(); - } +module.exports = AWS.TranscribeService; + + +/***/ }), + +/***/ 51585: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['transfer'] = {}; +AWS.Transfer = Service.defineService('transfer', ['2018-11-05']); +Object.defineProperty(apiLoader.services['transfer'], '2018-11-05', { + get: function get() { + var model = __nccwpck_require__(93419); + model.paginators = (__nccwpck_require__(65803)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(45405)/* .waiters */ .V); + return model; }, + enumerable: true, + configurable: true +}); - /** - * Retrieves a Cognito ID, loading from cache if it was already retrieved - * on this device. - * - * @callback callback function(err, identityId) - * @param err [Error, null] an error object if the call failed or null if - * it succeeded. - * @param identityId [String, null] if successful, the callback will return - * the Cognito ID. - * @note If not loaded explicitly, the Cognito ID is loaded and stored in - * localStorage in the browser environment of a device. - * @api private - */ - getId: function getId(callback) { - var self = this; - if (typeof self.params.IdentityId === 'string') { - return callback(null, self.params.IdentityId); - } +module.exports = AWS.Transfer; - self.cognito.getId(function(err, data) { - if (!err && data.IdentityId) { - self.params.IdentityId = data.IdentityId; - callback(null, data.IdentityId); - } else { - callback(err); - } - }); + +/***/ }), + +/***/ 72544: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['translate'] = {}; +AWS.Translate = Service.defineService('translate', ['2017-07-01']); +Object.defineProperty(apiLoader.services['translate'], '2017-07-01', { + get: function get() { + var model = __nccwpck_require__(61084); + model.paginators = (__nccwpck_require__(40304)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); +module.exports = AWS.Translate; - /** - * @api private - */ - loadCredentials: function loadCredentials(data, credentials) { - if (!data || !credentials) return; - credentials.expired = false; - credentials.accessKeyId = data.Credentials.AccessKeyId; - credentials.secretAccessKey = data.Credentials.SecretKey; - credentials.sessionToken = data.Credentials.SessionToken; - credentials.expireTime = data.Credentials.Expiration; + +/***/ }), + +/***/ 4992: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['trustedadvisor'] = {}; +AWS.TrustedAdvisor = Service.defineService('trustedadvisor', ['2022-09-15']); +Object.defineProperty(apiLoader.services['trustedadvisor'], '2022-09-15', { + get: function get() { + var model = __nccwpck_require__(3889); + model.paginators = (__nccwpck_require__(89124)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - getCredentialsForIdentity: function getCredentialsForIdentity(callback) { - var self = this; - self.cognito.getCredentialsForIdentity(function(err, data) { - if (!err) { - self.cacheId(data); - self.data = data; - self.loadCredentials(self.data, self); - } else { - self.clearIdOnNotAuthorized(err); - } - callback(err); - }); +module.exports = AWS.TrustedAdvisor; + + +/***/ }), + +/***/ 35604: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['verifiedpermissions'] = {}; +AWS.VerifiedPermissions = Service.defineService('verifiedpermissions', ['2021-12-01']); +Object.defineProperty(apiLoader.services['verifiedpermissions'], '2021-12-01', { + get: function get() { + var model = __nccwpck_require__(31407); + model.paginators = (__nccwpck_require__(85997)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(14021)/* .waiters */ .V); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - getCredentialsFromSTS: function getCredentialsFromSTS(callback) { - var self = this; - self.cognito.getOpenIdToken(function(err, data) { - if (!err) { - self.cacheId(data); - self.params.WebIdentityToken = data.Token; - self.webIdentityCredentials.refresh(function(webErr) { - if (!webErr) { - self.data = self.webIdentityCredentials.data; - self.sts.credentialsFrom(self.data, self); - } - callback(webErr); - }); - } else { - self.clearIdOnNotAuthorized(err); - callback(err); - } - }); +module.exports = AWS.VerifiedPermissions; + + +/***/ }), + +/***/ 28747: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['voiceid'] = {}; +AWS.VoiceID = Service.defineService('voiceid', ['2021-09-27']); +Object.defineProperty(apiLoader.services['voiceid'], '2021-09-27', { + get: function get() { + var model = __nccwpck_require__(9375); + model.paginators = (__nccwpck_require__(59512)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - loadCachedId: function loadCachedId() { - var self = this; +module.exports = AWS.VoiceID; - // in the browser we source default IdentityId from localStorage - if (AWS.util.isBrowser() && !self.params.IdentityId) { - var id = self.getStorage('id'); - if (id && self.params.Logins) { - var actualProviders = Object.keys(self.params.Logins); - var cachedProviders = - (self.getStorage('providers') || '').split(','); - // only load ID if at least one provider used this ID before - var intersect = cachedProviders.filter(function(n) { - return actualProviders.indexOf(n) !== -1; - }); - if (intersect.length !== 0) { - self.params.IdentityId = id; - } - } else if (id) { - self.params.IdentityId = id; - } - } +/***/ }), + +/***/ 78952: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['vpclattice'] = {}; +AWS.VPCLattice = Service.defineService('vpclattice', ['2022-11-30']); +Object.defineProperty(apiLoader.services['vpclattice'], '2022-11-30', { + get: function get() { + var model = __nccwpck_require__(49656); + model.paginators = (__nccwpck_require__(98717)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - createClients: function() { - var clientConfig = this._clientConfig; - this.webIdentityCredentials = this.webIdentityCredentials || - new AWS.WebIdentityCredentials(this.params, clientConfig); - if (!this.cognito) { - var cognitoConfig = AWS.util.merge({}, clientConfig); - cognitoConfig.params = this.params; - this.cognito = new CognitoIdentity(cognitoConfig); - } - this.sts = this.sts || new STS(clientConfig); +module.exports = AWS.VPCLattice; + + +/***/ }), + +/***/ 72742: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['waf'] = {}; +AWS.WAF = Service.defineService('waf', ['2015-08-24']); +Object.defineProperty(apiLoader.services['waf'], '2015-08-24', { + get: function get() { + var model = __nccwpck_require__(37925); + model.paginators = (__nccwpck_require__(65794)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - cacheId: function cacheId(data) { - this._identityId = data.IdentityId; - this.params.IdentityId = this._identityId; +module.exports = AWS.WAF; - // cache this IdentityId in browser localStorage if possible - if (AWS.util.isBrowser()) { - this.setStorage('id', data.IdentityId); - if (this.params.Logins) { - this.setStorage('providers', Object.keys(this.params.Logins).join(',')); - } - } - }, +/***/ }), - /** - * @api private - */ - getStorage: function getStorage(key) { - return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')]; - }, +/***/ 23153: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - */ - setStorage: function setStorage(key, val) { - try { - this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val; - } catch (_) {} +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['wafregional'] = {}; +AWS.WAFRegional = Service.defineService('wafregional', ['2016-11-28']); +Object.defineProperty(apiLoader.services['wafregional'], '2016-11-28', { + get: function get() { + var model = __nccwpck_require__(20014); + model.paginators = (__nccwpck_require__(66829)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - storage: (function() { - try { - var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ? - window.localStorage : {}; +module.exports = AWS.WAFRegional; - // Test set/remove which would throw an error in Safari's private browsing - storage['aws.test-storage'] = 'foobar'; - delete storage['aws.test-storage']; - return storage; - } catch (_) { - return {}; - } - })() +/***/ }), + +/***/ 50353: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['wafv2'] = {}; +AWS.WAFV2 = Service.defineService('wafv2', ['2019-07-29']); +Object.defineProperty(apiLoader.services['wafv2'], '2019-07-29', { + get: function get() { + var model = __nccwpck_require__(51872); + model.paginators = (__nccwpck_require__(33900)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true }); +module.exports = AWS.WAFV2; + /***/ }), -/***/ 36965: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 86263: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * Creates a credential provider chain that searches for AWS credentials - * in a list of credential providers specified by the {providers} property. - * - * By default, the chain will use the {defaultProviders} to resolve credentials. - * These providers will look in the environment using the - * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes. - * - * ## Setting Providers - * - * Each provider in the {providers} list should be a function that returns - * a {AWS.Credentials} object, or a hardcoded credentials object. The function - * form allows for delayed execution of the credential construction. - * - * ## Resolving Credentials from a Chain - * - * Call {resolve} to return the first valid credential object that can be - * loaded by the provider chain. - * - * For example, to resolve a chain with a custom provider that checks a file - * on disk after the set of {defaultProviders}: - * - * ```javascript - * var diskProvider = new AWS.FileSystemCredentials('./creds.json'); - * var chain = new AWS.CredentialProviderChain(); - * chain.providers.push(diskProvider); - * chain.resolve(); - * ``` - * - * The above code will return the `diskProvider` object if the - * file contains credentials and the `defaultProviders` do not contain - * any credential settings. - * - * @!attribute providers - * @return [Array] - * a list of credentials objects or functions that return credentials - * objects. If the provider is a function, the function will be - * executed lazily when the provider needs to be checked for valid - * credentials. By default, this object will be set to the - * {defaultProviders}. - * @see defaultProviders - */ -AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, { - - /** - * Creates a new CredentialProviderChain with a default set of providers - * specified by {defaultProviders}. - */ - constructor: function CredentialProviderChain(providers) { - if (providers) { - this.providers = providers; - } else { - this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0); - } - this.resolveCallbacks = []; +apiLoader.services['wellarchitected'] = {}; +AWS.WellArchitected = Service.defineService('wellarchitected', ['2020-03-31']); +Object.defineProperty(apiLoader.services['wellarchitected'], '2020-03-31', { + get: function get() { + var model = __nccwpck_require__(19249); + model.paginators = (__nccwpck_require__(54693)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @!method resolvePromise() - * Returns a 'thenable' promise. - * Resolves the provider chain by searching for the first set of - * credentials in {providers}. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function(credentials) - * Called if the promise is fulfilled and the provider resolves the chain - * to a credentials object - * @param credentials [AWS.Credentials] the credentials object resolved - * by the provider chain. - * @callback rejectedCallback function(error) - * Called if the promise is rejected. - * @param err [Error] the error object returned if no credentials are found. - * @return [Promise] A promise that represents the state of the `resolve` method call. - * @example Calling the `resolvePromise` method. - * var promise = chain.resolvePromise(); - * promise.then(function(credentials) { ... }, function(err) { ... }); - */ +module.exports = AWS.WellArchitected; - /** - * Resolves the provider chain by searching for the first set of - * credentials in {providers}. - * - * @callback callback function(err, credentials) - * Called when the provider resolves the chain to a credentials object - * or null if no credentials can be found. - * - * @param err [Error] the error object returned if no credentials are - * found. - * @param credentials [AWS.Credentials] the credentials object resolved - * by the provider chain. - * @return [AWS.CredentialProviderChain] the provider, for chaining. - */ - resolve: function resolve(callback) { - var self = this; - if (self.providers.length === 0) { - callback(new Error('No providers')); - return self; - } - if (self.resolveCallbacks.push(callback) === 1) { - var index = 0; - var providers = self.providers.slice(0); +/***/ }), - function resolveNext(err, creds) { - if ((!err && creds) || index === providers.length) { - AWS.util.arrayEach(self.resolveCallbacks, function (callback) { - callback(err, creds); - }); - self.resolveCallbacks.length = 0; - return; - } +/***/ 85266: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var provider = providers[index++]; - if (typeof provider === 'function') { - creds = provider.call(); - } else { - creds = provider; - } +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - if (creds.get) { - creds.get(function (getErr) { - resolveNext(getErr, getErr ? null : creds); - }); - } else { - resolveNext(null, creds); - } - } +apiLoader.services['wisdom'] = {}; +AWS.Wisdom = Service.defineService('wisdom', ['2020-10-19']); +Object.defineProperty(apiLoader.services['wisdom'], '2020-10-19', { + get: function get() { + var model = __nccwpck_require__(94385); + model.paginators = (__nccwpck_require__(54852)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); - resolveNext(); - } +module.exports = AWS.Wisdom; - return self; - } -}); -/** - * The default set of providers used by a vanilla CredentialProviderChain. - * - * In the browser: - * - * ```javascript - * AWS.CredentialProviderChain.defaultProviders = [] - * ``` - * - * In Node.js: - * - * ```javascript - * AWS.CredentialProviderChain.defaultProviders = [ - * function () { return new AWS.EnvironmentCredentials('AWS'); }, - * function () { return new AWS.EnvironmentCredentials('AMAZON'); }, - * function () { return new AWS.SsoCredentials(); }, - * function () { return new AWS.SharedIniFileCredentials(); }, - * function () { return new AWS.ECSCredentials(); }, - * function () { return new AWS.ProcessCredentials(); }, - * function () { return new AWS.TokenFileWebIdentityCredentials(); }, - * function () { return new AWS.EC2MetadataCredentials() } - * ] - * ``` - */ -AWS.CredentialProviderChain.defaultProviders = []; +/***/ }), -/** - * @api private - */ -AWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { - this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); -}; +/***/ 38835: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @api private - */ -AWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { - delete this.prototype.resolvePromise; -}; +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -AWS.util.addPromises(AWS.CredentialProviderChain); +apiLoader.services['workdocs'] = {}; +AWS.WorkDocs = Service.defineService('workdocs', ['2016-05-01']); +Object.defineProperty(apiLoader.services['workdocs'], '2016-05-01', { + get: function get() { + var model = __nccwpck_require__(41052); + model.paginators = (__nccwpck_require__(94768)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.WorkDocs; /***/ }), -/***/ 73379: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 48579: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); -__nccwpck_require__(25768); - -/** - * Represents credentials received from the metadata service on an EC2 instance. - * - * By default, this class will connect to the metadata service using - * {AWS.MetadataService} and attempt to load any available credentials. If it - * can connect, and credentials are available, these will be used with zero - * configuration. - * - * This credentials class will by default timeout after 1 second of inactivity - * and retry 3 times. - * If your requests to the EC2 metadata service are timing out, you can increase - * these values by configuring them directly: - * - * ```javascript - * AWS.config.credentials = new AWS.EC2MetadataCredentials({ - * httpOptions: { timeout: 5000 }, // 5 second timeout - * maxRetries: 10, // retry 10 times - * retryDelayOptions: { base: 200 }, // see AWS.Config for information - * logger: console // see AWS.Config for information - * ec2MetadataV1Disabled: false // whether to block IMDS v1 fallback. - * }); - * ``` - * - * If your requests are timing out in connecting to the metadata service, such - * as when testing on a development machine, you can use the connectTimeout - * option, specified in milliseconds, which also defaults to 1 second. - * - * If the requests failed or returns expired credentials, it will - * extend the expiration of current credential, with a warning message. For more - * information, please go to: - * https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html - * - * @!attribute originalExpiration - * @return [Date] The optional original expiration of the current credential. - * In case of AWS outage, the EC2 metadata will extend expiration of the - * existing credential. - * - * @see AWS.Config.retryDelayOptions - * @see AWS.Config.logger - * - * @!macro nobrowser - */ -AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { - constructor: function EC2MetadataCredentials(options) { - AWS.Credentials.call(this); - - options = options ? AWS.util.copy(options) : {}; - options = AWS.util.merge( - {maxRetries: this.defaultMaxRetries}, options); - if (!options.httpOptions) options.httpOptions = {}; - options.httpOptions = AWS.util.merge( - {timeout: this.defaultTimeout, - connectTimeout: this.defaultConnectTimeout}, - options.httpOptions); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - this.metadataService = new AWS.MetadataService(options); - this.logger = options.logger || AWS.config && AWS.config.logger; +apiLoader.services['worklink'] = {}; +AWS.WorkLink = Service.defineService('worklink', ['2018-09-25']); +Object.defineProperty(apiLoader.services['worklink'], '2018-09-25', { + get: function get() { + var model = __nccwpck_require__(37178); + model.paginators = (__nccwpck_require__(74073)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * @api private - */ - defaultTimeout: 1000, +module.exports = AWS.WorkLink; - /** - * @api private - */ - defaultConnectTimeout: 1000, - /** - * @api private - */ - defaultMaxRetries: 3, +/***/ }), - /** - * The original expiration of the current credential. In case of AWS - * outage, the EC2 metadata will extend expiration of the existing - * credential. - */ - originalExpiration: undefined, +/***/ 38374: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Loads the credentials from the instance metadata service - * - * @callback callback function(err) - * Called when the instance metadata service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; - /** - * @api private - * @param callback - */ - load: function load(callback) { - var self = this; - self.metadataService.loadCredentials(function(err, creds) { - if (err) { - if (self.hasLoadedCredentials()) { - self.extendExpirationIfExpired(); - callback(); - } else { - callback(err); - } - } else { - self.setCredentials(creds); - self.extendExpirationIfExpired(); - callback(); - } - }); +apiLoader.services['workmail'] = {}; +AWS.WorkMail = Service.defineService('workmail', ['2017-10-01']); +Object.defineProperty(apiLoader.services['workmail'], '2017-10-01', { + get: function get() { + var model = __nccwpck_require__(93150); + model.paginators = (__nccwpck_require__(5158)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * Whether this credential has been loaded. - * @api private - */ - hasLoadedCredentials: function hasLoadedCredentials() { - return this.AccessKeyId && this.secretAccessKey; - }, +module.exports = AWS.WorkMail; - /** - * if expired, extend the expiration by 15 minutes base plus a jitter of 5 - * minutes range. - * @api private - */ - extendExpirationIfExpired: function extendExpirationIfExpired() { - if (this.needsRefresh()) { - this.originalExpiration = this.originalExpiration || this.expireTime; - this.expired = false; - var nextTimeout = 15 * 60 + Math.floor(Math.random() * 5 * 60); - var currentTime = AWS.util.date.getDate().getTime(); - this.expireTime = new Date(currentTime + nextTimeout * 1000); - // TODO: add doc link; - this.logger.warn('Attempting credential expiration extension due to a ' - + 'credential service availability issue. A refresh of these ' - + 'credentials will be attempted again at ' + this.expireTime - + '\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html'); - } - }, - /** - * Update the credential with new credential responded from EC2 metadata - * service. - * @api private - */ - setCredentials: function setCredentials(creds) { - var currentTime = AWS.util.date.getDate().getTime(); - var expireTime = new Date(creds.Expiration); - this.expired = currentTime >= expireTime ? true : false; - this.metadata = creds; - this.accessKeyId = creds.AccessKeyId; - this.secretAccessKey = creds.SecretAccessKey; - this.sessionToken = creds.Token; - this.expireTime = expireTime; - } +/***/ }), + +/***/ 67025: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; + +apiLoader.services['workmailmessageflow'] = {}; +AWS.WorkMailMessageFlow = Service.defineService('workmailmessageflow', ['2019-05-01']); +Object.defineProperty(apiLoader.services['workmailmessageflow'], '2019-05-01', { + get: function get() { + var model = __nccwpck_require__(57733); + model.paginators = (__nccwpck_require__(85646)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true }); +module.exports = AWS.WorkMailMessageFlow; + /***/ }), -/***/ 10645: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 25513: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * Represents credentials received from relative URI specified in the ECS container. - * - * This class will request refreshable credentials from the relative URI - * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the - * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials - * are returned in the response, these will be used with zero configuration. - * - * This credentials class will by default timeout after 1 second of inactivity - * and retry 3 times. - * If your requests to the relative URI are timing out, you can increase - * the value by configuring them directly: - * - * ```javascript - * AWS.config.credentials = new AWS.ECSCredentials({ - * httpOptions: { timeout: 5000 }, // 5 second timeout - * maxRetries: 10, // retry 10 times - * retryDelayOptions: { base: 200 } // see AWS.Config for information - * }); - * ``` - * - * @see AWS.Config.retryDelayOptions - * - * @!macro nobrowser - */ -AWS.ECSCredentials = AWS.RemoteCredentials; +apiLoader.services['workspaces'] = {}; +AWS.WorkSpaces = Service.defineService('workspaces', ['2015-04-08']); +Object.defineProperty(apiLoader.services['workspaces'], '2015-04-08', { + get: function get() { + var model = __nccwpck_require__(97805); + model.paginators = (__nccwpck_require__(27769)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.WorkSpaces; /***/ }), -/***/ 57714: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 22033: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * Represents credentials from the environment. - * - * By default, this class will look for the matching environment variables - * prefixed by a given {envPrefix}. The un-prefixed environment variable names - * for each credential value is listed below: - * - * ```javascript - * accessKeyId: ACCESS_KEY_ID - * secretAccessKey: SECRET_ACCESS_KEY - * sessionToken: SESSION_TOKEN - * ``` - * - * With the default prefix of 'AWS', the environment variables would be: - * - * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN - * - * @!attribute envPrefix - * @readonly - * @return [String] the prefix for the environment variable names excluding - * the separating underscore ('_'). - */ -AWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, { - - /** - * Creates a new EnvironmentCredentials class with a given variable - * prefix {envPrefix}. For example, to load credentials using the 'AWS' - * prefix: - * - * ```javascript - * var creds = new AWS.EnvironmentCredentials('AWS'); - * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var - * ``` - * - * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment - * variables. Do not include the separating underscore. - */ - constructor: function EnvironmentCredentials(envPrefix) { - AWS.Credentials.call(this); - this.envPrefix = envPrefix; - this.get(function() {}); +apiLoader.services['workspacesthinclient'] = {}; +AWS.WorkSpacesThinClient = Service.defineService('workspacesthinclient', ['2023-08-22']); +Object.defineProperty(apiLoader.services['workspacesthinclient'], '2023-08-22', { + get: function get() { + var model = __nccwpck_require__(24229); + model.paginators = (__nccwpck_require__(52084)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * Loads credentials from the environment using the prefixed - * environment variables. - * - * @callback callback function(err) - * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and - * SESSION_TOKEN environment variables are read. When this callback is - * called with no error, it means that the credentials information has - * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, - * and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - if (!callback) callback = AWS.util.fn.callback; +module.exports = AWS.WorkSpacesThinClient; - if (!process || !process.env) { - callback(AWS.util.error( - new Error('No process info or environment variables available'), - { code: 'EnvironmentCredentialsProviderFailure' } - )); - return; - } - var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN']; - var values = []; +/***/ }), - for (var i = 0; i < keys.length; i++) { - var prefix = ''; - if (this.envPrefix) prefix = this.envPrefix + '_'; - values[i] = process.env[prefix + keys[i]]; - if (!values[i] && keys[i] !== 'SESSION_TOKEN') { - callback(AWS.util.error( - new Error('Variable ' + prefix + keys[i] + ' not set.'), - { code: 'EnvironmentCredentialsProviderFailure' } - )); - return; - } - } +/***/ 94124: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.expired = false; - AWS.Credentials.apply(this, values); - callback(); - } +__nccwpck_require__(73639); +var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; +apiLoader.services['workspacesweb'] = {}; +AWS.WorkSpacesWeb = Service.defineService('workspacesweb', ['2020-07-08']); +Object.defineProperty(apiLoader.services['workspacesweb'], '2020-07-08', { + get: function get() { + var model = __nccwpck_require__(47128); + model.paginators = (__nccwpck_require__(43497)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true }); +module.exports = AWS.WorkSpacesWeb; + /***/ }), -/***/ 27454: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 41548: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); +var Service = AWS.Service; +var apiLoader = AWS.apiLoader; -/** - * Represents credentials from a JSON file on disk. - * If the credentials expire, the SDK can {refresh} the credentials - * from the file. - * - * The format of the file should be similar to the options passed to - * {AWS.Config}: - * - * ```javascript - * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'} - * ``` - * - * @example Loading credentials from disk - * var creds = new AWS.FileSystemCredentials('./configuration.json'); - * creds.accessKeyId == 'AKID' - * - * @!attribute filename - * @readonly - * @return [String] the path to the JSON file on disk containing the - * credentials. - * @!macro nobrowser - */ -AWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, { - - /** - * @overload AWS.FileSystemCredentials(filename) - * Creates a new FileSystemCredentials object from a filename - * - * @param filename [String] the path on disk to the JSON file to load. - */ - constructor: function FileSystemCredentials(filename) { - AWS.Credentials.call(this); - this.filename = filename; - this.get(function() {}); +apiLoader.services['xray'] = {}; +AWS.XRay = Service.defineService('xray', ['2016-04-12']); +Object.defineProperty(apiLoader.services['xray'], '2016-04-12', { + get: function get() { + var model = __nccwpck_require__(97355); + model.paginators = (__nccwpck_require__(97949)/* .pagination */ .o); + return model; }, + enumerable: true, + configurable: true +}); - /** - * Loads the credentials from the {filename} on disk. - * - * @callback callback function(err) - * Called after the JSON file on disk is read and parsed. When this callback - * is called with no error, it means that the credentials information - * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`, - * and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - if (!callback) callback = AWS.util.fn.callback; - try { - var creds = JSON.parse(AWS.util.readFileSync(this.filename)); - AWS.Credentials.call(this, creds); - if (!this.accessKeyId || !this.secretAccessKey) { - throw AWS.util.error( - new Error('Credentials not set in ' + this.filename), - { code: 'FileSystemCredentialsProviderFailure' } - ); - } - this.expired = false; - callback(); - } catch (err) { - callback(err); - } +module.exports = AWS.XRay; + + +/***/ }), + +/***/ 52793: +/***/ ((module) => { + +function apiLoader(svc, version) { + if (!apiLoader.services.hasOwnProperty(svc)) { + throw new Error('InvalidService: Failed to load api for ' + svc); } + return apiLoader.services[svc][version]; +} -}); +/** + * @api private + * + * This member of AWS.apiLoader is private, but changing it will necessitate a + * change to ../scripts/services-table-generator.ts + */ +apiLoader.services = {}; + +/** + * @api private + */ +module.exports = apiLoader; /***/ }), -/***/ 80371: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 71786: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); var AWS = __nccwpck_require__(28437); -var proc = __nccwpck_require__(32081); -var iniLoader = AWS.util.iniLoader; + +// Load all service classes +__nccwpck_require__(26296); /** - * Represents credentials loaded from shared credentials file - * (defaulting to ~/.aws/credentials or defined by the - * `AWS_SHARED_CREDENTIALS_FILE` environment variable). - * - * ## Using process credentials - * - * The credentials file can specify a credential provider that executes - * a given process and attempts to read its stdout to recieve a JSON payload - * containing the credentials: - * - * [default] - * credential_process = /usr/bin/credential_proc - * - * Automatically handles refreshing credentials if an Expiration time is - * provided in the credentials payload. Credentials supplied in the same profile - * will take precedence over the credential_process. - * - * Sourcing credentials from an external process can potentially be dangerous, - * so proceed with caution. Other credential providers should be preferred if - * at all possible. If using this option, you should make sure that the shared - * credentials file is as locked down as possible using security best practices - * for your operating system. - * - * ## Using custom profiles - * - * The SDK supports loading credentials for separate profiles. This can be done - * in two ways: - * - * 1. Set the `AWS_PROFILE` environment variable in your process prior to - * loading the SDK. - * 2. Directly load the AWS.ProcessCredentials provider: - * - * ```javascript - * var creds = new AWS.ProcessCredentials({profile: 'myprofile'}); - * AWS.config.credentials = creds; - * ``` - * - * @!macro nobrowser + * @api private */ -AWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, { - /** - * Creates a new ProcessCredentials object. - * - * @param options [map] a set of options - * @option options profile [String] (AWS_PROFILE env var or 'default') - * the name of the profile to load. - * @option options filename [String] ('~/.aws/credentials' or defined by - * AWS_SHARED_CREDENTIALS_FILE process env var) - * the filename to use when loading credentials. - * @option options callback [Function] (err) Credentials are eagerly loaded - * by the constructor. When the callback is called with no error, the - * credentials have been loaded successfully. - */ - constructor: function ProcessCredentials(options) { - AWS.Credentials.call(this); +module.exports = AWS; - options = options || {}; - this.filename = options.filename; - this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; - this.get(options.callback || AWS.util.fn.noop); - }, +/***/ }), - /** - * @api private - */ - load: function load(callback) { - var self = this; - try { - var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); - var profile = profiles[this.profile] || {}; +/***/ 93260: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Object.keys(profile).length === 0) { - throw AWS.util.error( - new Error('Profile ' + this.profile + ' not found'), - { code: 'ProcessCredentialsProviderFailure' } - ); - } +var AWS = __nccwpck_require__(28437), + url = AWS.util.url, + crypto = AWS.util.crypto.lib, + base64Encode = AWS.util.base64.encode, + inherit = AWS.util.inherit; - if (profile['credential_process']) { - this.loadViaCredentialProcess(profile, function(err, data) { - if (err) { - callback(err, null); - } else { - self.expired = false; - self.accessKeyId = data.AccessKeyId; - self.secretAccessKey = data.SecretAccessKey; - self.sessionToken = data.SessionToken; - if (data.Expiration) { - self.expireTime = new Date(data.Expiration); +var queryEncode = function (string) { + var replacements = { + '+': '-', + '=': '_', + '/': '~' + }; + return string.replace(/[\+=\/]/g, function (match) { + return replacements[match]; + }); +}; + +var signPolicy = function (policy, privateKey) { + var sign = crypto.createSign('RSA-SHA1'); + sign.write(policy); + return queryEncode(sign.sign(privateKey, 'base64')); +}; + +var signWithCannedPolicy = function (url, expires, keyPairId, privateKey) { + var policy = JSON.stringify({ + Statement: [ + { + Resource: url, + Condition: { DateLessThan: { 'AWS:EpochTime': expires } } + } + ] + }); + + return { + Expires: expires, + 'Key-Pair-Id': keyPairId, + Signature: signPolicy(policy.toString(), privateKey) + }; +}; + +var signWithCustomPolicy = function (policy, keyPairId, privateKey) { + policy = policy.replace(/\s/mg, ''); + + return { + Policy: queryEncode(base64Encode(policy)), + 'Key-Pair-Id': keyPairId, + Signature: signPolicy(policy, privateKey) + }; +}; + +var determineScheme = function (url) { + var parts = url.split('://'); + if (parts.length < 2) { + throw new Error('Invalid URL.'); + } + + return parts[0].replace('*', ''); +}; + +var getRtmpUrl = function (rtmpUrl) { + var parsed = url.parse(rtmpUrl); + return parsed.path.replace(/^\//, '') + (parsed.hash || ''); +}; + +var getResource = function (url) { + switch (determineScheme(url)) { + case 'http': + case 'https': + return url; + case 'rtmp': + return getRtmpUrl(url); + default: + throw new Error('Invalid URI scheme. Scheme must be one of' + + ' http, https, or rtmp'); + } +}; + +var handleError = function (err, callback) { + if (!callback || typeof callback !== 'function') { + throw err; + } + + callback(err); +}; + +var handleSuccess = function (result, callback) { + if (!callback || typeof callback !== 'function') { + return result; + } + + callback(null, result); +}; + +AWS.CloudFront.Signer = inherit({ + /** + * A signer object can be used to generate signed URLs and cookies for granting + * access to content on restricted CloudFront distributions. + * + * @see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html + * + * @param keyPairId [String] (Required) The ID of the CloudFront key pair + * being used. + * @param privateKey [String] (Required) A private key in RSA format. + */ + constructor: function Signer(keyPairId, privateKey) { + if (keyPairId === void 0 || privateKey === void 0) { + throw new Error('A key pair ID and private key are required'); + } + + this.keyPairId = keyPairId; + this.privateKey = privateKey; + }, + + /** + * Create a signed Amazon CloudFront Cookie. + * + * @param options [Object] The options to create a signed cookie. + * @option options url [String] The URL to which the signature will grant + * access. Required unless you pass in a full + * policy. + * @option options expires [Number] A Unix UTC timestamp indicating when the + * signature should expire. Required unless you + * pass in a full policy. + * @option options policy [String] A CloudFront JSON policy. Required unless + * you pass in a url and an expiry time. + * + * @param cb [Function] if a callback is provided, this function will + * pass the hash as the second parameter (after the error parameter) to + * the callback function. + * + * @return [Object] if called synchronously (with no callback), returns the + * signed cookie parameters. + * @return [null] nothing is returned if a callback is provided. + */ + getSignedCookie: function (options, cb) { + var signatureHash = 'policy' in options + ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) + : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey); + + var cookieHash = {}; + for (var key in signatureHash) { + if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { + cookieHash['CloudFront-' + key] = signatureHash[key]; } - callback(null); - } - }); - } else { - throw AWS.util.error( - new Error('Profile ' + this.profile + ' did not include credential process'), - { code: 'ProcessCredentialsProviderFailure' } - ); - } - } catch (err) { - callback(err); - } - }, + } - /** - * Executes the credential_process and retrieves - * credentials from the output - * @api private - * @param profile [map] credentials profile - * @throws ProcessCredentialsProviderFailure - */ - loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) { - proc.exec(profile['credential_process'], { env: process.env }, function(err, stdOut, stdErr) { - if (err) { - callback(AWS.util.error( - new Error('credential_process returned error'), - { code: 'ProcessCredentialsProviderFailure'} - ), null); - } else { + return handleSuccess(cookieHash, cb); + }, + + /** + * Create a signed Amazon CloudFront URL. + * + * Keep in mind that URLs meant for use in media/flash players may have + * different requirements for URL formats (e.g. some require that the + * extension be removed, some require the file name to be prefixed + * - mp4:, some require you to add "/cfx/st" into your URL). + * + * @param options [Object] The options to create a signed URL. + * @option options url [String] The URL to which the signature will grant + * access. Any query params included with + * the URL should be encoded. Required. + * @option options expires [Number] A Unix UTC timestamp indicating when the + * signature should expire. Required unless you + * pass in a full policy. + * @option options policy [String] A CloudFront JSON policy. Required unless + * you pass in a url and an expiry time. + * + * @param cb [Function] if a callback is provided, this function will + * pass the URL as the second parameter (after the error parameter) to + * the callback function. + * + * @return [String] if called synchronously (with no callback), returns the + * signed URL. + * @return [null] nothing is returned if a callback is provided. + */ + getSignedUrl: function (options, cb) { try { - var credData = JSON.parse(stdOut); - if (credData.Expiration) { - var currentTime = AWS.util.date.getDate(); - var expireTime = new Date(credData.Expiration); - if (expireTime < currentTime) { - throw Error('credential_process returned expired credentials'); + var resource = getResource(options.url); + } catch (err) { + return handleError(err, cb); + } + + var parsedUrl = url.parse(options.url, true), + signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy') + ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) + : signWithCannedPolicy(resource, options.expires, this.keyPairId, this.privateKey); + + parsedUrl.search = null; + for (var key in signatureHash) { + if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { + parsedUrl.query[key] = signatureHash[key]; } - } + } - if (credData.Version !== 1) { - throw Error('credential_process does not return Version == 1'); - } - callback(null, credData); + try { + var signedUrl = determineScheme(options.url) === 'rtmp' + ? getRtmpUrl(url.format(parsedUrl)) + : url.format(parsedUrl); } catch (err) { - callback(AWS.util.error( - new Error(err.message), - { code: 'ProcessCredentialsProviderFailure'} - ), null); + return handleError(err, cb); } - } - }); - }, - /** - * Loads the credentials from the credential process - * - * @callback callback function(err) - * Called after the credential process has been executed. When this - * callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - iniLoader.clearCachedFiles(); - this.coalesceRefresh(callback || AWS.util.fn.callback); - } + return handleSuccess(signedUrl, cb); + } }); +/** + * @api private + */ +module.exports = AWS.CloudFront.Signer; + /***/ }), -/***/ 88764: +/***/ 38110: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -var AWS = __nccwpck_require__(28437), - ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI', - ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI', - ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN', - FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'], - FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'], - FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1'], - RELATIVE_URI_HOST = '169.254.170.2'; +var AWS = __nccwpck_require__(28437); +__nccwpck_require__(53819); +__nccwpck_require__(36965); +var PromisesDependency; /** - * Represents credentials received from specified URI. + * The main configuration class used by all service objects to set + * the region, credentials, and other options for requests. * - * This class will request refreshable credentials from the relative URI - * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the - * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials - * are returned in the response, these will be used with zero configuration. + * By default, credentials and region settings are left unconfigured. + * This should be configured by the application before using any + * AWS service APIs. * - * This credentials class will by default timeout after 1 second of inactivity - * and retry 3 times. - * If your requests to the relative URI are timing out, you can increase - * the value by configuring them directly: + * In order to set global configuration options, properties should + * be assigned to the global {AWS.config} object. * - * ```javascript - * AWS.config.credentials = new AWS.RemoteCredentials({ - * httpOptions: { timeout: 5000 }, // 5 second timeout - * maxRetries: 10, // retry 10 times - * retryDelayOptions: { base: 200 } // see AWS.Config for information - * }); - * ``` + * @see AWS.config * - * @see AWS.Config.retryDelayOptions + * @!group General Configuration Options * - * @!macro nobrowser + * @!attribute credentials + * @return [AWS.Credentials] the AWS credentials to sign requests with. + * + * @!attribute region + * @example Set the global region setting to us-west-2 + * AWS.config.update({region: 'us-west-2'}); + * @return [AWS.Credentials] The region to send service requests to. + * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html + * A list of available endpoints for each AWS service + * + * @!attribute maxRetries + * @return [Integer] the maximum amount of retries to perform for a + * service request. By default this value is calculated by the specific + * service object that the request is being made to. + * + * @!attribute maxRedirects + * @return [Integer] the maximum amount of redirects to follow for a + * service request. Defaults to 10. + * + * @!attribute paramValidation + * @return [Boolean|map] whether input parameters should be validated against + * the operation description before sending the request. Defaults to true. + * Pass a map to enable any of the following specific validation features: + * + * * **min** [Boolean] — Validates that a value meets the min + * constraint. This is enabled by default when paramValidation is set + * to `true`. + * * **max** [Boolean] — Validates that a value meets the max + * constraint. + * * **pattern** [Boolean] — Validates that a string value matches a + * regular expression. + * * **enum** [Boolean] — Validates that a string value matches one + * of the allowable enum values. + * + * @!attribute computeChecksums + * @return [Boolean] whether to compute checksums for payload bodies when + * the service accepts it (currently supported in S3 and SQS only). + * + * @!attribute convertResponseTypes + * @return [Boolean] whether types are converted when parsing response data. + * Currently only supported for JSON based services. Turning this off may + * improve performance on large response payloads. Defaults to `true`. + * + * @!attribute correctClockSkew + * @return [Boolean] whether to apply a clock skew correction and retry + * requests that fail because of an skewed client clock. Defaults to + * `false`. + * + * @!attribute sslEnabled + * @return [Boolean] whether SSL is enabled for requests + * + * @!attribute s3ForcePathStyle + * @return [Boolean] whether to force path style URLs for S3 objects + * + * @!attribute s3BucketEndpoint + * @note Setting this configuration option requires an `endpoint` to be + * provided explicitly to the service constructor. + * @return [Boolean] whether the provided endpoint addresses an individual + * bucket (false if it addresses the root API endpoint). + * + * @!attribute s3DisableBodySigning + * @return [Boolean] whether to disable S3 body signing when using signature version `v4`. + * Body signing can only be disabled when using https. Defaults to `true`. + * + * @!attribute s3UsEast1RegionalEndpoint + * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3 + * request to global endpoints or 'us-east-1' regional endpoints. This config is only + * applicable to S3 client; + * Defaults to 'legacy' + * @!attribute s3UseArnRegion + * @return [Boolean] whether to override the request region with the region inferred + * from requested resource's ARN. Only available for S3 buckets + * Defaults to `true` + * + * @!attribute useAccelerateEndpoint + * @note This configuration option is only compatible with S3 while accessing + * dns-compatible buckets. + * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service. + * Defaults to `false`. + * + * @!attribute retryDelayOptions + * @example Set the base retry delay for all services to 300 ms + * AWS.config.update({retryDelayOptions: {base: 300}}); + * // Delays with maxRetries = 3: 300, 600, 1200 + * @example Set a custom backoff function to provide delay values on retries + * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) { + * // returns delay in ms + * }}}); + * @return [map] A set of options to configure the retry delay on retryable errors. + * Currently supported options are: + * + * * **base** [Integer] — The base number of milliseconds to use in the + * exponential backoff for operation retries. Defaults to 100 ms for all services except + * DynamoDB, where it defaults to 50ms. + * + * * **customBackoff ** [function] — A custom function that accepts a + * retry count and error and returns the amount of time to delay in + * milliseconds. If the result is a non-zero negative value, no further + * retry attempts will be made. The `base` option will be ignored if this + * option is supplied. The function is only called for retryable errors. + * + * @!attribute httpOptions + * @return [map] A set of options to pass to the low-level HTTP request. + * Currently supported options are: + * + * * **proxy** [String] — the URL to proxy requests through + * * **agent** [http.Agent, https.Agent] — the Agent object to perform + * HTTP requests with. Used for connection pooling. Note that for + * SSL connections, a special Agent object is used in order to enable + * peer certificate verification. This feature is only supported in the + * Node.js environment. + * * **connectTimeout** [Integer] — Sets the socket to timeout after + * failing to establish a connection with the server after + * `connectTimeout` milliseconds. This timeout has no effect once a socket + * connection has been established. + * * **timeout** [Integer] — The number of milliseconds a request can + * take before automatically being terminated. + * Defaults to two minutes (120000). + * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous + * HTTP requests. Used in the browser environment only. Set to false to + * send requests synchronously. Defaults to true (async on). + * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" + * property of an XMLHttpRequest object. Used in the browser environment + * only. Defaults to false. + * @!attribute logger + * @return [#write,#log] an object that responds to .write() (like a stream) + * or .log() (like the console object) in order to log information about + * requests + * + * @!attribute systemClockOffset + * @return [Number] an offset value in milliseconds to apply to all signing + * times. Use this to compensate for clock skew when your system may be + * out of sync with the service time. Note that this configuration option + * can only be applied to the global `AWS.config` object and cannot be + * overridden in service-specific configuration. Defaults to 0 milliseconds. + * + * @!attribute signatureVersion + * @return [String] the signature version to sign requests with (overriding + * the API configuration). Possible values are: 'v2', 'v3', 'v4'. + * + * @!attribute signatureCache + * @return [Boolean] whether the signature to sign requests with (overriding + * the API configuration) is cached. Only applies to the signature version 'v4'. + * Defaults to `true`. + * + * @!attribute endpointDiscoveryEnabled + * @return [Boolean|undefined] whether to call operations with endpoints + * given by service dynamically. Setting this config to `true` will enable + * endpoint discovery for all applicable operations. Setting it to `false` + * will explicitly disable endpoint discovery even though operations that + * require endpoint discovery will presumably fail. Leaving it to + * `undefined` means SDK only do endpoint discovery when it's required. + * Defaults to `undefined` + * + * @!attribute endpointCacheSize + * @return [Number] the size of the global cache storing endpoints from endpoint + * discovery operations. Once endpoint cache is created, updating this setting + * cannot change existing cache size. + * Defaults to 1000 + * + * @!attribute hostPrefixEnabled + * @return [Boolean] whether to marshal request parameters to the prefix of + * hostname. Defaults to `true`. + * + * @!attribute stsRegionalEndpoints + * @return ['legacy'|'regional'] whether to send sts request to global endpoints or + * regional endpoints. + * Defaults to 'legacy'. + * + * @!attribute useFipsEndpoint + * @return [Boolean] Enables FIPS compatible endpoints. Defaults to `false`. + * + * @!attribute useDualstackEndpoint + * @return [Boolean] Enables IPv6 dualstack endpoint. Defaults to `false`. */ -AWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, { - constructor: function RemoteCredentials(options) { - AWS.Credentials.call(this); - options = options ? AWS.util.copy(options) : {}; - if (!options.httpOptions) options.httpOptions = {}; - options.httpOptions = AWS.util.merge( - this.httpOptions, options.httpOptions); - AWS.util.update(this, options); - }, - +AWS.Config = AWS.util.inherit({ /** - * @api private + * @!endgroup */ - httpOptions: { timeout: 1000 }, /** - * @api private + * Creates a new configuration object. This is the object that passes + * option data along to service requests, including credentials, security, + * region information, and some service specific settings. + * + * @example Creating a new configuration object with credentials and region + * var config = new AWS.Config({ + * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2' + * }); + * @option options accessKeyId [String] your AWS access key ID. + * @option options secretAccessKey [String] your AWS secret access key. + * @option options sessionToken [AWS.Credentials] the optional AWS + * session token to sign requests with. + * @option options credentials [AWS.Credentials] the AWS credentials + * to sign requests with. You can either specify this object, or + * specify the accessKeyId and secretAccessKey options directly. + * @option options credentialProvider [AWS.CredentialProviderChain] the + * provider chain used to resolve credentials if no static `credentials` + * property is set. + * @option options region [String] the region to send service requests to. + * See {region} for more information. + * @option options maxRetries [Integer] the maximum amount of retries to + * attempt with a request. See {maxRetries} for more information. + * @option options maxRedirects [Integer] the maximum amount of redirects to + * follow with a request. See {maxRedirects} for more information. + * @option options sslEnabled [Boolean] whether to enable SSL for + * requests. + * @option options paramValidation [Boolean|map] whether input parameters + * should be validated against the operation description before sending + * the request. Defaults to true. Pass a map to enable any of the + * following specific validation features: + * + * * **min** [Boolean] — Validates that a value meets the min + * constraint. This is enabled by default when paramValidation is set + * to `true`. + * * **max** [Boolean] — Validates that a value meets the max + * constraint. + * * **pattern** [Boolean] — Validates that a string value matches a + * regular expression. + * * **enum** [Boolean] — Validates that a string value matches one + * of the allowable enum values. + * @option options computeChecksums [Boolean] whether to compute checksums + * for payload bodies when the service accepts it (currently supported + * in S3 only) + * @option options convertResponseTypes [Boolean] whether types are converted + * when parsing response data. Currently only supported for JSON based + * services. Turning this off may improve performance on large response + * payloads. Defaults to `true`. + * @option options correctClockSkew [Boolean] whether to apply a clock skew + * correction and retry requests that fail because of an skewed client + * clock. Defaults to `false`. + * @option options s3ForcePathStyle [Boolean] whether to force path + * style URLs for S3 objects. + * @option options s3BucketEndpoint [Boolean] whether the provided endpoint + * addresses an individual bucket (false if it addresses the root API + * endpoint). Note that setting this configuration option requires an + * `endpoint` to be provided explicitly to the service constructor. + * @option options s3DisableBodySigning [Boolean] whether S3 body signing + * should be disabled when using signature version `v4`. Body signing + * can only be disabled when using https. Defaults to `true`. + * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region + * is set to 'us-east-1', whether to send s3 request to global endpoints or + * 'us-east-1' regional endpoints. This config is only applicable to S3 client. + * Defaults to `legacy` + * @option options s3UseArnRegion [Boolean] whether to override the request region + * with the region inferred from requested resource's ARN. Only available for S3 buckets + * Defaults to `true` + * + * @option options retryDelayOptions [map] A set of options to configure + * the retry delay on retryable errors. Currently supported options are: + * + * * **base** [Integer] — The base number of milliseconds to use in the + * exponential backoff for operation retries. Defaults to 100 ms for all + * services except DynamoDB, where it defaults to 50ms. + * * **customBackoff ** [function] — A custom function that accepts a + * retry count and error and returns the amount of time to delay in + * milliseconds. If the result is a non-zero negative value, no further + * retry attempts will be made. The `base` option will be ignored if this + * option is supplied. The function is only called for retryable errors. + * @option options httpOptions [map] A set of options to pass to the low-level + * HTTP request. Currently supported options are: + * + * * **proxy** [String] — the URL to proxy requests through + * * **agent** [http.Agent, https.Agent] — the Agent object to perform + * HTTP requests with. Used for connection pooling. Defaults to the global + * agent (`http.globalAgent`) for non-SSL connections. Note that for + * SSL connections, a special Agent object is used in order to enable + * peer certificate verification. This feature is only available in the + * Node.js environment. + * * **connectTimeout** [Integer] — Sets the socket to timeout after + * failing to establish a connection with the server after + * `connectTimeout` milliseconds. This timeout has no effect once a socket + * connection has been established. + * * **timeout** [Integer] — Sets the socket to timeout after timeout + * milliseconds of inactivity on the socket. Defaults to two minutes + * (120000). + * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous + * HTTP requests. Used in the browser environment only. Set to false to + * send requests synchronously. Defaults to true (async on). + * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" + * property of an XMLHttpRequest object. Used in the browser environment + * only. Defaults to false. + * @option options apiVersion [String, Date] a String in YYYY-MM-DD format + * (or a date) that represents the latest possible API version that can be + * used in all services (unless overridden by `apiVersions`). Specify + * 'latest' to use the latest possible version. + * @option options apiVersions [map] a map of service + * identifiers (the lowercase service class name) with the API version to + * use when instantiating a service. Specify 'latest' for each individual + * that can use the latest available version. + * @option options logger [#write,#log] an object that responds to .write() + * (like a stream) or .log() (like the console object) in order to log + * information about requests + * @option options systemClockOffset [Number] an offset value in milliseconds + * to apply to all signing times. Use this to compensate for clock skew + * when your system may be out of sync with the service time. Note that + * this configuration option can only be applied to the global `AWS.config` + * object and cannot be overridden in service-specific configuration. + * Defaults to 0 milliseconds. + * @option options signatureVersion [String] the signature version to sign + * requests with (overriding the API configuration). Possible values are: + * 'v2', 'v3', 'v4'. + * @option options signatureCache [Boolean] whether the signature to sign + * requests with (overriding the API configuration) is cached. Only applies + * to the signature version 'v4'. Defaults to `true`. + * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32 + * checksum of HTTP response bodies returned by DynamoDB. Default: `true`. + * @option options useAccelerateEndpoint [Boolean] Whether to use the + * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`. + * @option options clientSideMonitoring [Boolean] whether to collect and + * publish this client's performance metrics of all its API requests. + * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to + * call operations with endpoints given by service dynamically. Setting this + * config to `true` will enable endpoint discovery for all applicable operations. + * Setting it to `false` will explicitly disable endpoint discovery even though + * operations that require endpoint discovery will presumably fail. Leaving it + * to `undefined` means SDK will only do endpoint discovery when it's required. + * Defaults to `undefined` + * @option options endpointCacheSize [Number] the size of the global cache storing + * endpoints from endpoint discovery operations. Once endpoint cache is created, + * updating this setting cannot change existing cache size. + * Defaults to 1000 + * @option options hostPrefixEnabled [Boolean] whether to marshal request + * parameters to the prefix of hostname. + * Defaults to `true`. + * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request + * to global endpoints or regional endpoints. + * Defaults to 'legacy'. + * @option options useFipsEndpoint [Boolean] Enables FIPS compatible endpoints. + * Defaults to `false`. + * @option options useDualstackEndpoint [Boolean] Enables IPv6 dualstack endpoint. + * Defaults to `false`. */ - maxRetries: 3, + constructor: function Config(options) { + if (options === undefined) options = {}; + options = this.extractCredentials(options); + + AWS.util.each.call(this, this.keys, function (key, value) { + this.set(key, options[key], value); + }); + }, /** - * @api private + * @!group Managing Credentials */ - isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() { - return Boolean( - process && - process.env && - (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI]) - ); - }, /** - * @api private + * Loads credentials from the configuration object. This is used internally + * by the SDK to ensure that refreshable {Credentials} objects are properly + * refreshed and loaded when sending a request. If you want to ensure that + * your credentials are loaded prior to a request, you can use this method + * directly to provide accurate credential data stored in the object. + * + * @note If you configure the SDK with static or environment credentials, + * the credential data should already be present in {credentials} attribute. + * This method is primarily necessary to load credentials from asynchronous + * sources, or sources that can refresh credentials periodically. + * @example Getting your access key + * AWS.config.getCredentials(function(err) { + * if (err) console.log(err.stack); // credentials not loaded + * else console.log("Access Key:", AWS.config.credentials.accessKeyId); + * }) + * @callback callback function(err) + * Called when the {credentials} have been properly set on the configuration + * object. + * + * @param err [Error] if this is set, credentials were not successfully + * loaded and this error provides information why. + * @see credentials + * @see Credentials */ - getECSFullUri: function getECSFullUri() { - if (process && process.env) { - var relative = process.env[ENV_RELATIVE_URI], - full = process.env[ENV_FULL_URI]; - if (relative) { - return 'http://' + RELATIVE_URI_HOST + relative; - } else if (full) { - var parsed = AWS.util.urlParse(full); - if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) { - throw AWS.util.error( - new Error('Unsupported protocol: AWS.RemoteCredentials supports ' - + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; ' - + parsed.protocol + ' requested.'), - { code: 'ECSCredentialsProviderFailure' } - ); - } - - if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 && - FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) { - throw AWS.util.error( - new Error('Unsupported hostname: AWS.RemoteCredentials only supports ' - + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; ' - + parsed.protocol + '//' + parsed.hostname + ' requested.'), - { code: 'ECSCredentialsProviderFailure' } - ); - } + getCredentials: function getCredentials(callback) { + var self = this; - return full; - } else { - throw AWS.util.error( - new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI + - ' must be set to use AWS.RemoteCredentials.'), - { code: 'ECSCredentialsProviderFailure' } - ); - } - } else { - throw AWS.util.error( - new Error('No process info available'), - { code: 'ECSCredentialsProviderFailure' } - ); + function finish(err) { + callback(err, err ? null : self.credentials); } - }, - /** - * @api private - */ - getECSAuthToken: function getECSAuthToken() { - if (process && process.env && process.env[ENV_FULL_URI]) { - return process.env[ENV_AUTH_TOKEN]; + function credError(msg, err) { + return new AWS.util.error(err || new Error(), { + code: 'CredentialsError', + message: msg, + name: 'CredentialsError' + }); } - }, - - /** - * @api private - */ - credsFormatIsValid: function credsFormatIsValid(credData) { - return (!!credData.accessKeyId && !!credData.secretAccessKey && - !!credData.sessionToken && !!credData.expireTime); - }, - /** - * @api private - */ - formatCreds: function formatCreds(credData) { - if (!!credData.credentials) { - credData = credData.credentials; + function getAsyncCredentials() { + self.credentials.get(function(err) { + if (err) { + var msg = 'Could not load credentials from ' + + self.credentials.constructor.name; + err = credError(msg, err); + } + finish(err); + }); } - return { - expired: false, - accessKeyId: credData.accessKeyId || credData.AccessKeyId, - secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey, - sessionToken: credData.sessionToken || credData.Token, - expireTime: new Date(credData.expiration || credData.Expiration) - }; - }, + function getStaticCredentials() { + var err = null; + if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) { + err = credError('Missing credentials'); + } + finish(err); + } - /** - * @api private - */ - request: function request(url, callback) { - var httpRequest = new AWS.HttpRequest(url); - httpRequest.method = 'GET'; - httpRequest.headers.Accept = 'application/json'; - var token = this.getECSAuthToken(); - if (token) { - httpRequest.headers.Authorization = token; + if (self.credentials) { + if (typeof self.credentials.get === 'function') { + getAsyncCredentials(); + } else { // static credentials + getStaticCredentials(); + } + } else if (self.credentialProvider) { + self.credentialProvider.resolve(function(err, creds) { + if (err) { + err = credError('Could not load credentials from any providers', err); + } + self.credentials = creds; + finish(err); + }); + } else { + finish(credError('No credentials to load')); } - AWS.util.handleRequestWithRetries(httpRequest, this, callback); }, /** - * Loads the credentials from the relative URI specified by container + * Loads token from the configuration object. This is used internally + * by the SDK to ensure that refreshable {Token} objects are properly + * refreshed and loaded when sending a request. If you want to ensure that + * your token is loaded prior to a request, you can use this method + * directly to provide accurate token data stored in the object. * + * @note If you configure the SDK with static token, the token data should + * already be present in {token} attribute. This method is primarily necessary + * to load token from asynchronous sources, or sources that can refresh + * token periodically. + * @example Getting your access token + * AWS.config.getToken(function(err) { + * if (err) console.log(err.stack); // token not loaded + * else console.log("Token:", AWS.config.token.token); + * }) * @callback callback function(err) - * Called when the request to the relative URI responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, `sessionToken`, and `expireTime` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, - - /** - * @api private + * Called when the {token} have been properly set on the configuration object. + * + * @param err [Error] if this is set, token was not successfully loaded and + * this error provides information why. + * @see token */ - load: function load(callback) { + getToken: function getToken(callback) { var self = this; - var fullUri; - try { - fullUri = this.getECSFullUri(); - } catch (err) { - callback(err); - return; + function finish(err) { + callback(err, err ? null : self.token); } - this.request(fullUri, function(err, data) { - if (!err) { - try { - data = JSON.parse(data); - var creds = self.formatCreds(data); - if (!self.credsFormatIsValid(creds)) { - throw AWS.util.error( - new Error('Response data is not in valid format'), - { code: 'ECSCredentialsProviderFailure' } - ); - } - AWS.util.update(self, creds); - } catch (dataError) { - err = dataError; - } - } - callback(err, creds); - }); - } -}); - - -/***/ }), - -/***/ 15037: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var STS = __nccwpck_require__(57513); + function tokenError(msg, err) { + return new AWS.util.error(err || new Error(), { + code: 'TokenError', + message: msg, + name: 'TokenError' + }); + } -/** - * Represents credentials retrieved from STS SAML support. - * - * By default this provider gets credentials using the - * {AWS.STS.assumeRoleWithSAML} service operation. This operation - * requires a `RoleArn` containing the ARN of the IAM trust policy for the - * application for which credentials will be given, as well as a `PrincipalArn` - * representing the ARN for the SAML identity provider. In addition, the - * `SAMLAssertion` must be set to the token provided by the identity - * provider. See {constructor} for an example on creating a credentials - * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values. - * - * ## Refreshing Credentials from Identity Service - * - * In addition to AWS credentials expiring after a given amount of time, the - * login token from the identity provider will also expire. Once this token - * expires, it will not be usable to refresh AWS credentials, and another - * token will be needed. The SDK does not manage refreshing of the token value, - * but this can be done through a "refresh token" supported by most identity - * providers. Consult the documentation for the identity provider for refreshing - * tokens. Once the refreshed token is acquired, you should make sure to update - * this new token in the credentials object's {params} property. The following - * code will update the SAMLAssertion, assuming you have retrieved an updated - * token from the identity provider: - * - * ```javascript - * AWS.config.credentials.params.SAMLAssertion = updatedToken; - * ``` - * - * Future calls to `credentials.refresh()` will now use the new token. - * - * @!attribute params - * @return [map] the map of params passed to - * {AWS.STS.assumeRoleWithSAML}. To update the token, set the - * `params.SAMLAssertion` property. - */ -AWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, { - /** - * Creates a new credentials object. - * @param (see AWS.STS.assumeRoleWithSAML) - * @example Creating a new credentials object - * AWS.config.credentials = new AWS.SAMLCredentials({ - * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole', - * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal', - * SAMLAssertion: 'base64-token', // base64-encoded token from IdP - * }); - * @see AWS.STS.assumeRoleWithSAML - */ - constructor: function SAMLCredentials(params) { - AWS.Credentials.call(this); - this.expired = true; - this.params = params; - }, + function getAsyncToken() { + self.token.get(function(err) { + if (err) { + var msg = 'Could not load token from ' + + self.token.constructor.name; + err = tokenError(msg, err); + } + finish(err); + }); + } - /** - * Refreshes credentials using {AWS.STS.assumeRoleWithSAML} - * - * @callback callback function(err) - * Called when the STS service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, + function getStaticToken() { + var err = null; + if (!self.token.token) { + err = tokenError('Missing token'); + } + finish(err); + } - /** - * @api private - */ - load: function load(callback) { - var self = this; - self.createClients(); - self.service.assumeRoleWithSAML(function (err, data) { - if (!err) { - self.service.credentialsFrom(data, self); + if (self.token) { + if (typeof self.token.get === 'function') { + getAsyncToken(); + } else { // static token + getStaticToken(); } - callback(err); - }); + } else if (self.tokenProvider) { + self.tokenProvider.resolve(function(err, token) { + if (err) { + err = tokenError('Could not load token from any providers', err); + } + self.token = token; + finish(err); + }); + } else { + finish(tokenError('No token to load')); + } }, /** - * @api private + * @!group Loading and Setting Configuration Options */ - createClients: function() { - this.service = this.service || new STS({params: this.params}); - } - -}); - - -/***/ }), - -/***/ 13754: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var STS = __nccwpck_require__(57513); -var iniLoader = AWS.util.iniLoader; - -var ASSUME_ROLE_DEFAULT_REGION = 'us-east-1'; -/** - * Represents credentials loaded from shared credentials file - * (defaulting to ~/.aws/credentials or defined by the - * `AWS_SHARED_CREDENTIALS_FILE` environment variable). - * - * ## Using the shared credentials file - * - * This provider is checked by default in the Node.js environment. To use the - * credentials file provider, simply add your access and secret keys to the - * ~/.aws/credentials file in the following format: - * - * [default] - * aws_access_key_id = AKID... - * aws_secret_access_key = YOUR_SECRET_KEY - * - * ## Using custom profiles - * - * The SDK supports loading credentials for separate profiles. This can be done - * in two ways: - * - * 1. Set the `AWS_PROFILE` environment variable in your process prior to - * loading the SDK. - * 2. Directly load the AWS.SharedIniFileCredentials provider: - * - * ```javascript - * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'}); - * AWS.config.credentials = creds; - * ``` - * - * @!macro nobrowser - */ -AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { /** - * Creates a new SharedIniFileCredentials object. + * @overload update(options, allowUnknownKeys = false) + * Updates the current configuration object with new options. * - * @param options [map] a set of options - * @option options profile [String] (AWS_PROFILE env var or 'default') - * the name of the profile to load. - * @option options filename [String] ('~/.aws/credentials' or defined by - * AWS_SHARED_CREDENTIALS_FILE process env var) - * the filename to use when loading credentials. - * @option options disableAssumeRole [Boolean] (false) True to disable - * support for profiles that assume an IAM role. If true, and an assume - * role profile is selected, an error is raised. - * @option options preferStaticCredentials [Boolean] (false) True to - * prefer static credentials to role_arn if both are present. - * @option options tokenCodeFn [Function] (null) Function to provide - * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini - * file. Function is called with value of mfa_serial and callback, and - * should provide the TokenCode or an error to the callback in the format - * callback(err, token) - * @option options callback [Function] (err) Credentials are eagerly loaded - * by the constructor. When the callback is called with no error, the - * credentials have been loaded successfully. - * @option options httpOptions [map] A set of options to pass to the low-level - * HTTP request. Currently supported options are: - * * **proxy** [String] — the URL to proxy requests through - * * **agent** [http.Agent, https.Agent] — the Agent object to perform - * HTTP requests with. Used for connection pooling. Defaults to the global - * agent (`http.globalAgent`) for non-SSL connections. Note that for - * SSL connections, a special Agent object is used in order to enable - * peer certificate verification. This feature is only available in the - * Node.js environment. - * * **connectTimeout** [Integer] — Sets the socket to timeout after - * failing to establish a connection with the server after - * `connectTimeout` milliseconds. This timeout has no effect once a socket - * connection has been established. - * * **timeout** [Integer] — The number of milliseconds a request can - * take before automatically being terminated. - * Defaults to two minutes (120000). + * @example Update maxRetries property of a configuration object + * config.update({maxRetries: 10}); + * @param [Object] options a map of option keys and values. + * @param [Boolean] allowUnknownKeys whether unknown keys can be set on + * the configuration object. Defaults to `false`. + * @see constructor */ - constructor: function SharedIniFileCredentials(options) { - AWS.Credentials.call(this); - - options = options || {}; - - this.filename = options.filename; - this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; - this.disableAssumeRole = Boolean(options.disableAssumeRole); - this.preferStaticCredentials = Boolean(options.preferStaticCredentials); - this.tokenCodeFn = options.tokenCodeFn || null; - this.httpOptions = options.httpOptions || null; - this.get(options.callback || AWS.util.fn.noop); + update: function update(options, allowUnknownKeys) { + allowUnknownKeys = allowUnknownKeys || false; + options = this.extractCredentials(options); + AWS.util.each.call(this, options, function (key, value) { + if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) || + AWS.Service.hasService(key)) { + this.set(key, value); + } + }); }, /** - * @api private - */ - load: function load(callback) { - var self = this; - try { - var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); - var profile = profiles[this.profile] || {}; - - if (Object.keys(profile).length === 0) { - throw AWS.util.error( - new Error('Profile ' + this.profile + ' not found'), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); - } - - /* - In the CLI, the presence of both a role_arn and static credentials have - different meanings depending on how many profiles have been visited. For - the first profile processed, role_arn takes precedence over any static - credentials, but for all subsequent profiles, static credentials are - used if present, and only in their absence will the profile's - source_profile and role_arn keys be used to load another set of - credentials. This var is intended to yield compatible behaviour in this - sdk. - */ - var preferStaticCredentialsToRoleArn = Boolean( - this.preferStaticCredentials - && profile['aws_access_key_id'] - && profile['aws_secret_access_key'] - ); - - if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) { - this.loadRoleProfile(profiles, profile, function(err, data) { - if (err) { - callback(err); - } else { - self.expired = false; - self.accessKeyId = data.Credentials.AccessKeyId; - self.secretAccessKey = data.Credentials.SecretAccessKey; - self.sessionToken = data.Credentials.SessionToken; - self.expireTime = data.Credentials.Expiration; - callback(null); - } - }); - return; - } + * Loads configuration data from a JSON file into this config object. + * @note Loading configuration will reset all existing configuration + * on the object. + * @!macro nobrowser + * @param path [String] the path relative to your process's current + * working directory to load configuration from. + * @return [AWS.Config] the same configuration object + */ + loadFromPath: function loadFromPath(path) { + this.clear(); - this.accessKeyId = profile['aws_access_key_id']; - this.secretAccessKey = profile['aws_secret_access_key']; - this.sessionToken = profile['aws_session_token']; + var options = JSON.parse(AWS.util.readFileSync(path)); + var fileSystemCreds = new AWS.FileSystemCredentials(path); + var chain = new AWS.CredentialProviderChain(); + chain.providers.unshift(fileSystemCreds); + chain.resolve(function (err, creds) { + if (err) throw err; + else options.credentials = creds; + }); - if (!this.accessKeyId || !this.secretAccessKey) { - throw AWS.util.error( - new Error('Credentials not set for profile ' + this.profile), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); - } - this.expired = false; - callback(null); - } catch (err) { - callback(err); - } + this.constructor(options); + + return this; }, /** - * Loads the credentials from the shared credentials file + * Clears configuration data on this object * - * @callback callback function(err) - * Called after the shared INI file on disk is read and parsed. When this - * callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get + * @api private */ - refresh: function refresh(callback) { - iniLoader.clearCachedFiles(); - this.coalesceRefresh( - callback || AWS.util.fn.callback, - this.disableAssumeRole - ); + clear: function clear() { + /*jshint forin:false */ + AWS.util.each.call(this, this.keys, function (key) { + delete this[key]; + }); + + // reset credential provider + this.set('credentials', undefined); + this.set('credentialProvider', undefined); }, /** + * Sets a property on the configuration object, allowing for a + * default value * @api private */ - loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) { - if (this.disableAssumeRole) { - throw AWS.util.error( - new Error('Role assumption profiles are disabled. ' + - 'Failed to load profile ' + this.profile + - ' from ' + creds.filename), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); + set: function set(property, value, defaultValue) { + if (value === undefined) { + if (defaultValue === undefined) { + defaultValue = this.keys[property]; + } + if (typeof defaultValue === 'function') { + this[property] = defaultValue.call(this); + } else { + this[property] = defaultValue; + } + } else if (property === 'httpOptions' && this[property]) { + // deep merge httpOptions + this[property] = AWS.util.merge(this[property], value); + } else { + this[property] = value; } + }, - var self = this; - var roleArn = roleProfile['role_arn']; - var roleSessionName = roleProfile['role_session_name']; - var externalId = roleProfile['external_id']; - var mfaSerial = roleProfile['mfa_serial']; - var sourceProfileName = roleProfile['source_profile']; - var durationSeconds = parseInt(roleProfile['duration_seconds'], 10) || undefined; - - // From experimentation, the following behavior mimics the AWS CLI: - // - // 1. Use region from the profile if present. - // 2. Otherwise fall back to N. Virginia (global endpoint). - // - // It is necessary to do the fallback explicitly, because if - // 'AWS_STS_REGIONAL_ENDPOINTS=regional', the underlying STS client will - // otherwise throw an error if region is left 'undefined'. - // - // Experimentation shows that the AWS CLI (tested at version 1.18.136) - // ignores the following potential sources of a region for the purposes of - // this AssumeRole call: - // - // - The [default] profile - // - The AWS_REGION environment variable - // - // Ignoring the [default] profile for the purposes of AssumeRole is arguably - // a bug in the CLI since it does use the [default] region for service - // calls... but right now we're matching behavior of the other tool. - var profileRegion = roleProfile['region'] || ASSUME_ROLE_DEFAULT_REGION; + /** + * All of the keys with their default values. + * + * @constant + * @api private + */ + keys: { + credentials: null, + credentialProvider: null, + region: null, + logger: null, + apiVersions: {}, + apiVersion: null, + endpoint: undefined, + httpOptions: { + timeout: 120000 + }, + maxRetries: undefined, + maxRedirects: 10, + paramValidation: true, + sslEnabled: true, + s3ForcePathStyle: false, + s3BucketEndpoint: false, + s3DisableBodySigning: true, + s3UsEast1RegionalEndpoint: 'legacy', + s3UseArnRegion: undefined, + computeChecksums: true, + convertResponseTypes: true, + correctClockSkew: false, + customUserAgent: null, + dynamoDbCrc32: true, + systemClockOffset: 0, + signatureVersion: null, + signatureCache: true, + retryDelayOptions: {}, + useAccelerateEndpoint: false, + clientSideMonitoring: false, + endpointDiscoveryEnabled: undefined, + endpointCacheSize: 1000, + hostPrefixEnabled: true, + stsRegionalEndpoints: 'legacy', + useFipsEndpoint: false, + useDualstackEndpoint: false, + token: null + }, - if (!sourceProfileName) { - throw AWS.util.error( - new Error('source_profile is not set using profile ' + this.profile), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); + /** + * Extracts accessKeyId, secretAccessKey and sessionToken + * from a configuration hash. + * + * @api private + */ + extractCredentials: function extractCredentials(options) { + if (options.accessKeyId && options.secretAccessKey) { + options = AWS.util.copy(options); + options.credentials = new AWS.Credentials(options); } + return options; + }, - var sourceProfileExistanceTest = creds[sourceProfileName]; - - if (typeof sourceProfileExistanceTest !== 'object') { - throw AWS.util.error( - new Error('source_profile ' + sourceProfileName + ' using profile ' - + this.profile + ' does not exist'), - { code: 'SharedIniFileCredentialsProviderFailure' } - ); + /** + * Sets the promise dependency the SDK will use wherever Promises are returned. + * Passing `null` will force the SDK to use native Promises if they are available. + * If native Promises are not available, passing `null` will have no effect. + * @param [Constructor] dep A reference to a Promise constructor + */ + setPromisesDependency: function setPromisesDependency(dep) { + PromisesDependency = dep; + // if null was passed in, we should try to use native promises + if (dep === null && typeof Promise === 'function') { + PromisesDependency = Promise; } - - var sourceCredentials = new AWS.SharedIniFileCredentials( - AWS.util.merge(this.options || {}, { - profile: sourceProfileName, - preferStaticCredentials: true - }) - ); - - this.roleArn = roleArn; - var sts = new STS({ - credentials: sourceCredentials, - region: profileRegion, - httpOptions: this.httpOptions - }); - - var roleParams = { - DurationSeconds: durationSeconds, - RoleArn: roleArn, - RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() - }; - - if (externalId) { - roleParams.ExternalId = externalId; + var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; + if (AWS.S3) { + constructors.push(AWS.S3); + if (AWS.S3.ManagedUpload) { + constructors.push(AWS.S3.ManagedUpload); + } } + AWS.util.addPromises(constructors, PromisesDependency); + }, - if (mfaSerial && self.tokenCodeFn) { - roleParams.SerialNumber = mfaSerial; - self.tokenCodeFn(mfaSerial, function(err, token) { - if (err) { - var message; - if (err instanceof Error) { - message = err.message; - } else { - message = err; - } - callback( - AWS.util.error( - new Error('Error fetching MFA token: ' + message), - { code: 'SharedIniFileCredentialsProviderFailure' } - )); - return; - } - - roleParams.TokenCode = token; - sts.assumeRole(roleParams, callback); - }); - return; - } - sts.assumeRole(roleParams, callback); + /** + * Gets the promise dependency set by `AWS.config.setPromisesDependency`. + */ + getPromisesDependency: function getPromisesDependency() { + return PromisesDependency; } }); +/** + * @return [AWS.Config] The global configuration object singleton instance + * @readonly + * @see AWS.Config + */ +AWS.config = new AWS.Config(); + /***/ }), -/***/ 68335: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 85566: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var path = __nccwpck_require__(71017); -var crypto = __nccwpck_require__(6113); -var iniLoader = AWS.util.iniLoader; +/** + * @api private + */ +function validateRegionalEndpointsFlagValue(configValue, errorOptions) { + if (typeof configValue !== 'string') return undefined; + else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) { + return configValue.toLowerCase(); + } else { + throw AWS.util.error(new Error(), errorOptions); + } +} /** - * Represents credentials from sso.getRoleCredentials API for - * `sso_*` values defined in shared credentials file. - * - * ## Using SSO credentials - * - * The credentials file must specify the information below to use sso: - * - * [profile sso-profile] - * sso_account_id = 012345678901 - * sso_region = **-****-* - * sso_role_name = SampleRole - * sso_start_url = https://d-******.awsapps.com/start - * - * or using the session format: - * - * [profile sso-token] - * sso_session = prod - * sso_account_id = 012345678901 - * sso_role_name = SampleRole - * - * [sso-session prod] - * sso_region = **-****-* - * sso_start_url = https://d-******.awsapps.com/start - * - * This information will be automatically added to your shared credentials file by running - * `aws configure sso`. - * - * ## Using custom profiles - * - * The SDK supports loading credentials for separate profiles. This can be done - * in two ways: - * - * 1. Set the `AWS_PROFILE` environment variable in your process prior to - * loading the SDK. - * 2. Directly load the AWS.SsoCredentials provider: - * - * ```javascript - * var creds = new AWS.SsoCredentials({profile: 'myprofile'}); - * AWS.config.credentials = creds; - * ``` + * Resolve the configuration value for regional endpoint from difference sources: client + * config, environmental variable, shared config file. Value can be case-insensitive + * 'legacy' or 'reginal'. + * @param originalConfig user-supplied config object to resolve + * @param options a map of config property names from individual configuration source + * - env: name of environmental variable that refers to the config + * - sharedConfig: name of shared configuration file property that refers to the config + * - clientConfig: name of client configuration property that refers to the config * - * @!macro nobrowser + * @api private */ -AWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, { - /** - * Creates a new SsoCredentials object. - * - * @param options [map] a set of options - * @option options profile [String] (AWS_PROFILE env var or 'default') - * the name of the profile to load. - * @option options filename [String] ('~/.aws/credentials' or defined by - * AWS_SHARED_CREDENTIALS_FILE process env var) - * the filename to use when loading credentials. - * @option options callback [Function] (err) Credentials are eagerly loaded - * by the constructor. When the callback is called with no error, the - * credentials have been loaded successfully. - */ - constructor: function SsoCredentials(options) { - AWS.Credentials.call(this); - - options = options || {}; - this.errorCode = 'SsoCredentialsProviderFailure'; - this.expired = true; - - this.filename = options.filename; - this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; - this.service = options.ssoClient; - this.httpOptions = options.httpOptions || null; - this.get(options.callback || AWS.util.fn.noop); - }, - - /** - * @api private - */ - load: function load(callback) { - var self = this; - - try { - var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); - var profile = profiles[this.profile] || {}; - - if (Object.keys(profile).length === 0) { - throw AWS.util.error( - new Error('Profile ' + this.profile + ' not found'), - { code: self.errorCode } - ); - } +function resolveRegionalEndpointsFlag(originalConfig, options) { + originalConfig = originalConfig || {}; + //validate config value + var resolved; + if (originalConfig[options.clientConfig]) { + resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], { + code: 'InvalidConfiguration', + message: 'invalid "' + options.clientConfig + '" configuration. Expect "legacy" ' + + ' or "regional". Got "' + originalConfig[options.clientConfig] + '".' + }); + if (resolved) return resolved; + } + if (!AWS.util.isNode()) return resolved; + //validate environmental variable + if (Object.prototype.hasOwnProperty.call(process.env, options.env)) { + var envFlag = process.env[options.env]; + resolved = validateRegionalEndpointsFlagValue(envFlag, { + code: 'InvalidEnvironmentalVariable', + message: 'invalid ' + options.env + ' environmental variable. Expect "legacy" ' + + ' or "regional". Got "' + process.env[options.env] + '".' + }); + if (resolved) return resolved; + } + //validate shared config file + var profile = {}; + try { + var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); + profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; + } catch (e) {}; + if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) { + var fileFlag = profile[options.sharedConfig]; + resolved = validateRegionalEndpointsFlagValue(fileFlag, { + code: 'InvalidConfiguration', + message: 'invalid ' + options.sharedConfig + ' profile config. Expect "legacy" ' + + ' or "regional". Got "' + profile[options.sharedConfig] + '".' + }); + if (resolved) return resolved; + } + return resolved; +} - if (profile.sso_session) { - if (!profile.sso_account_id || !profile.sso_role_name) { - throw AWS.util.error( - new Error('Profile ' + this.profile + ' with session ' + profile.sso_session + - ' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_session", ' + - '"sso_role_name". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'), - { code: self.errorCode } - ); - } - } else { - if (!profile.sso_start_url || !profile.sso_account_id || !profile.sso_region || !profile.sso_role_name) { - throw AWS.util.error( - new Error('Profile ' + this.profile + ' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", ' + - '"sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'), - { code: self.errorCode } - ); - } - } +module.exports = resolveRegionalEndpointsFlag; - this.getToken(this.profile, profile, function (err, token) { - if (err) { - return callback(err); - } - var request = { - accessToken: token, - accountId: profile.sso_account_id, - roleName: profile.sso_role_name, - }; - if (!self.service || self.service.config.region !== profile.sso_region) { - self.service = new AWS.SSO({ - region: profile.sso_region, - httpOptions: self.httpOptions, - }); - } +/***/ }), - self.service.getRoleCredentials(request, function(err, data) { - if (err || !data || !data.roleCredentials) { - callback(AWS.util.error( - err || new Error('Please log in using "aws sso login"'), - { code: self.errorCode } - ), null); - } else if (!data.roleCredentials.accessKeyId || !data.roleCredentials.secretAccessKey || !data.roleCredentials.sessionToken || !data.roleCredentials.expiration) { - throw AWS.util.error(new Error( - 'SSO returns an invalid temporary credential.' - )); - } else { - self.expired = false; - self.accessKeyId = data.roleCredentials.accessKeyId; - self.secretAccessKey = data.roleCredentials.secretAccessKey; - self.sessionToken = data.roleCredentials.sessionToken; - self.expireTime = new Date(data.roleCredentials.expiration); - callback(null); - } - }); - }); - } catch (err) { - callback(err); - } - }, +/***/ 28437: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @private - * Uses legacy file system retrieval or if sso-session is set, - * use the SSOTokenProvider. - * - * @param {string} profileName - name of the profile. - * @param {object} profile - profile data containing sso_session or sso_start_url etc. - * @param {function} callback - called with (err, (string) token). - * - * @returns {void} - */ - getToken: function getToken(profileName, profile, callback) { - var self = this; +/** + * The main AWS namespace + */ +var AWS = { util: __nccwpck_require__(77985) }; - if (profile.sso_session) { - var _iniLoader = AWS.util.iniLoader; - var ssoSessions = _iniLoader.loadSsoSessionsFrom(); - var ssoSession = ssoSessions[profile.sso_session]; - Object.assign(profile, ssoSession); +/** + * @api private + * @!macro [new] nobrowser + * @note This feature is not supported in the browser environment of the SDK. + */ +var _hidden = {}; _hidden.toString(); // hack to parse macro - var ssoTokenProvider = new AWS.SSOTokenProvider({ - profile: profileName, - }); - ssoTokenProvider.load(function (err) { - if (err) { - return callback(err); - } - return callback(null, ssoTokenProvider.token); - }); - return; - } +/** + * @api private + */ +module.exports = AWS; - try { - /** - * The time window (15 mins) that SDK will treat the SSO token expires in before the defined expiration date in token. - * This is needed because server side may have invalidated the token before the defined expiration date. - */ - var EXPIRE_WINDOW_MS = 15 * 60 * 1000; - var hasher = crypto.createHash('sha1'); - var fileName = hasher.update(profile.sso_start_url).digest('hex') + '.json'; - var cachePath = path.join( - iniLoader.getHomeDir(), - '.aws', - 'sso', - 'cache', - fileName - ); - var cacheFile = AWS.util.readFileSync(cachePath); - var cacheContent = null; - if (cacheFile) { - cacheContent = JSON.parse(cacheFile); - } - if (!cacheContent) { - throw AWS.util.error( - new Error('Cached credentials not found under ' + this.profile + ' profile. Please make sure you log in with aws sso login first'), - { code: self.errorCode } - ); - } +AWS.util.update(AWS, { - if (!cacheContent.startUrl || !cacheContent.region || !cacheContent.accessToken || !cacheContent.expiresAt) { - throw AWS.util.error( - new Error('Cached credentials are missing required properties. Try running aws sso login.') - ); - } + /** + * @constant + */ + VERSION: '2.1687.0', - if (new Date(cacheContent.expiresAt).getTime() - Date.now() <= EXPIRE_WINDOW_MS) { - throw AWS.util.error(new Error( - 'The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.' - )); - } + /** + * @api private + */ + Signers: {}, - return callback(null, cacheContent.accessToken); - } catch (err) { - return callback(err, null); - } + /** + * @api private + */ + Protocol: { + Json: __nccwpck_require__(30083), + Query: __nccwpck_require__(90761), + Rest: __nccwpck_require__(98200), + RestJson: __nccwpck_require__(5883), + RestXml: __nccwpck_require__(15143) }, /** - * Loads the credentials from the AWS SSO process - * - * @callback callback function(err) - * Called after the AWS SSO process has been executed. When this - * callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get + * @api private */ - refresh: function refresh(callback) { - iniLoader.clearCachedFiles(); - this.coalesceRefresh(callback || AWS.util.fn.callback); + XML: { + Builder: __nccwpck_require__(23546), + Parser: null // conditionally set based on environment + }, + + /** + * @api private + */ + JSON: { + Builder: __nccwpck_require__(47495), + Parser: __nccwpck_require__(5474) + }, + + /** + * @api private + */ + Model: { + Api: __nccwpck_require__(17657), + Operation: __nccwpck_require__(28083), + Shape: __nccwpck_require__(71349), + Paginator: __nccwpck_require__(45938), + ResourceWaiter: __nccwpck_require__(41368) }, + + /** + * @api private + */ + apiLoader: __nccwpck_require__(52793), + + /** + * @api private + */ + EndpointCache: (__nccwpck_require__(96323)/* .EndpointCache */ .$) }); +__nccwpck_require__(55948); +__nccwpck_require__(68903); +__nccwpck_require__(38110); +__nccwpck_require__(1556); +__nccwpck_require__(54995); +__nccwpck_require__(78652); +__nccwpck_require__(58743); +__nccwpck_require__(39925); +__nccwpck_require__(9897); +__nccwpck_require__(99127); +__nccwpck_require__(93985); + +/** + * @readonly + * @return [AWS.SequentialExecutor] a collection of global event listeners that + * are attached to every sent request. + * @see AWS.Request AWS.Request for a list of events to listen for + * @example Logging the time taken to send a request + * AWS.events.on('send', function startSend(resp) { + * resp.startTime = new Date().getTime(); + * }).on('complete', function calculateTime(resp) { + * var time = (new Date().getTime() - resp.startTime) / 1000; + * console.log('Request took ' + time + ' seconds'); + * }); + * + * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds' + */ +AWS.events = new AWS.SequentialExecutor(); + +//create endpoint cache lazily +AWS.util.memoizedProperty(AWS, 'endpointCache', function() { + return new AWS.EndpointCache(AWS.config.endpointCacheSize); +}, true); /***/ }), -/***/ 77360: +/***/ 53819: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var STS = __nccwpck_require__(57513); /** - * Represents temporary credentials retrieved from {AWS.STS}. Without any - * extra parameters, credentials will be fetched from the - * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the - * {AWS.STS.assumeRole} operation will be used to fetch credentials for the - * role instead. - * - * @note AWS.TemporaryCredentials is deprecated, but remains available for - * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the - * preferred class for temporary credentials. + * Represents your AWS security credentials, specifically the + * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}. + * Creating a `Credentials` object allows you to pass around your + * security information to configuration and service objects. * - * To setup temporary credentials, configure a set of master credentials - * using the standard credentials providers (environment, EC2 instance metadata, - * or from the filesystem), then set the global credentials to a new - * temporary credentials object: + * Note that this class typically does not need to be constructed manually, + * as the {AWS.Config} and {AWS.Service} classes both accept simple + * options hashes with the three keys. These structures will be converted + * into Credentials objects automatically. * - * ```javascript - * // Note that environment credentials are loaded by default, - * // the following line is shown for clarity: - * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS'); + * ## Expiring and Refreshing Credentials * - * // Now set temporary credentials seeded from the master credentials - * AWS.config.credentials = new AWS.TemporaryCredentials(); + * Occasionally credentials can expire in the middle of a long-running + * application. In this case, the SDK will automatically attempt to + * refresh the credentials from the storage location if the Credentials + * class implements the {refresh} method. * - * // subsequent requests will now use temporary credentials from AWS STS. - * new AWS.S3().listBucket(function(err, data) { ... }); - * ``` + * If you are implementing a credential storage location, you + * will want to create a subclass of the `Credentials` class and + * override the {refresh} method. This method allows credentials to be + * retrieved from the backing store, be it a file system, database, or + * some network storage. The method should reset the credential attributes + * on the object. * - * @!attribute masterCredentials - * @return [AWS.Credentials] the master (non-temporary) credentials used to - * get and refresh temporary credentials from AWS STS. - * @note (see constructor) + * @!attribute expired + * @return [Boolean] whether the credentials have been expired and + * require a refresh. Used in conjunction with {expireTime}. + * @!attribute expireTime + * @return [Date] a time when credentials should be considered expired. Used + * in conjunction with {expired}. + * @!attribute accessKeyId + * @return [String] the AWS access key ID + * @!attribute secretAccessKey + * @return [String] the AWS secret access key + * @!attribute sessionToken + * @return [String] an optional AWS session token */ -AWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, { +AWS.Credentials = AWS.util.inherit({ /** - * Creates a new temporary credentials object. + * A credentials object can be created using positional arguments or an options + * hash. * - * @note In order to create temporary credentials, you first need to have - * "master" credentials configured in {AWS.Config.credentials}. These - * master credentials are necessary to retrieve the temporary credentials, - * as well as refresh the credentials when they expire. - * @param params [map] a map of options that are passed to the - * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. - * If a `RoleArn` parameter is passed in, credentials will be based on the - * IAM role. - * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials - * used to get and refresh temporary credentials from AWS STS. - * @example Creating a new credentials object for generic temporary credentials - * AWS.config.credentials = new AWS.TemporaryCredentials(); - * @example Creating a new credentials object for an IAM role - * AWS.config.credentials = new AWS.TemporaryCredentials({ - * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials', - * }); - * @see AWS.STS.assumeRole - * @see AWS.STS.getSessionToken + * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null) + * Creates a Credentials object with a given set of credential information + * as positional arguments. + * @param accessKeyId [String] the AWS access key ID + * @param secretAccessKey [String] the AWS secret access key + * @param sessionToken [String] the optional AWS session token + * @example Create a credentials object with AWS credentials + * var creds = new AWS.Credentials('akid', 'secret', 'session'); + * @overload AWS.Credentials(options) + * Creates a Credentials object with a given set of credential information + * as an options hash. + * @option options accessKeyId [String] the AWS access key ID + * @option options secretAccessKey [String] the AWS secret access key + * @option options sessionToken [String] the optional AWS session token + * @example Create a credentials object with AWS credentials + * var creds = new AWS.Credentials({ + * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session' + * }); */ - constructor: function TemporaryCredentials(params, masterCredentials) { - AWS.Credentials.call(this); - this.loadMasterCredentials(masterCredentials); - this.expired = true; + constructor: function Credentials() { + // hide secretAccessKey from being displayed with util.inspect + AWS.util.hideProperties(this, ['secretAccessKey']); - this.params = params || {}; - if (this.params.RoleArn) { - this.params.RoleSessionName = - this.params.RoleSessionName || 'temporary-credentials'; + this.expired = false; + this.expireTime = null; + this.refreshCallbacks = []; + if (arguments.length === 1 && typeof arguments[0] === 'object') { + var creds = arguments[0].credentials || arguments[0]; + this.accessKeyId = creds.accessKeyId; + this.secretAccessKey = creds.secretAccessKey; + this.sessionToken = creds.sessionToken; + } else { + this.accessKeyId = arguments[0]; + this.secretAccessKey = arguments[1]; + this.sessionToken = arguments[2]; } }, /** - * Refreshes credentials using {AWS.STS.assumeRole} or - * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed - * to the credentials {constructor}. + * @return [Integer] the number of seconds before {expireTime} during which + * the credentials will be considered expired. + */ + expiryWindow: 15, + + /** + * @return [Boolean] whether the credentials object should call {refresh} + * @note Subclasses should override this method to provide custom refresh + * logic. + */ + needsRefresh: function needsRefresh() { + var currentTime = AWS.util.date.getDate().getTime(); + var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); + + if (this.expireTime && adjustedTime > this.expireTime) { + return true; + } else { + return this.expired || !this.accessKeyId || !this.secretAccessKey; + } + }, + + /** + * Gets the existing credentials, refreshing them if they are not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload credentials when they are already + * loaded into the object. * * @callback callback function(err) - * Called when the STS service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). + * When this callback is called with no error, it means either credentials + * do not need to be refreshed or refreshed credentials information has + * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, + * and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled - * @see get */ - refresh: function refresh (callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); + get: function get(callback) { + var self = this; + if (this.needsRefresh()) { + this.refresh(function(err) { + if (!err) self.expired = false; // reset expired flag + if (callback) callback(err); + }); + } else if (callback) { + callback(); + } }, /** - * @api private + * @!method getPromise() + * Returns a 'thenable' promise. + * Gets the existing credentials, refreshing them if they are not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload credentials when they are already + * loaded into the object. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it + * means either credentials do not need to be refreshed or refreshed + * credentials information has been loaded into the object (as the + * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled + * @return [Promise] A promise that represents the state of the `get` call. + * @example Calling the `getPromise` method. + * var promise = credProvider.getPromise(); + * promise.then(function() { ... }, function(err) { ... }); */ - load: function load (callback) { - var self = this; - self.createClients(); - self.masterCredentials.get(function () { - self.service.config.credentials = self.masterCredentials; - var operation = self.params.RoleArn ? - self.service.assumeRole : self.service.getSessionToken; - operation.call(self.service, function (err, data) { - if (!err) { - self.service.credentialsFrom(data, self); - } - callback(err); - }); - }); + + /** + * @!method refreshPromise() + * Returns a 'thenable' promise. + * Refreshes the credentials. Users should call {get} before attempting + * to forcibly refresh credentials. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it + * means refreshed credentials information has been loaded into the object + * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled + * @return [Promise] A promise that represents the state of the `refresh` call. + * @example Calling the `refreshPromise` method. + * var promise = credProvider.refreshPromise(); + * promise.then(function() { ... }, function(err) { ... }); + */ + + /** + * Refreshes the credentials. Users should call {get} before attempting + * to forcibly refresh credentials. + * + * @callback callback function(err) + * When this callback is called with no error, it means refreshed + * credentials information has been loaded into the object (as the + * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @note Subclasses should override this class to reset the + * {accessKeyId}, {secretAccessKey} and optional {sessionToken} + * on the credentials object and then call the callback with + * any error information. + * @see get + */ + refresh: function refresh(callback) { + this.expired = false; + callback(); }, /** * @api private + * @param callback */ - loadMasterCredentials: function loadMasterCredentials (masterCredentials) { - this.masterCredentials = masterCredentials || AWS.config.credentials; - while (this.masterCredentials.masterCredentials) { - this.masterCredentials = this.masterCredentials.masterCredentials; - } - - if (typeof this.masterCredentials.get !== 'function') { - this.masterCredentials = new AWS.Credentials(this.masterCredentials); + coalesceRefresh: function coalesceRefresh(callback, sync) { + var self = this; + if (self.refreshCallbacks.push(callback) === 1) { + self.load(function onLoad(err) { + AWS.util.arrayEach(self.refreshCallbacks, function(callback) { + if (sync) { + callback(err); + } else { + // callback could throw, so defer to ensure all callbacks are notified + AWS.util.defer(function () { + callback(err); + }); + } + }); + self.refreshCallbacks.length = 0; + }); } }, /** * @api private + * @param callback */ - createClients: function () { - this.service = this.service || new STS({params: this.params}); + load: function load(callback) { + callback(); } - }); +/** + * @api private + */ +AWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); + this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); +}; + +/** + * @api private + */ +AWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.getPromise; + delete this.prototype.refreshPromise; +}; + +AWS.util.addPromises(AWS.Credentials); + /***/ }), -/***/ 11017: +/***/ 57083: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var fs = __nccwpck_require__(57147); var STS = __nccwpck_require__(57513); -var iniLoader = AWS.util.iniLoader; /** - * Represents OIDC credentials from a file on disk - * If the credentials expire, the SDK can {refresh} the credentials - * from the file. + * Represents temporary credentials retrieved from {AWS.STS}. Without any + * extra parameters, credentials will be fetched from the + * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the + * {AWS.STS.assumeRole} operation will be used to fetch credentials for the + * role instead. * - * ## Using the web identity token file + * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in + * the way masterCredentials and refreshes are handled. + * AWS.ChainableTemporaryCredentials refreshes expired credentials using the + * masterCredentials passed by the user to support chaining of STS credentials. + * However, AWS.TemporaryCredentials recursively collapses the masterCredentials + * during instantiation, precluding the ability to refresh credentials which + * require intermediate, temporary credentials. * - * This provider is checked by default in the Node.js environment. To use - * the provider simply add your OIDC token to a file (ASCII encoding) and - * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment - * variable or web_identity_token_file shared config variable + * For example, if the application should use RoleA, which must be assumed from + * RoleB, and the environment provides credentials which can assume RoleB, then + * AWS.ChainableTemporaryCredentials must be used to support refreshing the + * temporary credentials for RoleA: * - * The file contains encoded OIDC token and the characters are - * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT). - * JWT's are 3 base64 encoded strings joined by the '.' character. + * ```javascript + * var roleACreds = new AWS.ChainableTemporaryCredentials({ + * params: {RoleArn: 'RoleA'}, + * masterCredentials: new AWS.ChainableTemporaryCredentials({ + * params: {RoleArn: 'RoleB'}, + * masterCredentials: new AWS.EnvironmentCredentials('AWS') + * }) + * }); + * ``` * - * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE - * environment variable or web_identity_token_file shared config variable, - * and get the OIDC token from filename. - * It will also read IAM role to be assumed from AWS_ROLE_ARN - * environment variable or role_arn shared config variable. - * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity} - * service operation + * If AWS.TemporaryCredentials had been used in the previous example, + * `roleACreds` would fail to refresh because `roleACreds` would + * use the environment credentials for the AssumeRole request. + * + * Another difference is that AWS.ChainableTemporaryCredentials creates the STS + * service instance during instantiation while AWS.TemporaryCredentials creates + * the STS service instance during the first refresh. Creating the service + * instance during instantiation effectively captures the master credentials + * from the global config, so that subsequent changes to the global config do + * not affect the master credentials used to refresh the temporary credentials. + * + * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned + * to AWS.config.credentials: + * + * ```javascript + * var envCreds = new AWS.EnvironmentCredentials('AWS'); + * AWS.config.credentials = envCreds; + * // masterCredentials will be envCreds + * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ + * params: {RoleArn: '...'} + * }); + * ``` + * + * Similarly, to use the CredentialProviderChain's default providers as the + * master credentials, simply create a new instance of + * AWS.ChainableTemporaryCredentials: + * + * ```javascript + * AWS.config.credentials = new ChainableTemporaryCredentials({ + * params: {RoleArn: '...'} + * }); + * ``` * - * @!macro nobrowser + * @!attribute service + * @return [AWS.STS] the STS service instance used to + * get and refresh temporary credentials from AWS STS. + * @note (see constructor) */ -AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { - +AWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, { /** - * @example Creating a new credentials object - * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials( - * // optionally provide configuration to apply to the underlying AWS.STS service client - * // if configuration is not provided, then configuration will be pulled from AWS.config - * { - * // specify timeout options - * httpOptions: { - * timeout: 100 + * Creates a new temporary credentials object. + * + * @param options [map] a set of options + * @option options params [map] ({}) a map of options that are passed to the + * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. + * If a `RoleArn` parameter is passed in, credentials will be based on the + * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must + * also be passed in or an error will be thrown. + * @option options masterCredentials [AWS.Credentials] the master credentials + * used to get and refresh temporary credentials from AWS STS. By default, + * AWS.config.credentials or AWS.config.credentialProvider will be used. + * @option options tokenCodeFn [Function] (null) Function to provide + * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function + * is called with value of `SerialNumber` and `callback`, and should provide + * the `TokenCode` or an error to the callback in the format + * `callback(err, token)`. + * @example Creating a new credentials object for generic temporary credentials + * AWS.config.credentials = new AWS.ChainableTemporaryCredentials(); + * @example Creating a new credentials object for an IAM role + * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ + * params: { + * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials' * } * }); - * @see AWS.Config + * @see AWS.STS.assumeRole + * @see AWS.STS.getSessionToken */ - constructor: function TokenFileWebIdentityCredentials(clientConfig) { + constructor: function ChainableTemporaryCredentials(options) { AWS.Credentials.call(this); - this.data = null; - this.clientConfig = AWS.util.copy(clientConfig || {}); - }, - - /** - * Returns params from environment variables - * - * @api private - */ - getParamsFromEnv: function getParamsFromEnv() { - var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE', - ENV_ROLE_ARN = 'AWS_ROLE_ARN'; - if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) { - return [{ - envTokenFile: process.env[ENV_TOKEN_FILE], - roleArn: process.env[ENV_ROLE_ARN], - roleSessionName: process.env['AWS_ROLE_SESSION_NAME'] - }]; - } - }, - - /** - * Returns params from shared config variables - * - * @api private - */ - getParamsFromSharedConfig: function getParamsFromSharedConfig() { - var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader); - var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile; - var profile = profiles[profileName] || {}; + options = options || {}; + this.errorCode = 'ChainableTemporaryCredentialsProviderFailure'; + this.expired = true; + this.tokenCodeFn = null; - if (Object.keys(profile).length === 0) { - throw AWS.util.error( - new Error('Profile ' + profileName + ' not found'), - { code: 'TokenFileWebIdentityCredentialsProviderFailure' } - ); + var params = AWS.util.copy(options.params) || {}; + if (params.RoleArn) { + params.RoleSessionName = params.RoleSessionName || 'temporary-credentials'; } - - var paramsArray = []; - - while (!profile['web_identity_token_file'] && profile['source_profile']) { - paramsArray.unshift({ - roleArn: profile['role_arn'], - roleSessionName: profile['role_session_name'] - }); - var sourceProfile = profile['source_profile']; - profile = profiles[sourceProfile]; + if (params.SerialNumber) { + if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) { + throw new AWS.util.error( + new Error('tokenCodeFn must be a function when params.SerialNumber is given'), + {code: this.errorCode} + ); + } else { + this.tokenCodeFn = options.tokenCodeFn; + } } - - paramsArray.unshift({ - envTokenFile: profile['web_identity_token_file'], - roleArn: profile['role_arn'], - roleSessionName: profile['role_session_name'] - }); - - return paramsArray; + var config = AWS.util.merge( + { + params: params, + credentials: options.masterCredentials || AWS.config.credentials + }, + options.stsConfig || {} + ); + this.service = new STS(config); }, /** - * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} + * Refreshes credentials using {AWS.STS.assumeRole} or + * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed + * to the credentials {constructor}. * * @callback callback function(err) * Called when the STS service responds (or fails). When @@ -20770,87 +19379,53 @@ AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /** * @api private - */ - assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) { - var self = this; - if (paramsArray.length === 0) { - self.service.credentialsFrom(self.data, self); - callback(); - } else { - var params = paramsArray.shift(); - self.service.config.credentials = self.service.credentialsFrom(self.data, self); - self.service.assumeRole( - { - RoleArn: params.roleArn, - RoleSessionName: params.roleSessionName || 'token-file-web-identity' - }, - function (err, data) { - self.data = null; - if (err) { - callback(err); - } else { - self.data = data; - self.assumeRoleChaining(paramsArray, callback); - } - } - ); - } - }, - - /** - * @api private + * @param callback */ load: function load(callback) { var self = this; - try { - var paramsArray = self.getParamsFromEnv(); - if (!paramsArray) { - paramsArray = self.getParamsFromSharedConfig(); + var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken'; + this.getTokenCode(function (err, tokenCode) { + var params = {}; + if (err) { + callback(err); + return; } - if (paramsArray) { - var params = paramsArray.shift(); - var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'}); - if (!self.service) { - self.createClients(); - } - self.service.assumeRoleWithWebIdentity( - { - WebIdentityToken: oidcToken, - RoleArn: params.roleArn, - RoleSessionName: params.roleSessionName || 'token-file-web-identity' - }, - function (err, data) { - self.data = null; - if (err) { - callback(err); - } else { - self.data = data; - self.assumeRoleChaining(paramsArray, callback); - } - } - ); + if (tokenCode) { + params.TokenCode = tokenCode; } - } catch (err) { - callback(err); - } + self.service[operation](params, function (err, data) { + if (!err) { + self.service.credentialsFrom(data, self); + } + callback(err); + }); + }); }, /** * @api private */ - createClients: function() { - if (!this.service) { - var stsConfig = AWS.util.merge({}, this.clientConfig); - this.service = new STS(stsConfig); - - // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken - this.service.retryableError = function(error) { - if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') { - return true; - } else { - return AWS.Service.prototype.retryableError.call(this, error); + getTokenCode: function getTokenCode(callback) { + var self = this; + if (this.tokenCodeFn) { + this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) { + if (err) { + var message = err; + if (err instanceof Error) { + message = err.message; + } + callback( + AWS.util.error( + new Error('Error fetching MFA token: ' + message), + { code: self.errorCode} + ) + ); + return; } - }; + callback(null, token); + }); + } else { + callback(null); } } }); @@ -20858,22 +19433,42 @@ AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /***/ }), -/***/ 74998: +/***/ 3498: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); +var CognitoIdentity = __nccwpck_require__(58291); var STS = __nccwpck_require__(57513); /** - * Represents credentials retrieved from STS Web Identity Federation support. + * Represents credentials retrieved from STS Web Identity Federation using + * the Amazon Cognito Identity service. * * By default this provider gets credentials using the - * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation - * requires a `RoleArn` containing the ARN of the IAM trust policy for the - * application for which credentials will be given. In addition, the - * `WebIdentityToken` must be set to the token provided by the identity - * provider. See {constructor} for an example on creating a credentials - * object with proper `RoleArn` and `WebIdentityToken` values. + * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which + * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito + * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to + * obtain an `IdentityId`. If the identity or identity pool is not configured in + * the Amazon Cognito Console to use IAM roles with the appropriate permissions, + * then additionally a `RoleArn` is required containing the ARN of the IAM trust + * policy for the Amazon Cognito role that the user will log into. If a `RoleArn` + * is provided, then this provider gets credentials using the + * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an + * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}. + * + * In addition, if this credential provider is used to provide authenticated + * login, the `Logins` map may be set to the tokens provided by the respective + * identity providers. See {constructor} for an example on creating a credentials + * object with proper property values. + * + * DISCLAIMER: This convenience method leverages the Enhanced (simplified) Authflow. The underlying + * implementation calls Cognito's `getId()` and `GetCredentialsForIdentity()`. + * In this flow there is no way to explicitly set a session policy, resulting in + * STS attaching the default policy and limiting the permissions of the federated role. + * To be able to explicitly set a session policy, do not use this convenience method. + * Instead, you can use the Cognito client to call `getId()`, `GetOpenIdToken()` and then use + * that token with your desired session policy to call STS's `AssumeRoleWithWebIdentity()` + * For further reading refer to: https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html * * ## Refreshing Credentials from Identity Service * @@ -20889,37496 +19484,37869 @@ var STS = __nccwpck_require__(57513); * token from the identity provider: * * ```javascript - * AWS.config.credentials.params.WebIdentityToken = updatedToken; + * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken; * ``` * * Future calls to `credentials.refresh()` will now use the new token. * * @!attribute params * @return [map] the map of params passed to + * {AWS.CognitoIdentity.getId}, + * {AWS.CognitoIdentity.getOpenIdToken}, and * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the * `params.WebIdentityToken` property. * @!attribute data * @return [map] the raw data response from the call to + * {AWS.CognitoIdentity.getCredentialsForIdentity}, or * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get * access to other properties from the response. + * @!attribute identityId + * @return [String] the Cognito ID returned by the last call to + * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual + * final resolved identity ID from Amazon Cognito. */ -AWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { +AWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * @api private + */ + localStorageKey: { + id: 'aws.cognito.identity-id.', + providers: 'aws.cognito.identity-providers.' + }, + /** * Creates a new credentials object. - * @param (see AWS.STS.assumeRoleWithWebIdentity) * @example Creating a new credentials object - * AWS.config.credentials = new AWS.WebIdentityCredentials({ - * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity', - * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service - * RoleSessionName: 'web' // optional name, defaults to web-identity + * AWS.config.credentials = new AWS.CognitoIdentityCredentials({ + * + * // either IdentityPoolId or IdentityId is required + * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below) + * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity + * // or AWS.CognitoIdentity.getOpenIdToken (linked below) + * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030', + * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f' + * + * // optional, only necessary when the identity pool is not configured + * // to use IAM roles in the Amazon Cognito Console + * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below) + * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity', + * + * // optional tokens, used for authenticated login + * // See the Logins param for AWS.CognitoIdentity.getID (linked below) + * Logins: { + * 'graph.facebook.com': 'FBTOKEN', + * 'www.amazon.com': 'AMAZONTOKEN', + * 'accounts.google.com': 'GOOGLETOKEN', + * 'api.twitter.com': 'TWITTERTOKEN', + * 'www.digits.com': 'DIGITSTOKEN' + * }, + * + * // optional name, defaults to web-identity + * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below) + * RoleSessionName: 'web', + * + * // optional, only necessary when application runs in a browser + * // and multiple users are signed in at once, used for caching + * LoginId: 'example@gmail.com' + * * }, { - * // optionally provide configuration to apply to the underlying AWS.STS service client - * // if configuration is not provided, then configuration will be pulled from AWS.config + * // optionally provide configuration to apply to the underlying service clients + * // if configuration is not provided, then configuration will be pulled from AWS.config * - * // specify timeout options - * httpOptions: { - * timeout: 100 - * } + * // region should match the region your identity pool is located in + * region: 'us-east-1', + * + * // specify timeout options + * httpOptions: { + * timeout: 100 + * } * }); + * @see AWS.CognitoIdentity.getId + * @see AWS.CognitoIdentity.getCredentialsForIdentity * @see AWS.STS.assumeRoleWithWebIdentity + * @see AWS.CognitoIdentity.getOpenIdToken * @see AWS.Config + * @note If a region is not provided in the global AWS.config, or + * specified in the `clientConfig` to the CognitoIdentityCredentials + * constructor, you may encounter a 'Missing credentials in config' error + * when calling making a service call. */ - constructor: function WebIdentityCredentials(params, clientConfig) { + constructor: function CognitoIdentityCredentials(params, clientConfig) { AWS.Credentials.call(this); this.expired = true; this.params = params; - this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity'; this.data = null; + this._identityId = null; this._clientConfig = AWS.util.copy(clientConfig || {}); - }, - - /** - * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} - * - * @callback callback function(err) - * Called when the STS service responds (or fails). When - * this callback is called with no error, it means that the credentials - * information has been loaded into the object (as the `accessKeyId`, - * `secretAccessKey`, and `sessionToken` properties). - * @param err [Error] if an error occurred, this value will be filled - * @see get - */ - refresh: function refresh(callback) { - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, - - /** - * @api private - */ - load: function load(callback) { + this.loadCachedId(); var self = this; - self.createClients(); - self.service.assumeRoleWithWebIdentity(function (err, data) { - self.data = null; - if (!err) { - self.data = data; - self.service.credentialsFrom(data, self); + Object.defineProperty(this, 'identityId', { + get: function() { + self.loadCachedId(); + return self._identityId || self.params.IdentityId; + }, + set: function(identityId) { + self._identityId = identityId; } - callback(err); }); }, /** - * @api private - */ - createClients: function() { - if (!this.service) { - var stsConfig = AWS.util.merge({}, this._clientConfig); - stsConfig.params = this.params; - this.service = new STS(stsConfig); - } - } - -}); - - -/***/ }), - -/***/ 45313: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var util = __nccwpck_require__(77985); -var endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED']; - -/** - * Generate key (except resources and operation part) to index the endpoints in the cache - * If input shape has endpointdiscoveryid trait then use - * accessKey + operation + resources + region + service as cache key - * If input shape doesn't have endpointdiscoveryid trait then use - * accessKey + region + service as cache key - * @return [map] object with keys to index endpoints. - * @api private - */ -function getCacheKey(request) { - var service = request.service; - var api = service.api || {}; - var operations = api.operations; - var identifiers = {}; - if (service.config.region) { - identifiers.region = service.config.region; - } - if (api.serviceId) { - identifiers.serviceId = api.serviceId; - } - if (service.config.credentials.accessKeyId) { - identifiers.accessKeyId = service.config.credentials.accessKeyId; - } - return identifiers; -} - -/** - * Recursive helper for marshallCustomIdentifiers(). - * Looks for required string input members that have 'endpointdiscoveryid' trait. - * @api private - */ -function marshallCustomIdentifiersHelper(result, params, shape) { - if (!shape || params === undefined || params === null) return; - if (shape.type === 'structure' && shape.required && shape.required.length > 0) { - util.arrayEach(shape.required, function(name) { - var memberShape = shape.members[name]; - if (memberShape.endpointDiscoveryId === true) { - var locationName = memberShape.isLocationName ? memberShape.name : name; - result[locationName] = String(params[name]); - } else { - marshallCustomIdentifiersHelper(result, params[name], memberShape); - } - }); - } -} - -/** - * Get custom identifiers for cache key. - * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait. - * @param [object] request object - * @param [object] input shape of the given operation's api - * @api private - */ -function marshallCustomIdentifiers(request, shape) { - var identifiers = {}; - marshallCustomIdentifiersHelper(identifiers, request.params, shape); - return identifiers; -} - -/** - * Call endpoint discovery operation when it's optional. - * When endpoint is available in cache then use the cached endpoints. If endpoints - * are unavailable then use regional endpoints and call endpoint discovery operation - * asynchronously. This is turned off by default. - * @param [object] request object - * @api private - */ -function optionalDiscoverEndpoint(request) { - var service = request.service; - var api = service.api; - var operationModel = api.operations ? api.operations[request.operation] : undefined; - var inputShape = operationModel ? operationModel.input : undefined; - - var identifiers = marshallCustomIdentifiers(request, inputShape); - var cacheKey = getCacheKey(request); - if (Object.keys(identifiers).length > 0) { - cacheKey = util.update(cacheKey, identifiers); - if (operationModel) cacheKey.operation = operationModel.name; - } - var endpoints = AWS.endpointCache.get(cacheKey); - if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { - //endpoint operation is being made but response not yet received - //or endpoint operation just failed in 1 minute - return; - } else if (endpoints && endpoints.length > 0) { - //found endpoint record from cache - request.httpRequest.updateEndpoint(endpoints[0].Address); - } else { - //endpoint record not in cache or outdated. make discovery operation - var endpointRequest = service.makeRequest(api.endpointOperation, { - Operation: operationModel.name, - Identifiers: identifiers, - }); - addApiVersionHeader(endpointRequest); - endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); - endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK); - //put in a placeholder for endpoints already requested, prevent - //too much in-flight calls - AWS.endpointCache.put(cacheKey, [{ - Address: '', - CachePeriodInMinutes: 1 - }]); - endpointRequest.send(function(err, data) { - if (data && data.Endpoints) { - AWS.endpointCache.put(cacheKey, data.Endpoints); - } else if (err) { - AWS.endpointCache.put(cacheKey, [{ - Address: '', - CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute - }]); + * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity}, + * or {AWS.STS.assumeRoleWithWebIdentity}. + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see AWS.Credentials.get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, + + /** + * @api private + * @param callback + */ + load: function load(callback) { + var self = this; + self.createClients(); + self.data = null; + self._identityId = null; + self.getId(function(err) { + if (!err) { + if (!self.params.RoleArn) { + self.getCredentialsForIdentity(callback); + } else { + self.getCredentialsFromSTS(callback); + } + } else { + self.clearIdOnNotAuthorized(err); + callback(err); } }); - } -} - -var requestQueue = {}; + }, -/** - * Call endpoint discovery operation when it's required. - * When endpoint is available in cache then use cached ones. If endpoints are - * unavailable then SDK should call endpoint operation then use returned new - * endpoint for the api call. SDK will automatically attempt to do endpoint - * discovery. This is turned off by default - * @param [object] request object - * @api private - */ -function requiredDiscoverEndpoint(request, done) { - var service = request.service; - var api = service.api; - var operationModel = api.operations ? api.operations[request.operation] : undefined; - var inputShape = operationModel ? operationModel.input : undefined; + /** + * Clears the cached Cognito ID associated with the currently configured + * identity pool ID. Use this to manually invalidate your cache if + * the identity pool ID was deleted. + */ + clearCachedId: function clearCache() { + this._identityId = null; + delete this.params.IdentityId; - var identifiers = marshallCustomIdentifiers(request, inputShape); - var cacheKey = getCacheKey(request); - if (Object.keys(identifiers).length > 0) { - cacheKey = util.update(cacheKey, identifiers); - if (operationModel) cacheKey.operation = operationModel.name; - } - var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey); - var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys - if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { - //endpoint operation is being made but response not yet received - //push request object to a pending queue - if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = []; - requestQueue[cacheKeyStr].push({request: request, callback: done}); - return; - } else if (endpoints && endpoints.length > 0) { - request.httpRequest.updateEndpoint(endpoints[0].Address); - done(); - } else { - var endpointRequest = service.makeRequest(api.endpointOperation, { - Operation: operationModel.name, - Identifiers: identifiers, - }); - endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); - addApiVersionHeader(endpointRequest); + var poolId = this.params.IdentityPoolId; + var loginId = this.params.LoginId || ''; + delete this.storage[this.localStorageKey.id + poolId + loginId]; + delete this.storage[this.localStorageKey.providers + poolId + loginId]; + }, - //put in a placeholder for endpoints already requested, prevent - //too much in-flight calls - AWS.endpointCache.put(cacheKeyStr, [{ - Address: '', - CachePeriodInMinutes: 60 //long-live cache - }]); - endpointRequest.send(function(err, data) { - if (err) { - request.response.error = util.error(err, { retryable: false }); - AWS.endpointCache.remove(cacheKey); + /** + * @api private + */ + clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) { + var self = this; + if (err.code == 'NotAuthorizedException') { + self.clearCachedId(); + } + }, - //fail all the pending requests in batch - if (requestQueue[cacheKeyStr]) { - var pendingRequests = requestQueue[cacheKeyStr]; - util.arrayEach(pendingRequests, function(requestContext) { - requestContext.request.response.error = util.error(err, { retryable: false }); - requestContext.callback(); - }); - delete requestQueue[cacheKeyStr]; - } - } else if (data) { - AWS.endpointCache.put(cacheKeyStr, data.Endpoints); - request.httpRequest.updateEndpoint(data.Endpoints[0].Address); + /** + * Retrieves a Cognito ID, loading from cache if it was already retrieved + * on this device. + * + * @callback callback function(err, identityId) + * @param err [Error, null] an error object if the call failed or null if + * it succeeded. + * @param identityId [String, null] if successful, the callback will return + * the Cognito ID. + * @note If not loaded explicitly, the Cognito ID is loaded and stored in + * localStorage in the browser environment of a device. + * @api private + */ + getId: function getId(callback) { + var self = this; + if (typeof self.params.IdentityId === 'string') { + return callback(null, self.params.IdentityId); + } - //update the endpoint for all the pending requests in batch - if (requestQueue[cacheKeyStr]) { - var pendingRequests = requestQueue[cacheKeyStr]; - util.arrayEach(pendingRequests, function(requestContext) { - requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address); - requestContext.callback(); - }); - delete requestQueue[cacheKeyStr]; - } + self.cognito.getId(function(err, data) { + if (!err && data.IdentityId) { + self.params.IdentityId = data.IdentityId; + callback(null, data.IdentityId); + } else { + callback(err); } - done(); }); - } -} + }, -/** - * add api version header to endpoint operation - * @api private - */ -function addApiVersionHeader(endpointRequest) { - var api = endpointRequest.service.api; - var apiVersion = api.apiVersion; - if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) { - endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion; - } -} -/** - * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid - * endpoint from cache. - * @api private - */ -function invalidateCachedEndpoints(response) { - var error = response.error; - var httpResponse = response.httpResponse; - if (error && - (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) - ) { - var request = response.request; - var operations = request.service.api.operations || {}; - var inputShape = operations[request.operation] ? operations[request.operation].input : undefined; - var identifiers = marshallCustomIdentifiers(request, inputShape); - var cacheKey = getCacheKey(request); - if (Object.keys(identifiers).length > 0) { - cacheKey = util.update(cacheKey, identifiers); - if (operations[request.operation]) cacheKey.operation = operations[request.operation].name; - } - AWS.endpointCache.remove(cacheKey); - } -} + /** + * @api private + */ + loadCredentials: function loadCredentials(data, credentials) { + if (!data || !credentials) return; + credentials.expired = false; + credentials.accessKeyId = data.Credentials.AccessKeyId; + credentials.secretAccessKey = data.Credentials.SecretKey; + credentials.sessionToken = data.Credentials.SessionToken; + credentials.expireTime = data.Credentials.Expiration; + }, -/** - * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime. - * @param [object] client Service client object. - * @api private - */ -function hasCustomEndpoint(client) { - //if set endpoint is set for specific client, enable endpoint discovery will raise an error. - if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) { - throw util.error(new Error(), { - code: 'ConfigurationException', - message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.' + /** + * @api private + */ + getCredentialsForIdentity: function getCredentialsForIdentity(callback) { + var self = this; + self.cognito.getCredentialsForIdentity(function(err, data) { + if (!err) { + self.cacheId(data); + self.data = data; + self.loadCredentials(self.data, self); + } else { + self.clearIdOnNotAuthorized(err); + } + callback(err); }); - }; - var svcConfig = AWS.config[client.serviceIdentifier] || {}; - return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint)); -} + }, -/** - * @api private - */ -function isFalsy(value) { - return ['false', '0'].indexOf(value) >= 0; -} + /** + * @api private + */ + getCredentialsFromSTS: function getCredentialsFromSTS(callback) { + var self = this; + self.cognito.getOpenIdToken(function(err, data) { + if (!err) { + self.cacheId(data); + self.params.WebIdentityToken = data.Token; + self.webIdentityCredentials.refresh(function(webErr) { + if (!webErr) { + self.data = self.webIdentityCredentials.data; + self.sts.credentialsFrom(self.data, self); + } + callback(webErr); + }); + } else { + self.clearIdOnNotAuthorized(err); + callback(err); + } + }); + }, -/** - * If endpoint discovery should perform for this request when no operation requires endpoint - * discovery for the given service. - * SDK performs config resolution in order like below: - * 1. If set in client configuration. - * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY. - * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'. - * @param [object] request request object. - * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this - * function returns undefined - * @api private - */ -function resolveEndpointDiscoveryConfig(request) { - var service = request.service || {}; - if (service.config.endpointDiscoveryEnabled !== undefined) { - return service.config.endpointDiscoveryEnabled; - } + /** + * @api private + */ + loadCachedId: function loadCachedId() { + var self = this; - //shared ini file is only available in Node - //not to check env in browser - if (util.isBrowser()) return undefined; + // in the browser we source default IdentityId from localStorage + if (AWS.util.isBrowser() && !self.params.IdentityId) { + var id = self.getStorage('id'); + if (id && self.params.Logins) { + var actualProviders = Object.keys(self.params.Logins); + var cachedProviders = + (self.getStorage('providers') || '').split(','); - // If any of recognized endpoint discovery config env is set - for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) { - var env = endpointDiscoveryEnabledEnvs[i]; - if (Object.prototype.hasOwnProperty.call(process.env, env)) { - if (process.env[env] === '' || process.env[env] === undefined) { - throw util.error(new Error(), { - code: 'ConfigurationException', - message: 'environmental variable ' + env + ' cannot be set to nothing' + // only load ID if at least one provider used this ID before + var intersect = cachedProviders.filter(function(n) { + return actualProviders.indexOf(n) !== -1; }); + if (intersect.length !== 0) { + self.params.IdentityId = id; + } + } else if (id) { + self.params.IdentityId = id; } - return !isFalsy(process.env[env]); } - } + }, - var configFile = {}; - try { - configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({ - isConfig: true, - filename: process.env[AWS.util.sharedConfigFileEnv] - }) : {}; - } catch (e) {} - var sharedFileConfig = configFile[ - process.env.AWS_PROFILE || AWS.util.defaultProfile - ] || {}; - if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) { - if (sharedFileConfig.endpoint_discovery_enabled === undefined) { - throw util.error(new Error(), { - code: 'ConfigurationException', - message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing' - }); + /** + * @api private + */ + createClients: function() { + var clientConfig = this._clientConfig; + this.webIdentityCredentials = this.webIdentityCredentials || + new AWS.WebIdentityCredentials(this.params, clientConfig); + if (!this.cognito) { + var cognitoConfig = AWS.util.merge({}, clientConfig); + cognitoConfig.params = this.params; + this.cognito = new CognitoIdentity(cognitoConfig); } - return !isFalsy(sharedFileConfig.endpoint_discovery_enabled); - } - return undefined; -} + this.sts = this.sts || new STS(clientConfig); + }, -/** - * attach endpoint discovery logic to request object - * @param [object] request - * @api private - */ -function discoverEndpoint(request, done) { - var service = request.service || {}; - if (hasCustomEndpoint(service) || request.isPresigned()) return done(); + /** + * @api private + */ + cacheId: function cacheId(data) { + this._identityId = data.IdentityId; + this.params.IdentityId = this._identityId; - var operations = service.api.operations || {}; - var operationModel = operations[request.operation]; - var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL'; - var isEnabled = resolveEndpointDiscoveryConfig(request); - var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery; - if (isEnabled || hasRequiredEndpointDiscovery) { - // Once a customer enables endpoint discovery, the SDK should start appending - // the string endpoint-discovery to the user-agent on all requests. - request.httpRequest.appendToUserAgent('endpoint-discovery'); - } - switch (isEndpointDiscoveryRequired) { - case 'OPTIONAL': - if (isEnabled || hasRequiredEndpointDiscovery) { - // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery - // by default for all operations of that service, including operations where endpoint discovery is optional. - optionalDiscoverEndpoint(request); - request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); - } - done(); - break; - case 'REQUIRED': - if (isEnabled === false) { - // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client, - // then the SDK must return a clear and actionable exception. - request.response.error = util.error(new Error(), { - code: 'ConfigurationException', - message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation + - '() requires it. Please check your configurations.' - }); - done(); - break; + // cache this IdentityId in browser localStorage if possible + if (AWS.util.isBrowser()) { + this.setStorage('id', data.IdentityId); + + if (this.params.Logins) { + this.setStorage('providers', Object.keys(this.params.Logins).join(',')); } - request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); - requiredDiscoverEndpoint(request, done); - break; - case 'NULL': - default: - done(); - break; - } -} + } + }, -module.exports = { - discoverEndpoint: discoverEndpoint, - requiredDiscoverEndpoint: requiredDiscoverEndpoint, - optionalDiscoverEndpoint: optionalDiscoverEndpoint, - marshallCustomIdentifiers: marshallCustomIdentifiers, - getCacheKey: getCacheKey, - invalidateCachedEndpoint: invalidateCachedEndpoints, -}; + /** + * @api private + */ + getStorage: function getStorage(key) { + return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')]; + }, + + /** + * @api private + */ + setStorage: function setStorage(key, val) { + try { + this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val; + } catch (_) {} + }, + + /** + * @api private + */ + storage: (function() { + try { + var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ? + window.localStorage : {}; + + // Test set/remove which would throw an error in Safari's private browsing + storage['aws.test-storage'] = 'foobar'; + delete storage['aws.test-storage']; + + return storage; + } catch (_) { + return {}; + } + })() +}); /***/ }), -/***/ 76663: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 36965: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var util = AWS.util; -var typeOf = (__nccwpck_require__(48084).typeOf); -var DynamoDBSet = __nccwpck_require__(20304); -var NumberValue = __nccwpck_require__(91593); -AWS.DynamoDB.Converter = { - /** - * Convert a JavaScript value to its equivalent DynamoDB AttributeValue type - * - * @param data [any] The data to convert to a DynamoDB AttributeValue - * @param options [map] - * @option options convertEmptyValues [Boolean] Whether to automatically - * convert empty strings, blobs, - * and sets to `null` - * @option options wrapNumbers [Boolean] Whether to return numbers as a - * NumberValue object instead of - * converting them to native JavaScript - * numbers. This allows for the safe - * round-trip transport of numbers of - * arbitrary size. - * @return [map] An object in the Amazon DynamoDB AttributeValue format - * - * @see AWS.DynamoDB.Converter.marshall AWS.DynamoDB.Converter.marshall to - * convert entire records (rather than individual attributes) +/** + * Creates a credential provider chain that searches for AWS credentials + * in a list of credential providers specified by the {providers} property. + * + * By default, the chain will use the {defaultProviders} to resolve credentials. + * These providers will look in the environment using the + * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes. + * + * ## Setting Providers + * + * Each provider in the {providers} list should be a function that returns + * a {AWS.Credentials} object, or a hardcoded credentials object. The function + * form allows for delayed execution of the credential construction. + * + * ## Resolving Credentials from a Chain + * + * Call {resolve} to return the first valid credential object that can be + * loaded by the provider chain. + * + * For example, to resolve a chain with a custom provider that checks a file + * on disk after the set of {defaultProviders}: + * + * ```javascript + * var diskProvider = new AWS.FileSystemCredentials('./creds.json'); + * var chain = new AWS.CredentialProviderChain(); + * chain.providers.push(diskProvider); + * chain.resolve(); + * ``` + * + * The above code will return the `diskProvider` object if the + * file contains credentials and the `defaultProviders` do not contain + * any credential settings. + * + * @!attribute providers + * @return [Array] + * a list of credentials objects or functions that return credentials + * objects. If the provider is a function, the function will be + * executed lazily when the provider needs to be checked for valid + * credentials. By default, this object will be set to the + * {defaultProviders}. + * @see defaultProviders + */ +AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, { + + /** + * Creates a new CredentialProviderChain with a default set of providers + * specified by {defaultProviders}. */ - input: function convertInput(data, options) { - options = options || {}; - var type = typeOf(data); - if (type === 'Object') { - return formatMap(data, options); - } else if (type === 'Array') { - return formatList(data, options); - } else if (type === 'Set') { - return formatSet(data, options); - } else if (type === 'String') { - if (data.length === 0 && options.convertEmptyValues) { - return convertInput(null); - } - return { S: data }; - } else if (type === 'Number' || type === 'NumberValue') { - return { N: data.toString() }; - } else if (type === 'Binary') { - if (data.length === 0 && options.convertEmptyValues) { - return convertInput(null); - } - return { B: data }; - } else if (type === 'Boolean') { - return { BOOL: data }; - } else if (type === 'null') { - return { NULL: true }; - } else if (type !== 'undefined' && type !== 'Function') { - // this value has a custom constructor - return formatMap(data, options); + constructor: function CredentialProviderChain(providers) { + if (providers) { + this.providers = providers; + } else { + this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0); } + this.resolveCallbacks = []; }, /** - * Convert a JavaScript object into a DynamoDB record. - * - * @param data [any] The data to convert to a DynamoDB record - * @param options [map] - * @option options convertEmptyValues [Boolean] Whether to automatically - * convert empty strings, blobs, - * and sets to `null` - * @option options wrapNumbers [Boolean] Whether to return numbers as a - * NumberValue object instead of - * converting them to native JavaScript - * numbers. This allows for the safe - * round-trip transport of numbers of - * arbitrary size. - * - * @return [map] An object in the DynamoDB record format. + * @!method resolvePromise() + * Returns a 'thenable' promise. + * Resolves the provider chain by searching for the first set of + * credentials in {providers}. * - * @example Convert a JavaScript object into a DynamoDB record - * var marshalled = AWS.DynamoDB.Converter.marshall({ - * string: 'foo', - * list: ['fizz', 'buzz', 'pop'], - * map: { - * nestedMap: { - * key: 'value', - * } - * }, - * number: 123, - * nullValue: null, - * boolValue: true, - * stringSet: new DynamoDBSet(['foo', 'bar', 'baz']) - * }); + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function(credentials) + * Called if the promise is fulfilled and the provider resolves the chain + * to a credentials object + * @param credentials [AWS.Credentials] the credentials object resolved + * by the provider chain. + * @callback rejectedCallback function(error) + * Called if the promise is rejected. + * @param err [Error] the error object returned if no credentials are found. + * @return [Promise] A promise that represents the state of the `resolve` method call. + * @example Calling the `resolvePromise` method. + * var promise = chain.resolvePromise(); + * promise.then(function(credentials) { ... }, function(err) { ... }); */ - marshall: function marshallItem(data, options) { - return AWS.DynamoDB.Converter.input(data, options).M; - }, /** - * Convert a DynamoDB AttributeValue object to its equivalent JavaScript type. - * - * @param data [map] An object in the Amazon DynamoDB AttributeValue format - * @param options [map] - * @option options convertEmptyValues [Boolean] Whether to automatically - * convert empty strings, blobs, - * and sets to `null` - * @option options wrapNumbers [Boolean] Whether to return numbers as a - * NumberValue object instead of - * converting them to native JavaScript - * numbers. This allows for the safe - * round-trip transport of numbers of - * arbitrary size. + * Resolves the provider chain by searching for the first set of + * credentials in {providers}. * - * @return [Object|Array|String|Number|Boolean|null] + * @callback callback function(err, credentials) + * Called when the provider resolves the chain to a credentials object + * or null if no credentials can be found. * - * @see AWS.DynamoDB.Converter.unmarshall AWS.DynamoDB.Converter.unmarshall to - * convert entire records (rather than individual attributes) + * @param err [Error] the error object returned if no credentials are + * found. + * @param credentials [AWS.Credentials] the credentials object resolved + * by the provider chain. + * @return [AWS.CredentialProviderChain] the provider, for chaining. */ - output: function convertOutput(data, options) { - options = options || {}; - var list, map, i; - for (var type in data) { - var values = data[type]; - if (type === 'M') { - map = {}; - for (var key in values) { - map[key] = convertOutput(values[key], options); - } - return map; - } else if (type === 'L') { - list = []; - for (i = 0; i < values.length; i++) { - list.push(convertOutput(values[i], options)); - } - return list; - } else if (type === 'SS') { - list = []; - for (i = 0; i < values.length; i++) { - list.push(values[i] + ''); + resolve: function resolve(callback) { + var self = this; + if (self.providers.length === 0) { + callback(new Error('No providers')); + return self; + } + + if (self.resolveCallbacks.push(callback) === 1) { + var index = 0; + var providers = self.providers.slice(0); + + function resolveNext(err, creds) { + if ((!err && creds) || index === providers.length) { + AWS.util.arrayEach(self.resolveCallbacks, function (callback) { + callback(err, creds); + }); + self.resolveCallbacks.length = 0; + return; } - return new DynamoDBSet(list); - } else if (type === 'NS') { - list = []; - for (i = 0; i < values.length; i++) { - list.push(convertNumber(values[i], options.wrapNumbers)); + + var provider = providers[index++]; + if (typeof provider === 'function') { + creds = provider.call(); + } else { + creds = provider; } - return new DynamoDBSet(list); - } else if (type === 'BS') { - list = []; - for (i = 0; i < values.length; i++) { - list.push(AWS.util.buffer.toBuffer(values[i])); + + if (creds.get) { + creds.get(function (getErr) { + resolveNext(getErr, getErr ? null : creds); + }); + } else { + resolveNext(null, creds); } - return new DynamoDBSet(list); - } else if (type === 'S') { - return values + ''; - } else if (type === 'N') { - return convertNumber(values, options.wrapNumbers); - } else if (type === 'B') { - return util.buffer.toBuffer(values); - } else if (type === 'BOOL') { - return (values === 'true' || values === 'TRUE' || values === true); - } else if (type === 'NULL') { - return null; } - } - }, - /** - * Convert a DynamoDB record into a JavaScript object. - * - * @param data [any] The DynamoDB record - * @param options [map] - * @option options convertEmptyValues [Boolean] Whether to automatically - * convert empty strings, blobs, - * and sets to `null` - * @option options wrapNumbers [Boolean] Whether to return numbers as a - * NumberValue object instead of - * converting them to native JavaScript - * numbers. This allows for the safe - * round-trip transport of numbers of - * arbitrary size. - * - * @return [map] An object whose properties have been converted from - * DynamoDB's AttributeValue format into their corresponding native - * JavaScript types. - * - * @example Convert a record received from a DynamoDB stream - * var unmarshalled = AWS.DynamoDB.Converter.unmarshall({ - * string: {S: 'foo'}, - * list: {L: [{S: 'fizz'}, {S: 'buzz'}, {S: 'pop'}]}, - * map: { - * M: { - * nestedMap: { - * M: { - * key: {S: 'value'} - * } - * } - * } - * }, - * number: {N: '123'}, - * nullValue: {NULL: true}, - * boolValue: {BOOL: true} - * }); - */ - unmarshall: function unmarshall(data, options) { - return AWS.DynamoDB.Converter.output({M: data}, options); - } -}; + resolveNext(); + } -/** - * @api private - * @param data [Array] - * @param options [map] - */ -function formatList(data, options) { - var list = {L: []}; - for (var i = 0; i < data.length; i++) { - list['L'].push(AWS.DynamoDB.Converter.input(data[i], options)); + return self; } - return list; -} - -/** - * @api private - * @param value [String] - * @param wrapNumbers [Boolean] - */ -function convertNumber(value, wrapNumbers) { - return wrapNumbers ? new NumberValue(value) : Number(value); -} +}); /** - * @api private - * @param data [map] - * @param options [map] + * The default set of providers used by a vanilla CredentialProviderChain. + * + * In the browser: + * + * ```javascript + * AWS.CredentialProviderChain.defaultProviders = [] + * ``` + * + * In Node.js: + * + * ```javascript + * AWS.CredentialProviderChain.defaultProviders = [ + * function () { return new AWS.EnvironmentCredentials('AWS'); }, + * function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + * function () { return new AWS.SsoCredentials(); }, + * function () { return new AWS.SharedIniFileCredentials(); }, + * function () { return new AWS.ECSCredentials(); }, + * function () { return new AWS.ProcessCredentials(); }, + * function () { return new AWS.TokenFileWebIdentityCredentials(); }, + * function () { return new AWS.EC2MetadataCredentials() } + * ] + * ``` */ -function formatMap(data, options) { - var map = {M: {}}; - for (var key in data) { - var formatted = AWS.DynamoDB.Converter.input(data[key], options); - if (formatted !== void 0) { - map['M'][key] = formatted; - } - } - return map; -} +AWS.CredentialProviderChain.defaultProviders = []; /** * @api private */ -function formatSet(data, options) { - options = options || {}; - var values = data.values; - if (options.convertEmptyValues) { - values = filterEmptySetValues(data); - if (values.length === 0) { - return AWS.DynamoDB.Converter.input(null); - } - } - - var map = {}; - switch (data.type) { - case 'String': map['SS'] = values; break; - case 'Binary': map['BS'] = values; break; - case 'Number': map['NS'] = values.map(function (value) { - return value.toString(); - }); - } - return map; -} +AWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); +}; /** * @api private */ -function filterEmptySetValues(set) { - var nonEmptyValues = []; - var potentiallyEmptyTypes = { - String: true, - Binary: true, - Number: false - }; - if (potentiallyEmptyTypes[set.type]) { - for (var i = 0; i < set.values.length; i++) { - if (set.values[i].length === 0) { - continue; - } - nonEmptyValues.push(set.values[i]); - } - - return nonEmptyValues; - } - - return set.values; -} +AWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.resolvePromise; +}; -/** - * @api private - */ -module.exports = AWS.DynamoDB.Converter; +AWS.util.addPromises(AWS.CredentialProviderChain); /***/ }), -/***/ 90030: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 73379: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var Translator = __nccwpck_require__(34222); -var DynamoDBSet = __nccwpck_require__(20304); +__nccwpck_require__(25768); /** - * The document client simplifies working with items in Amazon DynamoDB - * by abstracting away the notion of attribute values. This abstraction - * annotates native JavaScript types supplied as input parameters, as well - * as converts annotated response data to native JavaScript types. + * Represents credentials received from the metadata service on an EC2 instance. * - * ## Marshalling Input and Unmarshalling Response Data + * By default, this class will connect to the metadata service using + * {AWS.MetadataService} and attempt to load any available credentials. If it + * can connect, and credentials are available, these will be used with zero + * configuration. * - * The document client affords developers the use of native JavaScript types - * instead of `AttributeValue`s to simplify the JavaScript development - * experience with Amazon DynamoDB. JavaScript objects passed in as parameters - * are marshalled into `AttributeValue` shapes required by Amazon DynamoDB. - * Responses from DynamoDB are unmarshalled into plain JavaScript objects - * by the `DocumentClient`. The `DocumentClient`, does not accept - * `AttributeValue`s in favor of native JavaScript types. + * This credentials class will by default timeout after 1 second of inactivity + * and retry 3 times. + * If your requests to the EC2 metadata service are timing out, you can increase + * these values by configuring them directly: * - * | JavaScript Type | DynamoDB AttributeValue | - * |:----------------------------------------------------------------------:|-------------------------| - * | String | S | - * | Number | N | - * | Boolean | BOOL | - * | null | NULL | - * | Array | L | - * | Object | M | - * | Buffer, File, Blob, ArrayBuffer, DataView, and JavaScript typed arrays | B | + * ```javascript + * AWS.config.credentials = new AWS.EC2MetadataCredentials({ + * httpOptions: { timeout: 5000 }, // 5 second timeout + * maxRetries: 10, // retry 10 times + * retryDelayOptions: { base: 200 }, // see AWS.Config for information + * logger: console // see AWS.Config for information + * ec2MetadataV1Disabled: false // whether to block IMDS v1 fallback. + * }); + * ``` * - * ## Support for Sets + * If your requests are timing out in connecting to the metadata service, such + * as when testing on a development machine, you can use the connectTimeout + * option, specified in milliseconds, which also defaults to 1 second. * - * The `DocumentClient` offers a convenient way to create sets from - * JavaScript Arrays. The type of set is inferred from the first element - * in the array. DynamoDB supports string, number, and binary sets. To - * learn more about supported types see the - * [Amazon DynamoDB Data Model Documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) - * For more information see {AWS.DynamoDB.DocumentClient.createSet} + * If the requests failed or returns expired credentials, it will + * extend the expiration of current credential, with a warning message. For more + * information, please go to: + * https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html + * + * @!attribute originalExpiration + * @return [Date] The optional original expiration of the current credential. + * In case of AWS outage, the EC2 metadata will extend expiration of the + * existing credential. + * + * @see AWS.Config.retryDelayOptions + * @see AWS.Config.logger * + * @!macro nobrowser */ -AWS.DynamoDB.DocumentClient = AWS.util.inherit({ - - /** - * Creates a DynamoDB document client with a set of configuration options. - * - * @option options params [map] An optional map of parameters to bind to every - * request sent by this service object. - * @option options service [AWS.DynamoDB] An optional pre-configured instance - * of the AWS.DynamoDB service object. This instance's config will be - * copied to a new instance used by this client. You should not need to - * retain a reference to the input object, and may destroy it or allow it - * to be garbage collected. - * @option options convertEmptyValues [Boolean] set to true if you would like - * the document client to convert empty values (0-length strings, binary - * buffers, and sets) to be converted to NULL types when persisting to - * DynamoDB. - * @option options wrapNumbers [Boolean] Set to true to return numbers as a - * NumberValue object instead of converting them to native JavaScript numbers. - * This allows for the safe round-trip transport of numbers of arbitrary size. - * @see AWS.DynamoDB.constructor - * - */ - constructor: function DocumentClient(options) { - var self = this; - self.options = options || {}; - self.configure(self.options); - }, - - /** - * @api private - */ - configure: function configure(options) { - var self = this; - self.service = options.service; - self.bindServiceObject(options); - self.attrValue = options.attrValue = - self.service.api.operations.putItem.input.members.Item.value.shape; - }, - - /** - * @api private - */ - bindServiceObject: function bindServiceObject(options) { - var self = this; - options = options || {}; - - if (!self.service) { - self.service = new AWS.DynamoDB(options); - } else { - var config = AWS.util.copy(self.service.config); - self.service = new self.service.constructor.__super__(config); - self.service.config.params = - AWS.util.merge(self.service.config.params || {}, options.params); - } - }, +AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { + constructor: function EC2MetadataCredentials(options) { + AWS.Credentials.call(this); - /** - * @api private - */ - makeServiceRequest: function(operation, params, callback) { - var self = this; - var request = self.service[operation](params); - self.setupRequest(request); - self.setupResponse(request); - if (typeof callback === 'function') { - request.send(callback); - } - return request; - }, + options = options ? AWS.util.copy(options) : {}; + options = AWS.util.merge( + {maxRetries: this.defaultMaxRetries}, options); + if (!options.httpOptions) options.httpOptions = {}; + options.httpOptions = AWS.util.merge( + {timeout: this.defaultTimeout, + connectTimeout: this.defaultConnectTimeout}, + options.httpOptions); - /** - * @api private - */ - serviceClientOperationsMap: { - batchGet: 'batchGetItem', - batchWrite: 'batchWriteItem', - delete: 'deleteItem', - get: 'getItem', - put: 'putItem', - query: 'query', - scan: 'scan', - update: 'updateItem', - transactGet: 'transactGetItems', - transactWrite: 'transactWriteItems' + this.metadataService = new AWS.MetadataService(options); + this.logger = options.logger || AWS.config && AWS.config.logger; }, /** - * Returns the attributes of one or more items from one or more tables - * by delegating to `AWS.DynamoDB.batchGetItem()`. - * - * Supply the same parameters as {AWS.DynamoDB.batchGetItem} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.batchGetItem - * @example Get items from multiple tables - * var params = { - * RequestItems: { - * 'Table-1': { - * Keys: [ - * { - * HashKey: 'haskey', - * NumberRangeKey: 1 - * } - * ] - * }, - * 'Table-2': { - * Keys: [ - * { foo: 'bar' }, - * ] - * } - * } - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.batchGet(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); - * + * @api private */ - batchGet: function(params, callback) { - var operation = this.serviceClientOperationsMap['batchGet']; - return this.makeServiceRequest(operation, params, callback); - }, + defaultTimeout: 1000, - /** - * Puts or deletes multiple items in one or more tables by delegating - * to `AWS.DynamoDB.batchWriteItem()`. - * - * Supply the same parameters as {AWS.DynamoDB.batchWriteItem} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.batchWriteItem - * @example Write to and delete from a table - * var params = { - * RequestItems: { - * 'Table-1': [ - * { - * DeleteRequest: { - * Key: { HashKey: 'someKey' } - * } - * }, - * { - * PutRequest: { - * Item: { - * HashKey: 'anotherKey', - * NumAttribute: 1, - * BoolAttribute: true, - * ListAttribute: [1, 'two', false], - * MapAttribute: { foo: 'bar' } - * } - * } - * } - * ] - * } - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.batchWrite(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); - * + /** + * @api private */ - batchWrite: function(params, callback) { - var operation = this.serviceClientOperationsMap['batchWrite']; - return this.makeServiceRequest(operation, params, callback); - }, + defaultConnectTimeout: 1000, /** - * Deletes a single item in a table by primary key by delegating to - * `AWS.DynamoDB.deleteItem()` - * - * Supply the same parameters as {AWS.DynamoDB.deleteItem} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.deleteItem - * @example Delete an item from a table - * var params = { - * TableName : 'Table', - * Key: { - * HashKey: 'hashkey', - * NumberRangeKey: 1 - * } - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.delete(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); - * + * @api private */ - delete: function(params, callback) { - var operation = this.serviceClientOperationsMap['delete']; - return this.makeServiceRequest(operation, params, callback); - }, + defaultMaxRetries: 3, /** - * Returns a set of attributes for the item with the given primary key - * by delegating to `AWS.DynamoDB.getItem()`. - * - * Supply the same parameters as {AWS.DynamoDB.getItem} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.getItem - * @example Get an item from a table - * var params = { - * TableName : 'Table', - * Key: { - * HashKey: 'hashkey' - * } - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.get(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); - * + * The original expiration of the current credential. In case of AWS + * outage, the EC2 metadata will extend expiration of the existing + * credential. */ - get: function(params, callback) { - var operation = this.serviceClientOperationsMap['get']; - return this.makeServiceRequest(operation, params, callback); - }, + originalExpiration: undefined, /** - * Creates a new item, or replaces an old item with a new item by - * delegating to `AWS.DynamoDB.putItem()`. - * - * Supply the same parameters as {AWS.DynamoDB.putItem} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.putItem - * @example Create a new item in a table - * var params = { - * TableName : 'Table', - * Item: { - * HashKey: 'haskey', - * NumAttribute: 1, - * BoolAttribute: true, - * ListAttribute: [1, 'two', false], - * MapAttribute: { foo: 'bar'}, - * NullAttribute: null - * } - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.put(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); + * Loads the credentials from the instance metadata service * + * @callback callback function(err) + * Called when the instance metadata service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get */ - put: function(params, callback) { - var operation = this.serviceClientOperationsMap['put']; - return this.makeServiceRequest(operation, params, callback); + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** - * Edits an existing item's attributes, or adds a new item to the table if - * it does not already exist by delegating to `AWS.DynamoDB.updateItem()`. - * - * Supply the same parameters as {AWS.DynamoDB.updateItem} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.updateItem - * @example Update an item with expressions - * var params = { - * TableName: 'Table', - * Key: { HashKey : 'hashkey' }, - * UpdateExpression: 'set #a = :x + :y', - * ConditionExpression: '#a < :MAX', - * ExpressionAttributeNames: {'#a' : 'Sum'}, - * ExpressionAttributeValues: { - * ':x' : 20, - * ':y' : 45, - * ':MAX' : 100, - * } - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.update(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); - * + * @api private + * @param callback */ - update: function(params, callback) { - var operation = this.serviceClientOperationsMap['update']; - return this.makeServiceRequest(operation, params, callback); + load: function load(callback) { + var self = this; + self.metadataService.loadCredentials(function(err, creds) { + if (err) { + if (self.hasLoadedCredentials()) { + self.extendExpirationIfExpired(); + callback(); + } else { + callback(err); + } + } else { + self.setCredentials(creds); + self.extendExpirationIfExpired(); + callback(); + } + }); }, /** - * Returns one or more items and item attributes by accessing every item - * in a table or a secondary index. - * - * Supply the same parameters as {AWS.DynamoDB.scan} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.scan - * @example Scan the table with a filter expression - * var params = { - * TableName : 'Table', - * FilterExpression : 'Year = :this_year', - * ExpressionAttributeValues : {':this_year' : 2015} - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.scan(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); - * + * Whether this credential has been loaded. + * @api private */ - scan: function(params, callback) { - var operation = this.serviceClientOperationsMap['scan']; - return this.makeServiceRequest(operation, params, callback); - }, - - /** - * Directly access items from a table by primary key or a secondary index. - * - * Supply the same parameters as {AWS.DynamoDB.query} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.query - * @example Query an index - * var params = { - * TableName: 'Table', - * IndexName: 'Index', - * KeyConditionExpression: 'HashKey = :hkey and RangeKey > :rkey', - * ExpressionAttributeValues: { - * ':hkey': 'key', - * ':rkey': 2015 - * } - * }; - * - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * documentClient.query(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); - * - */ - query: function(params, callback) { - var operation = this.serviceClientOperationsMap['query']; - return this.makeServiceRequest(operation, params, callback); + hasLoadedCredentials: function hasLoadedCredentials() { + return this.AccessKeyId && this.secretAccessKey; }, /** - * Synchronous write operation that groups up to 100 action requests. - * - * Supply the same parameters as {AWS.DynamoDB.transactWriteItems} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.transactWriteItems - * @example Get items from multiple tables - * var params = { - * TransactItems: [{ - * Put: { - * TableName : 'Table0', - * Item: { - * HashKey: 'haskey', - * NumAttribute: 1, - * BoolAttribute: true, - * ListAttribute: [1, 'two', false], - * MapAttribute: { foo: 'bar'}, - * NullAttribute: null - * } - * } - * }, { - * Update: { - * TableName: 'Table1', - * Key: { HashKey : 'hashkey' }, - * UpdateExpression: 'set #a = :x + :y', - * ConditionExpression: '#a < :MAX', - * ExpressionAttributeNames: {'#a' : 'Sum'}, - * ExpressionAttributeValues: { - * ':x' : 20, - * ':y' : 45, - * ':MAX' : 100, - * } - * } - * }] - * }; - * - * documentClient.transactWrite(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); + * if expired, extend the expiration by 15 minutes base plus a jitter of 5 + * minutes range. + * @api private */ - transactWrite: function(params, callback) { - var operation = this.serviceClientOperationsMap['transactWrite']; - return this.makeServiceRequest(operation, params, callback); + extendExpirationIfExpired: function extendExpirationIfExpired() { + if (this.needsRefresh()) { + this.originalExpiration = this.originalExpiration || this.expireTime; + this.expired = false; + var nextTimeout = 15 * 60 + Math.floor(Math.random() * 5 * 60); + var currentTime = AWS.util.date.getDate().getTime(); + this.expireTime = new Date(currentTime + nextTimeout * 1000); + // TODO: add doc link; + this.logger.warn('Attempting credential expiration extension due to a ' + + 'credential service availability issue. A refresh of these ' + + 'credentials will be attempted again at ' + this.expireTime + + '\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html'); + } }, /** - * Atomically retrieves multiple items from one or more tables (but not from indexes) - * in a single account and region. - * - * Supply the same parameters as {AWS.DynamoDB.transactGetItems} with - * `AttributeValue`s substituted by native JavaScript types. - * - * @see AWS.DynamoDB.transactGetItems - * @example Get items from multiple tables - * var params = { - * TransactItems: [{ - * Get: { - * TableName : 'Table0', - * Key: { - * HashKey: 'hashkey0' - * } - * } - * }, { - * Get: { - * TableName : 'Table1', - * Key: { - * HashKey: 'hashkey1' - * } - * } - * }] - * }; - * - * documentClient.transactGet(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); + * Update the credential with new credential responded from EC2 metadata + * service. + * @api private */ - transactGet: function(params, callback) { - var operation = this.serviceClientOperationsMap['transactGet']; - return this.makeServiceRequest(operation, params, callback); - }, + setCredentials: function setCredentials(creds) { + var currentTime = AWS.util.date.getDate().getTime(); + var expireTime = new Date(creds.Expiration); + this.expired = currentTime >= expireTime ? true : false; + this.metadata = creds; + this.accessKeyId = creds.AccessKeyId; + this.secretAccessKey = creds.SecretAccessKey; + this.sessionToken = creds.Token; + this.expireTime = expireTime; + } +}); + + +/***/ }), + +/***/ 10645: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +/** + * Represents credentials received from relative URI specified in the ECS container. + * + * This class will request refreshable credentials from the relative URI + * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the + * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials + * are returned in the response, these will be used with zero configuration. + * + * This credentials class will by default timeout after 1 second of inactivity + * and retry 3 times. + * If your requests to the relative URI are timing out, you can increase + * the value by configuring them directly: + * + * ```javascript + * AWS.config.credentials = new AWS.ECSCredentials({ + * httpOptions: { timeout: 5000 }, // 5 second timeout + * maxRetries: 10, // retry 10 times + * retryDelayOptions: { base: 200 } // see AWS.Config for information + * }); + * ``` + * + * @see AWS.Config.retryDelayOptions + * + * @!macro nobrowser + */ +AWS.ECSCredentials = AWS.RemoteCredentials; + + +/***/ }), + +/***/ 57714: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +/** + * Represents credentials from the environment. + * + * By default, this class will look for the matching environment variables + * prefixed by a given {envPrefix}. The un-prefixed environment variable names + * for each credential value is listed below: + * + * ```javascript + * accessKeyId: ACCESS_KEY_ID + * secretAccessKey: SECRET_ACCESS_KEY + * sessionToken: SESSION_TOKEN + * ``` + * + * With the default prefix of 'AWS', the environment variables would be: + * + * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN + * + * @!attribute envPrefix + * @readonly + * @return [String] the prefix for the environment variable names excluding + * the separating underscore ('_'). + */ +AWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, { /** - * Creates a set of elements inferring the type of set from - * the type of the first element. Amazon DynamoDB currently supports - * the number sets, string sets, and binary sets. For more information - * about DynamoDB data types see the documentation on the - * [Amazon DynamoDB Data Model](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModel.DataTypes). - * - * @param list [Array] Collection to represent your DynamoDB Set - * @param options [map] - * * **validate** [Boolean] set to true if you want to validate the type - * of each element in the set. Defaults to `false`. - * @example Creating a number set - * var documentClient = new AWS.DynamoDB.DocumentClient(); - * - * var params = { - * Item: { - * hashkey: 'hashkey' - * numbers: documentClient.createSet([1, 2, 3]); - * } - * }; + * Creates a new EnvironmentCredentials class with a given variable + * prefix {envPrefix}. For example, to load credentials using the 'AWS' + * prefix: * - * documentClient.put(params, function(err, data) { - * if (err) console.log(err); - * else console.log(data); - * }); + * ```javascript + * var creds = new AWS.EnvironmentCredentials('AWS'); + * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var + * ``` * + * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment + * variables. Do not include the separating underscore. */ - createSet: function(list, options) { - options = options || {}; - return new DynamoDBSet(list, options); - }, - - /** - * @api private - */ - getTranslator: function() { - return new Translator(this.options); + constructor: function EnvironmentCredentials(envPrefix) { + AWS.Credentials.call(this); + this.envPrefix = envPrefix; + this.get(function() {}); }, /** - * @api private + * Loads credentials from the environment using the prefixed + * environment variables. + * + * @callback callback function(err) + * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and + * SESSION_TOKEN environment variables are read. When this callback is + * called with no error, it means that the credentials information has + * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, + * and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get */ - setupRequest: function setupRequest(request) { - var self = this; - var translator = self.getTranslator(); - var operation = request.operation; - var inputShape = request.service.api.operations[operation].input; - request._events.validate.unshift(function(req) { - req.rawParams = AWS.util.copy(req.params); - req.params = translator.translateInput(req.rawParams, inputShape); - }); - }, + refresh: function refresh(callback) { + if (!callback) callback = AWS.util.fn.callback; - /** - * @api private - */ - setupResponse: function setupResponse(request) { - var self = this; - var translator = self.getTranslator(); - var outputShape = self.service.api.operations[request.operation].output; - request.on('extractData', function(response) { - response.data = translator.translateOutput(response.data, outputShape); - }); + if (!process || !process.env) { + callback(AWS.util.error( + new Error('No process info or environment variables available'), + { code: 'EnvironmentCredentialsProviderFailure' } + )); + return; + } - var response = request.response; - response.nextPage = function(cb) { - var resp = this; - var req = resp.request; - var config; - var service = req.service; - var operation = req.operation; - try { - config = service.paginationConfig(operation, true); - } catch (e) { resp.error = e; } + var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN']; + var values = []; - if (!resp.hasNextPage()) { - if (cb) cb(resp.error, null); - else if (resp.error) throw resp.error; - return null; + for (var i = 0; i < keys.length; i++) { + var prefix = ''; + if (this.envPrefix) prefix = this.envPrefix + '_'; + values[i] = process.env[prefix + keys[i]]; + if (!values[i] && keys[i] !== 'SESSION_TOKEN') { + callback(AWS.util.error( + new Error('Variable ' + prefix + keys[i] + ' not set.'), + { code: 'EnvironmentCredentialsProviderFailure' } + )); + return; } + } - var params = AWS.util.copy(req.rawParams); - if (!resp.nextPageTokens) { - return cb ? cb(null, null) : null; - } else { - var inputTokens = config.inputToken; - if (typeof inputTokens === 'string') inputTokens = [inputTokens]; - for (var i = 0; i < inputTokens.length; i++) { - params[inputTokens[i]] = resp.nextPageTokens[i]; - } - return self[operation](params, cb); - } - }; + this.expired = false; + AWS.Credentials.apply(this, values); + callback(); } }); -/** - * @api private - */ -module.exports = AWS.DynamoDB.DocumentClient; - /***/ }), -/***/ 91593: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 27454: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -var util = (__nccwpck_require__(28437).util); +var AWS = __nccwpck_require__(28437); /** - * An object recognizable as a numeric value that stores the underlying number - * as a string. + * Represents credentials from a JSON file on disk. + * If the credentials expire, the SDK can {refresh} the credentials + * from the file. * - * Intended to be a deserialization target for the DynamoDB Document Client when - * the `wrapNumbers` flag is set. This allows for numeric values that lose - * precision when converted to JavaScript's `number` type. + * The format of the file should be similar to the options passed to + * {AWS.Config}: + * + * ```javascript + * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'} + * ``` + * + * @example Loading credentials from disk + * var creds = new AWS.FileSystemCredentials('./configuration.json'); + * creds.accessKeyId == 'AKID' + * + * @!attribute filename + * @readonly + * @return [String] the path to the JSON file on disk containing the + * credentials. + * @!macro nobrowser */ -var DynamoDBNumberValue = util.inherit({ - constructor: function NumberValue(value) { - this.wrapperName = 'NumberValue'; - this.value = value.toString(); - }, - - /** - * Render the underlying value as a number when converting to JSON. - */ - toJSON: function () { - return this.toNumber(); - }, +AWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, { /** - * Convert the underlying value to a JavaScript number. + * @overload AWS.FileSystemCredentials(filename) + * Creates a new FileSystemCredentials object from a filename + * + * @param filename [String] the path on disk to the JSON file to load. */ - toNumber: function () { - return Number(this.value); + constructor: function FileSystemCredentials(filename) { + AWS.Credentials.call(this); + this.filename = filename; + this.get(function() {}); }, /** - * Return a string representing the unaltered value provided to the - * constructor. + * Loads the credentials from the {filename} on disk. + * + * @callback callback function(err) + * Called after the JSON file on disk is read and parsed. When this callback + * is called with no error, it means that the credentials information + * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`, + * and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get */ - toString: function () { - return this.value; + refresh: function refresh(callback) { + if (!callback) callback = AWS.util.fn.callback; + try { + var creds = JSON.parse(AWS.util.readFileSync(this.filename)); + AWS.Credentials.call(this, creds); + if (!this.accessKeyId || !this.secretAccessKey) { + throw AWS.util.error( + new Error('Credentials not set in ' + this.filename), + { code: 'FileSystemCredentialsProviderFailure' } + ); + } + this.expired = false; + callback(); + } catch (err) { + callback(err); + } } -}); -/** - * @api private - */ -module.exports = DynamoDBNumberValue; +}); /***/ }), -/***/ 20304: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var util = (__nccwpck_require__(28437).util); -var typeOf = (__nccwpck_require__(48084).typeOf); +/***/ 80371: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @api private - */ -var memberTypeToSetType = { - 'String': 'String', - 'Number': 'Number', - 'NumberValue': 'Number', - 'Binary': 'Binary' -}; +var AWS = __nccwpck_require__(28437); +var proc = __nccwpck_require__(32081); +var iniLoader = AWS.util.iniLoader; /** - * @api private + * Represents credentials loaded from shared credentials file + * (defaulting to ~/.aws/credentials or defined by the + * `AWS_SHARED_CREDENTIALS_FILE` environment variable). + * + * ## Using process credentials + * + * The credentials file can specify a credential provider that executes + * a given process and attempts to read its stdout to recieve a JSON payload + * containing the credentials: + * + * [default] + * credential_process = /usr/bin/credential_proc + * + * Automatically handles refreshing credentials if an Expiration time is + * provided in the credentials payload. Credentials supplied in the same profile + * will take precedence over the credential_process. + * + * Sourcing credentials from an external process can potentially be dangerous, + * so proceed with caution. Other credential providers should be preferred if + * at all possible. If using this option, you should make sure that the shared + * credentials file is as locked down as possible using security best practices + * for your operating system. + * + * ## Using custom profiles + * + * The SDK supports loading credentials for separate profiles. This can be done + * in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to + * loading the SDK. + * 2. Directly load the AWS.ProcessCredentials provider: + * + * ```javascript + * var creds = new AWS.ProcessCredentials({profile: 'myprofile'}); + * AWS.config.credentials = creds; + * ``` + * + * @!macro nobrowser */ -var DynamoDBSet = util.inherit({ +AWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new ProcessCredentials object. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var) + * the filename to use when loading credentials. + * @option options callback [Function] (err) Credentials are eagerly loaded + * by the constructor. When the callback is called with no error, the + * credentials have been loaded successfully. + */ + constructor: function ProcessCredentials(options) { + AWS.Credentials.call(this); - constructor: function Set(list, options) { options = options || {}; - this.wrapperName = 'Set'; - this.initialize(list, options.validate); + + this.filename = options.filename; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.get(options.callback || AWS.util.fn.noop); }, - initialize: function(list, validate) { + /** + * @api private + */ + load: function load(callback) { var self = this; - self.values = [].concat(list); - self.detectType(); - if (validate) { - self.validate(); - } - }, + try { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); + var profile = profiles[this.profile] || {}; - detectType: function() { - this.type = memberTypeToSetType[typeOf(this.values[0])]; - if (!this.type) { - throw util.error(new Error(), { - code: 'InvalidSetType', - message: 'Sets can contain string, number, or binary values' - }); - } - }, + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' not found'), + { code: 'ProcessCredentialsProviderFailure' } + ); + } - validate: function() { - var self = this; - var length = self.values.length; - var values = self.values; - for (var i = 0; i < length; i++) { - if (memberTypeToSetType[typeOf(values[i])] !== self.type) { - throw util.error(new Error(), { - code: 'InvalidType', - message: self.type + ' Set contains ' + typeOf(values[i]) + ' value' + if (profile['credential_process']) { + this.loadViaCredentialProcess(profile, function(err, data) { + if (err) { + callback(err, null); + } else { + self.expired = false; + self.accessKeyId = data.AccessKeyId; + self.secretAccessKey = data.SecretAccessKey; + self.sessionToken = data.SessionToken; + if (data.Expiration) { + self.expireTime = new Date(data.Expiration); + } + callback(null); + } }); + } else { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' did not include credential process'), + { code: 'ProcessCredentialsProviderFailure' } + ); } + } catch (err) { + callback(err); } }, /** - * Render the underlying values only when converting to JSON. + * Executes the credential_process and retrieves + * credentials from the output + * @api private + * @param profile [map] credentials profile + * @throws ProcessCredentialsProviderFailure + */ + loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) { + proc.exec(profile['credential_process'], { env: process.env }, function(err, stdOut, stdErr) { + if (err) { + callback(AWS.util.error( + new Error('credential_process returned error'), + { code: 'ProcessCredentialsProviderFailure'} + ), null); + } else { + try { + var credData = JSON.parse(stdOut); + if (credData.Expiration) { + var currentTime = AWS.util.date.getDate(); + var expireTime = new Date(credData.Expiration); + if (expireTime < currentTime) { + throw Error('credential_process returned expired credentials'); + } + } + + if (credData.Version !== 1) { + throw Error('credential_process does not return Version == 1'); + } + callback(null, credData); + } catch (err) { + callback(AWS.util.error( + new Error(err.message), + { code: 'ProcessCredentialsProviderFailure'} + ), null); + } + } + }); + }, + + /** + * Loads the credentials from the credential process + * + * @callback callback function(err) + * Called after the credential process has been executed. When this + * callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get */ - toJSON: function() { - var self = this; - return self.values; + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh(callback || AWS.util.fn.callback); } - }); -/** - * @api private - */ -module.exports = DynamoDBSet; - /***/ }), -/***/ 34222: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var util = (__nccwpck_require__(28437).util); -var convert = __nccwpck_require__(76663); - -var Translator = function(options) { - options = options || {}; - this.attrValue = options.attrValue; - this.convertEmptyValues = Boolean(options.convertEmptyValues); - this.wrapNumbers = Boolean(options.wrapNumbers); -}; - -Translator.prototype.translateInput = function(value, shape) { - this.mode = 'input'; - return this.translate(value, shape); -}; - -Translator.prototype.translateOutput = function(value, shape) { - this.mode = 'output'; - return this.translate(value, shape); -}; - -Translator.prototype.translate = function(value, shape) { - var self = this; - if (!shape || value === undefined) return undefined; - - if (shape.shape === self.attrValue) { - return convert[self.mode](value, { - convertEmptyValues: self.convertEmptyValues, - wrapNumbers: self.wrapNumbers, - }); - } - switch (shape.type) { - case 'structure': return self.translateStructure(value, shape); - case 'map': return self.translateMap(value, shape); - case 'list': return self.translateList(value, shape); - default: return self.translateScalar(value, shape); - } -}; - -Translator.prototype.translateStructure = function(structure, shape) { - var self = this; - if (structure == null) return undefined; - - var struct = {}; - util.each(structure, function(name, value) { - var memberShape = shape.members[name]; - if (memberShape) { - var result = self.translate(value, memberShape); - if (result !== undefined) struct[name] = result; - } - }); - return struct; -}; - -Translator.prototype.translateList = function(list, shape) { - var self = this; - if (list == null) return undefined; - - var out = []; - util.arrayEach(list, function(value) { - var result = self.translate(value, shape.member); - if (result === undefined) out.push(null); - else out.push(result); - }); - return out; -}; - -Translator.prototype.translateMap = function(map, shape) { - var self = this; - if (map == null) return undefined; +/***/ 88764: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - var out = {}; - util.each(map, function(key, value) { - var result = self.translate(value, shape.value); - if (result === undefined) out[key] = null; - else out[key] = result; - }); - return out; -}; +var fs = __nccwpck_require__(57147); -Translator.prototype.translateScalar = function(value, shape) { - return shape.toType(value); -}; +var AWS = __nccwpck_require__(28437), + ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI', + ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI', + ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN', + ENV_AUTH_TOKEN_FILE = 'AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE', + FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'], + FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'], + FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1', '169.254.170.23'], + RELATIVE_URI_HOST = '169.254.170.2'; /** - * @api private + * Represents credentials received from specified URI. + * + * This class will request refreshable credentials from the relative URI + * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the + * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials + * are returned in the response, these will be used with zero configuration. + * + * This credentials class will by default timeout after 1 second of inactivity + * and retry 3 times. + * If your requests to the relative URI are timing out, you can increase + * the value by configuring them directly: + * + * ```javascript + * AWS.config.credentials = new AWS.RemoteCredentials({ + * httpOptions: { timeout: 5000 }, // 5 second timeout + * maxRetries: 10, // retry 10 times + * retryDelayOptions: { base: 200 } // see AWS.Config for information + * }); + * ``` + * + * @see AWS.Config.retryDelayOptions + * + * @!macro nobrowser */ -module.exports = Translator; +AWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, { + constructor: function RemoteCredentials(options) { + AWS.Credentials.call(this); + options = options ? AWS.util.copy(options) : {}; + if (!options.httpOptions) options.httpOptions = {}; + options.httpOptions = AWS.util.merge( + this.httpOptions, options.httpOptions); + AWS.util.update(this, options); + }, + + /** + * @api private + */ + httpOptions: { timeout: 1000 }, + /** + * @api private + */ + maxRetries: 3, -/***/ }), + /** + * @api private + */ + isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() { + return Boolean( + process && + process.env && + (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI]) + ); + }, -/***/ 48084: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * @api private + */ + getECSFullUri: function getECSFullUri() { + if (process && process.env) { + var relative = process.env[ENV_RELATIVE_URI], + full = process.env[ENV_FULL_URI]; + if (relative) { + return 'http://' + RELATIVE_URI_HOST + relative; + } else if (full) { + var parsed = AWS.util.urlParse(full); + if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) { + throw AWS.util.error( + new Error('Unsupported protocol: AWS.RemoteCredentials supports ' + + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; ' + + parsed.protocol + ' requested.'), + { code: 'ECSCredentialsProviderFailure' } + ); + } -var util = (__nccwpck_require__(28437).util); + if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 && + FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) { + throw AWS.util.error( + new Error('Unsupported hostname: AWS.RemoteCredentials only supports ' + + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; ' + + parsed.protocol + '//' + parsed.hostname + ' requested.'), + { code: 'ECSCredentialsProviderFailure' } + ); + } -function typeOf(data) { - if (data === null && typeof data === 'object') { - return 'null'; - } else if (data !== undefined && isBinary(data)) { - return 'Binary'; - } else if (data !== undefined && data.constructor) { - return data.wrapperName || util.typeName(data.constructor); - } else if (data !== undefined && typeof data === 'object') { - // this object is the result of Object.create(null), hence the absence of a - // defined constructor - return 'Object'; - } else { - return 'undefined'; - } -} + return full; + } else { + throw AWS.util.error( + new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI + + ' must be set to use AWS.RemoteCredentials.'), + { code: 'ECSCredentialsProviderFailure' } + ); + } + } else { + throw AWS.util.error( + new Error('No process info available'), + { code: 'ECSCredentialsProviderFailure' } + ); + } + }, -function isBinary(data) { - var types = [ - 'Buffer', 'File', 'Blob', 'ArrayBuffer', 'DataView', - 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', - 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', - 'Float32Array', 'Float64Array' - ]; - if (util.isNode()) { - var Stream = util.stream.Stream; - if (util.Buffer.isBuffer(data) || data instanceof Stream) { - return true; + /** + * @api private + */ + getECSAuthToken: function getECSAuthToken() { + if (process && process.env && (process.env[ENV_FULL_URI] || process.env[ENV_AUTH_TOKEN_FILE])) { + if (!process.env[ENV_AUTH_TOKEN] && process.env[ENV_AUTH_TOKEN_FILE]) { + try { + var data = fs.readFileSync(process.env[ENV_AUTH_TOKEN_FILE]).toString(); + return data; + } catch (error) { + console.error('Error reading token file:', error); + throw error; // Re-throw the error to propagate it + } + } + return process.env[ENV_AUTH_TOKEN]; } - } + }, - for (var i = 0; i < types.length; i++) { - if (data !== undefined && data.constructor) { - if (util.isType(data, types[i])) return true; - if (util.typeName(data.constructor) === types[i]) return true; + /** + * @api private + */ + credsFormatIsValid: function credsFormatIsValid(credData) { + return (!!credData.accessKeyId && !!credData.secretAccessKey && + !!credData.sessionToken && !!credData.expireTime); + }, + + /** + * @api private + */ + formatCreds: function formatCreds(credData) { + if (!!credData.credentials) { + credData = credData.credentials; } - } - return false; -} + return { + expired: false, + accessKeyId: credData.accessKeyId || credData.AccessKeyId, + secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey, + sessionToken: credData.sessionToken || credData.Token, + expireTime: new Date(credData.expiration || credData.Expiration) + }; + }, -/** - * @api private - */ -module.exports = { - typeOf: typeOf, - isBinary: isBinary -}; + /** + * @api private + */ + request: function request(url, callback) { + var httpRequest = new AWS.HttpRequest(url); + httpRequest.method = 'GET'; + httpRequest.headers.Accept = 'application/json'; + var token = this.getECSAuthToken(); + if (token) { + httpRequest.headers.Authorization = token; + } + AWS.util.handleRequestWithRetries(httpRequest, this, callback); + }, + /** + * Loads the credentials from the relative URI specified by container + * + * @callback callback function(err) + * Called when the request to the relative URI responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, `sessionToken`, and `expireTime` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, -/***/ }), + /** + * @api private + */ + load: function load(callback) { + var self = this; + var fullUri; -/***/ 63727: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + try { + fullUri = this.getECSFullUri(); + } catch (err) { + callback(err); + return; + } -var eventMessageChunker = (__nccwpck_require__(73630).eventMessageChunker); -var parseEvent = (__nccwpck_require__(52123).parseEvent); + this.request(fullUri, function(err, data) { + if (!err) { + try { + data = JSON.parse(data); + var creds = self.formatCreds(data); + if (!self.credsFormatIsValid(creds)) { + throw AWS.util.error( + new Error('Response data is not in valid format'), + { code: 'ECSCredentialsProviderFailure' } + ); + } + AWS.util.update(self, creds); + } catch (dataError) { + err = dataError; + } + } + callback(err, creds); + }); + } +}); -function createEventStream(body, parser, model) { - var eventMessages = eventMessageChunker(body); - var events = []; +/***/ }), - for (var i = 0; i < eventMessages.length; i++) { - events.push(parseEvent(parser, eventMessages[i], model)); - } +/***/ 15037: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - return events; -} +var AWS = __nccwpck_require__(28437); +var STS = __nccwpck_require__(57513); /** - * @api private + * Represents credentials retrieved from STS SAML support. + * + * By default this provider gets credentials using the + * {AWS.STS.assumeRoleWithSAML} service operation. This operation + * requires a `RoleArn` containing the ARN of the IAM trust policy for the + * application for which credentials will be given, as well as a `PrincipalArn` + * representing the ARN for the SAML identity provider. In addition, the + * `SAMLAssertion` must be set to the token provided by the identity + * provider. See {constructor} for an example on creating a credentials + * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values. + * + * ## Refreshing Credentials from Identity Service + * + * In addition to AWS credentials expiring after a given amount of time, the + * login token from the identity provider will also expire. Once this token + * expires, it will not be usable to refresh AWS credentials, and another + * token will be needed. The SDK does not manage refreshing of the token value, + * but this can be done through a "refresh token" supported by most identity + * providers. Consult the documentation for the identity provider for refreshing + * tokens. Once the refreshed token is acquired, you should make sure to update + * this new token in the credentials object's {params} property. The following + * code will update the SAMLAssertion, assuming you have retrieved an updated + * token from the identity provider: + * + * ```javascript + * AWS.config.credentials.params.SAMLAssertion = updatedToken; + * ``` + * + * Future calls to `credentials.refresh()` will now use the new token. + * + * @!attribute params + * @return [map] the map of params passed to + * {AWS.STS.assumeRoleWithSAML}. To update the token, set the + * `params.SAMLAssertion` property. */ -module.exports = { - createEventStream: createEventStream -}; +AWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new credentials object. + * @param (see AWS.STS.assumeRoleWithSAML) + * @example Creating a new credentials object + * AWS.config.credentials = new AWS.SAMLCredentials({ + * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole', + * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal', + * SAMLAssertion: 'base64-token', // base64-encoded token from IdP + * }); + * @see AWS.STS.assumeRoleWithSAML + */ + constructor: function SAMLCredentials(params) { + AWS.Credentials.call(this); + this.expired = true; + this.params = params; + }, + /** + * Refreshes credentials using {AWS.STS.assumeRoleWithSAML} + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, -/***/ }), + /** + * @api private + */ + load: function load(callback) { + var self = this; + self.createClients(); + self.service.assumeRoleWithSAML(function (err, data) { + if (!err) { + self.service.credentialsFrom(data, self); + } + callback(err); + }); + }, -/***/ 18518: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * @api private + */ + createClients: function() { + this.service = this.service || new STS({params: this.params}); + } -var util = (__nccwpck_require__(28437).util); -var Transform = (__nccwpck_require__(12781).Transform); -var allocBuffer = util.buffer.alloc; +}); -/** @type {Transform} */ -function EventMessageChunkerStream(options) { - Transform.call(this, options); - this.currentMessageTotalLength = 0; - this.currentMessagePendingLength = 0; - /** @type {Buffer} */ - this.currentMessage = null; +/***/ }), - /** @type {Buffer} */ - this.messageLengthBuffer = null; -} +/***/ 13754: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -EventMessageChunkerStream.prototype = Object.create(Transform.prototype); +var AWS = __nccwpck_require__(28437); +var STS = __nccwpck_require__(57513); +var iniLoader = AWS.util.iniLoader; + +var ASSUME_ROLE_DEFAULT_REGION = 'us-east-1'; /** + * Represents credentials loaded from shared credentials file + * (defaulting to ~/.aws/credentials or defined by the + * `AWS_SHARED_CREDENTIALS_FILE` environment variable). * - * @param {Buffer} chunk - * @param {string} encoding - * @param {*} callback + * ## Using the shared credentials file + * + * This provider is checked by default in the Node.js environment. To use the + * credentials file provider, simply add your access and secret keys to the + * ~/.aws/credentials file in the following format: + * + * [default] + * aws_access_key_id = AKID... + * aws_secret_access_key = YOUR_SECRET_KEY + * + * ## Using custom profiles + * + * The SDK supports loading credentials for separate profiles. This can be done + * in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to + * loading the SDK. + * 2. Directly load the AWS.SharedIniFileCredentials provider: + * + * ```javascript + * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'}); + * AWS.config.credentials = creds; + * ``` + * + * @!macro nobrowser */ -EventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) { - var chunkLength = chunk.length; - var currentOffset = 0; - - while (currentOffset < chunkLength) { - // create new message if necessary - if (!this.currentMessage) { - // working on a new message, determine total length - var bytesRemaining = chunkLength - currentOffset; - // prevent edge case where total length spans 2 chunks - if (!this.messageLengthBuffer) { - this.messageLengthBuffer = allocBuffer(4); - } - var numBytesForTotal = Math.min( - 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer - bytesRemaining // bytes left in chunk - ); +AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new SharedIniFileCredentials object. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var) + * the filename to use when loading credentials. + * @option options disableAssumeRole [Boolean] (false) True to disable + * support for profiles that assume an IAM role. If true, and an assume + * role profile is selected, an error is raised. + * @option options preferStaticCredentials [Boolean] (false) True to + * prefer static credentials to role_arn if both are present. + * @option options tokenCodeFn [Function] (null) Function to provide + * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini + * file. Function is called with value of mfa_serial and callback, and + * should provide the TokenCode or an error to the callback in the format + * callback(err, token) + * @option options callback [Function] (err) Credentials are eagerly loaded + * by the constructor. When the callback is called with no error, the + * credentials have been loaded successfully. + * @option options httpOptions [map] A set of options to pass to the low-level + * HTTP request. Currently supported options are: + * * **proxy** [String] — the URL to proxy requests through + * * **agent** [http.Agent, https.Agent] — the Agent object to perform + * HTTP requests with. Used for connection pooling. Defaults to the global + * agent (`http.globalAgent`) for non-SSL connections. Note that for + * SSL connections, a special Agent object is used in order to enable + * peer certificate verification. This feature is only available in the + * Node.js environment. + * * **connectTimeout** [Integer] — Sets the socket to timeout after + * failing to establish a connection with the server after + * `connectTimeout` milliseconds. This timeout has no effect once a socket + * connection has been established. + * * **timeout** [Integer] — The number of milliseconds a request can + * take before automatically being terminated. + * Defaults to two minutes (120000). + */ + constructor: function SharedIniFileCredentials(options) { + AWS.Credentials.call(this); - chunk.copy( - this.messageLengthBuffer, - this.currentMessagePendingLength, - currentOffset, - currentOffset + numBytesForTotal - ); + options = options || {}; - this.currentMessagePendingLength += numBytesForTotal; - currentOffset += numBytesForTotal; + this.filename = options.filename; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.disableAssumeRole = Boolean(options.disableAssumeRole); + this.preferStaticCredentials = Boolean(options.preferStaticCredentials); + this.tokenCodeFn = options.tokenCodeFn || null; + this.httpOptions = options.httpOptions || null; + this.get(options.callback || AWS.util.fn.noop); + }, - if (this.currentMessagePendingLength < 4) { - // not enough information to create the current message - break; - } - this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)); - this.messageLengthBuffer = null; - } + /** + * @api private + */ + load: function load(callback) { + var self = this; + try { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); + var profile = profiles[this.profile] || {}; - // write data into current message - var numBytesToWrite = Math.min( - this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message - chunkLength - currentOffset // number of bytes left in the original chunk - ); - chunk.copy( - this.currentMessage, // target buffer - this.currentMessagePendingLength, // target offset - currentOffset, // chunk offset - currentOffset + numBytesToWrite // chunk end to write + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' not found'), + { code: 'SharedIniFileCredentialsProviderFailure' } ); - this.currentMessagePendingLength += numBytesToWrite; - currentOffset += numBytesToWrite; + } - // check if a message is ready to be pushed - if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) { - // push out the message - this.push(this.currentMessage); - // cleanup - this.currentMessage = null; - this.currentMessageTotalLength = 0; - this.currentMessagePendingLength = 0; - } + /* + In the CLI, the presence of both a role_arn and static credentials have + different meanings depending on how many profiles have been visited. For + the first profile processed, role_arn takes precedence over any static + credentials, but for all subsequent profiles, static credentials are + used if present, and only in their absence will the profile's + source_profile and role_arn keys be used to load another set of + credentials. This var is intended to yield compatible behaviour in this + sdk. + */ + var preferStaticCredentialsToRoleArn = Boolean( + this.preferStaticCredentials + && profile['aws_access_key_id'] + && profile['aws_secret_access_key'] + ); + + if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) { + this.loadRoleProfile(profiles, profile, function(err, data) { + if (err) { + callback(err); + } else { + self.expired = false; + self.accessKeyId = data.Credentials.AccessKeyId; + self.secretAccessKey = data.Credentials.SecretAccessKey; + self.sessionToken = data.Credentials.SessionToken; + self.expireTime = data.Credentials.Expiration; + callback(null); + } + }); + return; + } + + this.accessKeyId = profile['aws_access_key_id']; + this.secretAccessKey = profile['aws_secret_access_key']; + this.sessionToken = profile['aws_session_token']; + + if (!this.accessKeyId || !this.secretAccessKey) { + throw AWS.util.error( + new Error('Credentials not set for profile ' + this.profile), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } + this.expired = false; + callback(null); + } catch (err) { + callback(err); } + }, - callback(); -}; + /** + * Loads the credentials from the shared credentials file + * + * @callback callback function(err) + * Called after the shared INI file on disk is read and parsed. When this + * callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh( + callback || AWS.util.fn.callback, + this.disableAssumeRole + ); + }, -EventMessageChunkerStream.prototype._flush = function(callback) { - if (this.currentMessageTotalLength) { - if (this.currentMessageTotalLength === this.currentMessagePendingLength) { - callback(null, this.currentMessage); - } else { - callback(new Error('Truncated event message received.')); - } - } else { - callback(); + /** + * @api private + */ + loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) { + if (this.disableAssumeRole) { + throw AWS.util.error( + new Error('Role assumption profiles are disabled. ' + + 'Failed to load profile ' + this.profile + + ' from ' + creds.filename), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); } -}; -/** - * @param {number} size Size of the message to be allocated. - * @api private - */ -EventMessageChunkerStream.prototype.allocateMessage = function(size) { - if (typeof size !== 'number') { - throw new Error('Attempted to allocate an event message where size was not a number: ' + size); - } - this.currentMessageTotalLength = size; - this.currentMessagePendingLength = 4; - this.currentMessage = allocBuffer(size); - this.currentMessage.writeUInt32BE(size, 0); -}; + var self = this; + var roleArn = roleProfile['role_arn']; + var roleSessionName = roleProfile['role_session_name']; + var externalId = roleProfile['external_id']; + var mfaSerial = roleProfile['mfa_serial']; + var sourceProfileName = roleProfile['source_profile']; + var durationSeconds = parseInt(roleProfile['duration_seconds'], 10) || undefined; -/** - * @api private - */ -module.exports = { - EventMessageChunkerStream: EventMessageChunkerStream -}; + // From experimentation, the following behavior mimics the AWS CLI: + // + // 1. Use region from the profile if present. + // 2. Otherwise fall back to N. Virginia (global endpoint). + // + // It is necessary to do the fallback explicitly, because if + // 'AWS_STS_REGIONAL_ENDPOINTS=regional', the underlying STS client will + // otherwise throw an error if region is left 'undefined'. + // + // Experimentation shows that the AWS CLI (tested at version 1.18.136) + // ignores the following potential sources of a region for the purposes of + // this AssumeRole call: + // + // - The [default] profile + // - The AWS_REGION environment variable + // + // Ignoring the [default] profile for the purposes of AssumeRole is arguably + // a bug in the CLI since it does use the [default] region for service + // calls... but right now we're matching behavior of the other tool. + var profileRegion = roleProfile['region'] || ASSUME_ROLE_DEFAULT_REGION; + if (!sourceProfileName) { + throw AWS.util.error( + new Error('source_profile is not set using profile ' + this.profile), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } -/***/ }), + var sourceProfileExistanceTest = creds[sourceProfileName]; -/***/ 73630: -/***/ ((module) => { + if (typeof sourceProfileExistanceTest !== 'object') { + throw AWS.util.error( + new Error('source_profile ' + sourceProfileName + ' using profile ' + + this.profile + ' does not exist'), + { code: 'SharedIniFileCredentialsProviderFailure' } + ); + } -/** - * Takes in a buffer of event messages and splits them into individual messages. - * @param {Buffer} buffer - * @api private - */ -function eventMessageChunker(buffer) { - /** @type Buffer[] */ - var messages = []; - var offset = 0; + var sourceCredentials = new AWS.SharedIniFileCredentials( + AWS.util.merge(this.options || {}, { + profile: sourceProfileName, + preferStaticCredentials: true + }) + ); - while (offset < buffer.length) { - var totalLength = buffer.readInt32BE(offset); + this.roleArn = roleArn; + var sts = new STS({ + credentials: sourceCredentials, + region: profileRegion, + httpOptions: this.httpOptions + }); - // create new buffer for individual message (shares memory with original) - var message = buffer.slice(offset, totalLength + offset); - // increment offset to it starts at the next message - offset += totalLength; + var roleParams = { + DurationSeconds: durationSeconds, + RoleArn: roleArn, + RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() + }; - messages.push(message); + if (externalId) { + roleParams.ExternalId = externalId; } - return messages; -} + if (mfaSerial && self.tokenCodeFn) { + roleParams.SerialNumber = mfaSerial; + self.tokenCodeFn(mfaSerial, function(err, token) { + if (err) { + var message; + if (err instanceof Error) { + message = err.message; + } else { + message = err; + } + callback( + AWS.util.error( + new Error('Error fetching MFA token: ' + message), + { code: 'SharedIniFileCredentialsProviderFailure' } + )); + return; + } -/** - * @api private - */ -module.exports = { - eventMessageChunker: eventMessageChunker -}; + roleParams.TokenCode = token; + sts.assumeRole(roleParams, callback); + }); + return; + } + sts.assumeRole(roleParams, callback); + } +}); /***/ }), -/***/ 93773: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var Transform = (__nccwpck_require__(12781).Transform); -var parseEvent = (__nccwpck_require__(52123).parseEvent); - -/** @type {Transform} */ -function EventUnmarshallerStream(options) { - options = options || {}; - // set output to object mode - options.readableObjectMode = true; - Transform.call(this, options); - this._readableState.objectMode = true; - - this.parser = options.parser; - this.eventStreamModel = options.eventStreamModel; -} +/***/ 68335: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -EventUnmarshallerStream.prototype = Object.create(Transform.prototype); +var AWS = __nccwpck_require__(28437); +var path = __nccwpck_require__(71017); +var crypto = __nccwpck_require__(6113); +var iniLoader = AWS.util.iniLoader; /** + * Represents credentials from sso.getRoleCredentials API for + * `sso_*` values defined in shared credentials file. * - * @param {Buffer} chunk - * @param {string} encoding - * @param {*} callback + * ## Using SSO credentials + * + * The credentials file must specify the information below to use sso: + * + * [profile sso-profile] + * sso_account_id = 012345678901 + * sso_region = **-****-* + * sso_role_name = SampleRole + * sso_start_url = https://d-******.awsapps.com/start + * + * or using the session format: + * + * [profile sso-token] + * sso_session = prod + * sso_account_id = 012345678901 + * sso_role_name = SampleRole + * + * [sso-session prod] + * sso_region = **-****-* + * sso_start_url = https://d-******.awsapps.com/start + * + * This information will be automatically added to your shared credentials file by running + * `aws configure sso`. + * + * ## Using custom profiles + * + * The SDK supports loading credentials for separate profiles. This can be done + * in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to + * loading the SDK. + * 2. Directly load the AWS.SsoCredentials provider: + * + * ```javascript + * var creds = new AWS.SsoCredentials({profile: 'myprofile'}); + * AWS.config.credentials = creds; + * ``` + * + * @!macro nobrowser */ -EventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) { - try { - var event = parseEvent(this.parser, chunk, this.eventStreamModel); - this.push(event); - return callback(); - } catch (err) { - callback(err); - } -}; +AWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new SsoCredentials object. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var) + * the filename to use when loading credentials. + * @option options callback [Function] (err) Credentials are eagerly loaded + * by the constructor. When the callback is called with no error, the + * credentials have been loaded successfully. + */ + constructor: function SsoCredentials(options) { + AWS.Credentials.call(this); -/** - * @api private - */ -module.exports = { - EventUnmarshallerStream: EventUnmarshallerStream -}; + options = options || {}; + this.errorCode = 'SsoCredentialsProviderFailure'; + this.expired = true; + this.filename = options.filename; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.service = options.ssoClient; + this.httpOptions = options.httpOptions || null; + this.get(options.callback || AWS.util.fn.noop); + }, -/***/ }), + /** + * @api private + */ + load: function load(callback) { + var self = this; -/***/ 48583: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + try { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); + var profile = profiles[this.profile] || {}; -var util = (__nccwpck_require__(28437).util); -var toBuffer = util.buffer.toBuffer; + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' not found'), + { code: self.errorCode } + ); + } -/** - * A lossless representation of a signed, 64-bit integer. Instances of this - * class may be used in arithmetic expressions as if they were numeric - * primitives, but the binary representation will be preserved unchanged as the - * `bytes` property of the object. The bytes should be encoded as big-endian, - * two's complement integers. - * @param {Buffer} bytes - * - * @api private - */ -function Int64(bytes) { - if (bytes.length !== 8) { - throw new Error('Int64 buffers must be exactly 8 bytes'); - } - if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes); + if (profile.sso_session) { + if (!profile.sso_account_id || !profile.sso_role_name) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' with session ' + profile.sso_session + + ' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_session", ' + + '"sso_role_name". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'), + { code: self.errorCode } + ); + } + } else { + if (!profile.sso_start_url || !profile.sso_account_id || !profile.sso_region || !profile.sso_role_name) { + throw AWS.util.error( + new Error('Profile ' + this.profile + ' does not have valid SSO credentials. Required parameters "sso_account_id", "sso_region", ' + + '"sso_role_name", "sso_start_url". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'), + { code: self.errorCode } + ); + } + } - this.bytes = bytes; -} + this.getToken(this.profile, profile, function (err, token) { + if (err) { + return callback(err); + } + var request = { + accessToken: token, + accountId: profile.sso_account_id, + roleName: profile.sso_role_name, + }; -/** - * @param {number} number - * @returns {Int64} - * - * @api private - */ -Int64.fromNumber = function(number) { - if (number > 9223372036854775807 || number < -9223372036854775808) { - throw new Error( - number + ' is too large (or, if negative, too small) to represent as an Int64' - ); - } + if (!self.service || self.service.config.region !== profile.sso_region) { + self.service = new AWS.SSO({ + region: profile.sso_region, + httpOptions: self.httpOptions, + }); + } - var bytes = new Uint8Array(8); - for ( - var i = 7, remaining = Math.abs(Math.round(number)); - i > -1 && remaining > 0; - i--, remaining /= 256 - ) { - bytes[i] = remaining; + self.service.getRoleCredentials(request, function(err, data) { + if (err || !data || !data.roleCredentials) { + callback(AWS.util.error( + err || new Error('Please log in using "aws sso login"'), + { code: self.errorCode } + ), null); + } else if (!data.roleCredentials.accessKeyId || !data.roleCredentials.secretAccessKey || !data.roleCredentials.sessionToken || !data.roleCredentials.expiration) { + throw AWS.util.error(new Error( + 'SSO returns an invalid temporary credential.' + )); + } else { + self.expired = false; + self.accessKeyId = data.roleCredentials.accessKeyId; + self.secretAccessKey = data.roleCredentials.secretAccessKey; + self.sessionToken = data.roleCredentials.sessionToken; + self.expireTime = new Date(data.roleCredentials.expiration); + callback(null); + } + }); + }); + } catch (err) { + callback(err); } + }, - if (number < 0) { - negate(bytes); - } + /** + * @private + * Uses legacy file system retrieval or if sso-session is set, + * use the SSOTokenProvider. + * + * @param {string} profileName - name of the profile. + * @param {object} profile - profile data containing sso_session or sso_start_url etc. + * @param {function} callback - called with (err, (string) token). + * + * @returns {void} + */ + getToken: function getToken(profileName, profile, callback) { + var self = this; - return new Int64(bytes); -}; + if (profile.sso_session) { + var _iniLoader = AWS.util.iniLoader; + var ssoSessions = _iniLoader.loadSsoSessionsFrom(); + var ssoSession = ssoSessions[profile.sso_session]; + Object.assign(profile, ssoSession); -/** - * @returns {number} - * - * @api private - */ -Int64.prototype.valueOf = function() { - var bytes = this.bytes.slice(0); - var negative = bytes[0] & 128; - if (negative) { - negate(bytes); + var ssoTokenProvider = new AWS.SSOTokenProvider({ + profile: profileName, + }); + ssoTokenProvider.get(function (err) { + if (err) { + return callback(err); + } + return callback(null, ssoTokenProvider.token); + }); + return; } - return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1); -}; + try { + /** + * The time window (15 mins) that SDK will treat the SSO token expires in before the defined expiration date in token. + * This is needed because server side may have invalidated the token before the defined expiration date. + */ + var EXPIRE_WINDOW_MS = 15 * 60 * 1000; + var hasher = crypto.createHash('sha1'); + var fileName = hasher.update(profile.sso_start_url).digest('hex') + '.json'; + var cachePath = path.join( + iniLoader.getHomeDir(), + '.aws', + 'sso', + 'cache', + fileName + ); + var cacheFile = AWS.util.readFileSync(cachePath); + var cacheContent = null; + if (cacheFile) { + cacheContent = JSON.parse(cacheFile); + } + if (!cacheContent) { + throw AWS.util.error( + new Error('Cached credentials not found under ' + this.profile + ' profile. Please make sure you log in with aws sso login first'), + { code: self.errorCode } + ); + } -Int64.prototype.toString = function() { - return String(this.valueOf()); -}; + if (!cacheContent.startUrl || !cacheContent.region || !cacheContent.accessToken || !cacheContent.expiresAt) { + throw AWS.util.error( + new Error('Cached credentials are missing required properties. Try running aws sso login.') + ); + } -/** - * @param {Buffer} bytes - * - * @api private - */ -function negate(bytes) { - for (var i = 0; i < 8; i++) { - bytes[i] ^= 0xFF; - } - for (var i = 7; i > -1; i--) { - bytes[i]++; - if (bytes[i] !== 0) { - break; - } + if (new Date(cacheContent.expiresAt).getTime() - Date.now() <= EXPIRE_WINDOW_MS) { + throw AWS.util.error(new Error( + 'The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.' + )); + } + + return callback(null, cacheContent.accessToken); + } catch (err) { + return callback(err, null); } -} + }, -/** - * @api private - */ -module.exports = { - Int64: Int64 -}; + /** + * Loads the credentials from the AWS SSO process + * + * @callback callback function(err) + * Called after the AWS SSO process has been executed. When this + * callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, +}); /***/ }), -/***/ 52123: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 77360: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -var parseMessage = (__nccwpck_require__(30866).parseMessage); +var AWS = __nccwpck_require__(28437); +var STS = __nccwpck_require__(57513); /** + * Represents temporary credentials retrieved from {AWS.STS}. Without any + * extra parameters, credentials will be fetched from the + * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the + * {AWS.STS.assumeRole} operation will be used to fetch credentials for the + * role instead. * - * @param {*} parser - * @param {Buffer} message - * @param {*} shape - * @api private + * @note AWS.TemporaryCredentials is deprecated, but remains available for + * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the + * preferred class for temporary credentials. + * + * To setup temporary credentials, configure a set of master credentials + * using the standard credentials providers (environment, EC2 instance metadata, + * or from the filesystem), then set the global credentials to a new + * temporary credentials object: + * + * ```javascript + * // Note that environment credentials are loaded by default, + * // the following line is shown for clarity: + * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS'); + * + * // Now set temporary credentials seeded from the master credentials + * AWS.config.credentials = new AWS.TemporaryCredentials(); + * + * // subsequent requests will now use temporary credentials from AWS STS. + * new AWS.S3().listBucket(function(err, data) { ... }); + * ``` + * + * @!attribute masterCredentials + * @return [AWS.Credentials] the master (non-temporary) credentials used to + * get and refresh temporary credentials from AWS STS. + * @note (see constructor) */ -function parseEvent(parser, message, shape) { - var parsedMessage = parseMessage(message); +AWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new temporary credentials object. + * + * @note In order to create temporary credentials, you first need to have + * "master" credentials configured in {AWS.Config.credentials}. These + * master credentials are necessary to retrieve the temporary credentials, + * as well as refresh the credentials when they expire. + * @param params [map] a map of options that are passed to the + * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. + * If a `RoleArn` parameter is passed in, credentials will be based on the + * IAM role. + * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials + * used to get and refresh temporary credentials from AWS STS. + * @example Creating a new credentials object for generic temporary credentials + * AWS.config.credentials = new AWS.TemporaryCredentials(); + * @example Creating a new credentials object for an IAM role + * AWS.config.credentials = new AWS.TemporaryCredentials({ + * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials', + * }); + * @see AWS.STS.assumeRole + * @see AWS.STS.getSessionToken + */ + constructor: function TemporaryCredentials(params, masterCredentials) { + AWS.Credentials.call(this); + this.loadMasterCredentials(masterCredentials); + this.expired = true; - // check if message is an event or error - var messageType = parsedMessage.headers[':message-type']; - if (messageType) { - if (messageType.value === 'error') { - throw parseError(parsedMessage); - } else if (messageType.value !== 'event') { - // not sure how to parse non-events/non-errors, ignore for now - return; - } + this.params = params || {}; + if (this.params.RoleArn) { + this.params.RoleSessionName = + this.params.RoleSessionName || 'temporary-credentials'; } + }, - // determine event type - var eventType = parsedMessage.headers[':event-type']; - // check that the event type is modeled - var eventModel = shape.members[eventType.value]; - if (!eventModel) { - return; - } + /** + * Refreshes credentials using {AWS.STS.assumeRole} or + * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed + * to the credentials {constructor}. + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh (callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, - var result = {}; - // check if an event payload exists - var eventPayloadMemberName = eventModel.eventPayloadMemberName; - if (eventPayloadMemberName) { - var payloadShape = eventModel.members[eventPayloadMemberName]; - // if the shape is binary, return the byte array - if (payloadShape.type === 'binary') { - result[eventPayloadMemberName] = parsedMessage.body; - } else { - result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape); + /** + * @api private + */ + load: function load (callback) { + var self = this; + self.createClients(); + self.masterCredentials.get(function () { + self.service.config.credentials = self.masterCredentials; + var operation = self.params.RoleArn ? + self.service.assumeRole : self.service.getSessionToken; + operation.call(self.service, function (err, data) { + if (!err) { + self.service.credentialsFrom(data, self); } - } + callback(err); + }); + }); + }, - // read event headers - var eventHeaderNames = eventModel.eventHeaderMemberNames; - for (var i = 0; i < eventHeaderNames.length; i++) { - var name = eventHeaderNames[i]; - if (parsedMessage.headers[name]) { - // parse the header! - result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value); - } + /** + * @api private + */ + loadMasterCredentials: function loadMasterCredentials (masterCredentials) { + this.masterCredentials = masterCredentials || AWS.config.credentials; + while (this.masterCredentials.masterCredentials) { + this.masterCredentials = this.masterCredentials.masterCredentials; } - var output = {}; - output[eventType.value] = result; - return output; -} + if (typeof this.masterCredentials.get !== 'function') { + this.masterCredentials = new AWS.Credentials(this.masterCredentials); + } + }, -function parseError(message) { - var errorCode = message.headers[':error-code']; - var errorMessage = message.headers[':error-message']; - var error = new Error(errorMessage.value || errorMessage); - error.code = error.name = errorCode.value || errorCode; - return error; -} + /** + * @api private + */ + createClients: function () { + this.service = this.service || new STS({params: this.params}); + } -/** - * @api private - */ -module.exports = { - parseEvent: parseEvent -}; +}); /***/ }), -/***/ 30866: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var Int64 = (__nccwpck_require__(48583).Int64); - -var splitMessage = (__nccwpck_require__(71765).splitMessage); +/***/ 11017: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -var BOOLEAN_TAG = 'boolean'; -var BYTE_TAG = 'byte'; -var SHORT_TAG = 'short'; -var INT_TAG = 'integer'; -var LONG_TAG = 'long'; -var BINARY_TAG = 'binary'; -var STRING_TAG = 'string'; -var TIMESTAMP_TAG = 'timestamp'; -var UUID_TAG = 'uuid'; +var AWS = __nccwpck_require__(28437); +var fs = __nccwpck_require__(57147); +var STS = __nccwpck_require__(57513); +var iniLoader = AWS.util.iniLoader; /** - * @api private + * Represents OIDC credentials from a file on disk + * If the credentials expire, the SDK can {refresh} the credentials + * from the file. * - * @param {Buffer} headers + * ## Using the web identity token file + * + * This provider is checked by default in the Node.js environment. To use + * the provider simply add your OIDC token to a file (ASCII encoding) and + * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment + * variable or web_identity_token_file shared config variable + * + * The file contains encoded OIDC token and the characters are + * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT). + * JWT's are 3 base64 encoded strings joined by the '.' character. + * + * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE + * environment variable or web_identity_token_file shared config variable, + * and get the OIDC token from filename. + * It will also read IAM role to be assumed from AWS_ROLE_ARN + * environment variable or role_arn shared config variable. + * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity} + * service operation + * + * @!macro nobrowser */ -function parseHeaders(headers) { - var out = {}; - var position = 0; - while (position < headers.length) { - var nameLength = headers.readUInt8(position++); - var name = headers.slice(position, position + nameLength).toString(); - position += nameLength; - switch (headers.readUInt8(position++)) { - case 0 /* boolTrue */: - out[name] = { - type: BOOLEAN_TAG, - value: true - }; - break; - case 1 /* boolFalse */: - out[name] = { - type: BOOLEAN_TAG, - value: false - }; - break; - case 2 /* byte */: - out[name] = { - type: BYTE_TAG, - value: headers.readInt8(position++) - }; - break; - case 3 /* short */: - out[name] = { - type: SHORT_TAG, - value: headers.readInt16BE(position) - }; - position += 2; - break; - case 4 /* integer */: - out[name] = { - type: INT_TAG, - value: headers.readInt32BE(position) - }; - position += 4; - break; - case 5 /* long */: - out[name] = { - type: LONG_TAG, - value: new Int64(headers.slice(position, position + 8)) - }; - position += 8; - break; - case 6 /* byteArray */: - var binaryLength = headers.readUInt16BE(position); - position += 2; - out[name] = { - type: BINARY_TAG, - value: headers.slice(position, position + binaryLength) - }; - position += binaryLength; - break; - case 7 /* string */: - var stringLength = headers.readUInt16BE(position); - position += 2; - out[name] = { - type: STRING_TAG, - value: headers.slice( - position, - position + stringLength - ).toString() - }; - position += stringLength; - break; - case 8 /* timestamp */: - out[name] = { - type: TIMESTAMP_TAG, - value: new Date( - new Int64(headers.slice(position, position + 8)) - .valueOf() - ) - }; - position += 8; - break; - case 9 /* uuid */: - var uuidChars = headers.slice(position, position + 16) - .toString('hex'); - position += 16; - out[name] = { - type: UUID_TAG, - value: uuidChars.substr(0, 8) + '-' + - uuidChars.substr(8, 4) + '-' + - uuidChars.substr(12, 4) + '-' + - uuidChars.substr(16, 4) + '-' + - uuidChars.substr(20) - }; - break; - default: - throw new Error('Unrecognized header type tag'); - } - } - return out; -} +AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { -function parseMessage(message) { - var parsed = splitMessage(message); - return { headers: parseHeaders(parsed.headers), body: parsed.body }; -} + /** + * @example Creating a new credentials object + * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials( + * // optionally provide configuration to apply to the underlying AWS.STS service client + * // if configuration is not provided, then configuration will be pulled from AWS.config + * { + * // specify timeout options + * httpOptions: { + * timeout: 100 + * } + * }); + * @see AWS.Config + */ + constructor: function TokenFileWebIdentityCredentials(clientConfig) { + AWS.Credentials.call(this); + this.data = null; + this.clientConfig = AWS.util.copy(clientConfig || {}); + }, -/** - * @api private - */ -module.exports = { - parseMessage: parseMessage -}; + /** + * Returns params from environment variables + * + * @api private + */ + getParamsFromEnv: function getParamsFromEnv() { + var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE', + ENV_ROLE_ARN = 'AWS_ROLE_ARN'; + if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) { + return [{ + envTokenFile: process.env[ENV_TOKEN_FILE], + roleArn: process.env[ENV_ROLE_ARN], + roleSessionName: process.env['AWS_ROLE_SESSION_NAME'] + }]; + } + }, + /** + * Returns params from shared config variables + * + * @api private + */ + getParamsFromSharedConfig: function getParamsFromSharedConfig() { + var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader); + var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile; + var profile = profiles[profileName] || {}; -/***/ }), + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile ' + profileName + ' not found'), + { code: 'TokenFileWebIdentityCredentialsProviderFailure' } + ); + } -/***/ 71765: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var paramsArray = []; -var util = (__nccwpck_require__(28437).util); -var toBuffer = util.buffer.toBuffer; + while (!profile['web_identity_token_file'] && profile['source_profile']) { + paramsArray.unshift({ + roleArn: profile['role_arn'], + roleSessionName: profile['role_session_name'] + }); + var sourceProfile = profile['source_profile']; + profile = profiles[sourceProfile]; + } -// All prelude components are unsigned, 32-bit integers -var PRELUDE_MEMBER_LENGTH = 4; -// The prelude consists of two components -var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; -// Checksums are always CRC32 hashes. -var CHECKSUM_LENGTH = 4; -// Messages must include a full prelude, a prelude checksum, and a message checksum -var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; + paramsArray.unshift({ + envTokenFile: profile['web_identity_token_file'], + roleArn: profile['role_arn'], + roleSessionName: profile['role_session_name'] + }); -/** - * @api private - * - * @param {Buffer} message - */ -function splitMessage(message) { - if (!util.Buffer.isBuffer(message)) message = toBuffer(message); + return paramsArray; + }, - if (message.length < MINIMUM_MESSAGE_LENGTH) { - throw new Error('Provided message too short to accommodate event stream message overhead'); - } + /** + * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see AWS.Credentials.get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, - if (message.length !== message.readUInt32BE(0)) { - throw new Error('Reported message length does not match received message length'); + /** + * @api private + */ + assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) { + var self = this; + if (paramsArray.length === 0) { + self.service.credentialsFrom(self.data, self); + callback(); + } else { + var params = paramsArray.shift(); + self.service.config.credentials = self.service.credentialsFrom(self.data, self); + self.service.assumeRole( + { + RoleArn: params.roleArn, + RoleSessionName: params.roleSessionName || 'token-file-web-identity' + }, + function (err, data) { + self.data = null; + if (err) { + callback(err); + } else { + self.data = data; + self.assumeRoleChaining(paramsArray, callback); + } + } + ); } + }, - var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH); - - if ( - expectedPreludeChecksum !== util.crypto.crc32( - message.slice(0, PRELUDE_LENGTH) - ) - ) { - throw new Error( - 'The prelude checksum specified in the message (' + - expectedPreludeChecksum + - ') does not match the calculated CRC32 checksum.' + /** + * @api private + */ + load: function load(callback) { + var self = this; + try { + var paramsArray = self.getParamsFromEnv(); + if (!paramsArray) { + paramsArray = self.getParamsFromSharedConfig(); + } + if (paramsArray) { + var params = paramsArray.shift(); + var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'}); + if (!self.service) { + self.createClients(); + } + self.service.assumeRoleWithWebIdentity( + { + WebIdentityToken: oidcToken, + RoleArn: params.roleArn, + RoleSessionName: params.roleSessionName || 'token-file-web-identity' + }, + function (err, data) { + self.data = null; + if (err) { + callback(err); + } else { + self.data = data; + self.assumeRoleChaining(paramsArray, callback); + } + } ); + } + } catch (err) { + callback(err); } + }, - var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH); + /** + * @api private + */ + createClients: function() { + if (!this.service) { + var stsConfig = AWS.util.merge({}, this.clientConfig); + this.service = new STS(stsConfig); - if ( - expectedMessageChecksum !== util.crypto.crc32( - message.slice(0, message.length - CHECKSUM_LENGTH) - ) - ) { - throw new Error( - 'The message checksum did not match the expected value of ' + - expectedMessageChecksum - ); + // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken + this.service.retryableError = function(error) { + if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') { + return true; + } else { + return AWS.Service.prototype.retryableError.call(this, error); + } + }; } - - var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH; - var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH); - - return { - headers: message.slice(headersStart, headersEnd), - body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH), - }; -} - -/** - * @api private - */ -module.exports = { - splitMessage: splitMessage -}; + } +}); /***/ }), -/***/ 69643: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 74998: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var STS = __nccwpck_require__(57513); /** - * What is necessary to create an event stream in node? - * - http response stream - * - parser - * - event stream model + * Represents credentials retrieved from STS Web Identity Federation support. + * + * By default this provider gets credentials using the + * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation + * requires a `RoleArn` containing the ARN of the IAM trust policy for the + * application for which credentials will be given. In addition, the + * `WebIdentityToken` must be set to the token provided by the identity + * provider. See {constructor} for an example on creating a credentials + * object with proper `RoleArn` and `WebIdentityToken` values. + * + * ## Refreshing Credentials from Identity Service + * + * In addition to AWS credentials expiring after a given amount of time, the + * login token from the identity provider will also expire. Once this token + * expires, it will not be usable to refresh AWS credentials, and another + * token will be needed. The SDK does not manage refreshing of the token value, + * but this can be done through a "refresh token" supported by most identity + * providers. Consult the documentation for the identity provider for refreshing + * tokens. Once the refreshed token is acquired, you should make sure to update + * this new token in the credentials object's {params} property. The following + * code will update the WebIdentityToken, assuming you have retrieved an updated + * token from the identity provider: + * + * ```javascript + * AWS.config.credentials.params.WebIdentityToken = updatedToken; + * ``` + * + * Future calls to `credentials.refresh()` will now use the new token. + * + * @!attribute params + * @return [map] the map of params passed to + * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the + * `params.WebIdentityToken` property. + * @!attribute data + * @return [map] the raw data response from the call to + * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get + * access to other properties from the response. */ +AWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { + /** + * Creates a new credentials object. + * @param (see AWS.STS.assumeRoleWithWebIdentity) + * @example Creating a new credentials object + * AWS.config.credentials = new AWS.WebIdentityCredentials({ + * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity', + * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service + * RoleSessionName: 'web' // optional name, defaults to web-identity + * }, { + * // optionally provide configuration to apply to the underlying AWS.STS service client + * // if configuration is not provided, then configuration will be pulled from AWS.config + * + * // specify timeout options + * httpOptions: { + * timeout: 100 + * } + * }); + * @see AWS.STS.assumeRoleWithWebIdentity + * @see AWS.Config + */ + constructor: function WebIdentityCredentials(params, clientConfig) { + AWS.Credentials.call(this); + this.expired = true; + this.params = params; + this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity'; + this.data = null; + this._clientConfig = AWS.util.copy(clientConfig || {}); + }, -var EventMessageChunkerStream = (__nccwpck_require__(18518).EventMessageChunkerStream); -var EventUnmarshallerStream = (__nccwpck_require__(93773).EventUnmarshallerStream); - -function createEventStream(stream, parser, model) { - var eventStream = new EventUnmarshallerStream({ - parser: parser, - eventStreamModel: model - }); - - var eventMessageChunker = new EventMessageChunkerStream(); - - stream.pipe( - eventMessageChunker - ).pipe(eventStream); - - stream.on('error', function(err) { - eventMessageChunker.emit('error', err); - }); + /** + * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} + * + * @callback callback function(err) + * Called when the STS service responds (or fails). When + * this callback is called with no error, it means that the credentials + * information has been loaded into the object (as the `accessKeyId`, + * `secretAccessKey`, and `sessionToken` properties). + * @param err [Error] if an error occurred, this value will be filled + * @see get + */ + refresh: function refresh(callback) { + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, - eventMessageChunker.on('error', function(err) { - eventStream.emit('error', err); + /** + * @api private + */ + load: function load(callback) { + var self = this; + self.createClients(); + self.service.assumeRoleWithWebIdentity(function (err, data) { + self.data = null; + if (!err) { + self.data = data; + self.service.credentialsFrom(data, self); + } + callback(err); }); + }, - return eventStream; -} + /** + * @api private + */ + createClients: function() { + if (!this.service) { + var stsConfig = AWS.util.merge({}, this._clientConfig); + stsConfig.params = this.params; + this.service = new STS(stsConfig); + } + } -/** - * @api private - */ -module.exports = { - createEventStream: createEventStream -}; +}); /***/ }), -/***/ 54995: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 45313: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var SequentialExecutor = __nccwpck_require__(55948); -var DISCOVER_ENDPOINT = (__nccwpck_require__(45313).discoverEndpoint); -/** - * The namespace used to register global event listeners for request building - * and sending. - */ -AWS.EventListeners = { - /** - * @!attribute VALIDATE_CREDENTIALS - * A request listener that validates whether the request is being - * sent with credentials. - * Handles the {AWS.Request~validate 'validate' Request event} - * @example Sending a request without validating credentials - * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS; - * request.removeListener('validate', listener); - * @readonly - * @return [Function] - * @!attribute VALIDATE_REGION - * A request listener that validates whether the region is set - * for a request. - * Handles the {AWS.Request~validate 'validate' Request event} - * @example Sending a request without validating region configuration - * var listener = AWS.EventListeners.Core.VALIDATE_REGION; - * request.removeListener('validate', listener); - * @readonly - * @return [Function] - * @!attribute VALIDATE_PARAMETERS - * A request listener that validates input parameters in a request. - * Handles the {AWS.Request~validate 'validate' Request event} - * @example Sending a request without validating parameters - * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS; - * request.removeListener('validate', listener); - * @example Disable parameter validation globally - * AWS.EventListeners.Core.removeListener('validate', - * AWS.EventListeners.Core.VALIDATE_REGION); - * @readonly - * @return [Function] - * @!attribute SEND - * A request listener that initiates the HTTP connection for a - * request being sent. Handles the {AWS.Request~send 'send' Request event} - * @example Replacing the HTTP handler - * var listener = AWS.EventListeners.Core.SEND; - * request.removeListener('send', listener); - * request.on('send', function(response) { - * customHandler.send(response); - * }); - * @return [Function] - * @readonly - * @!attribute HTTP_DATA - * A request listener that reads data from the HTTP connection in order - * to build the response data. - * Handles the {AWS.Request~httpData 'httpData' Request event}. - * Remove this handler if you are overriding the 'httpData' event and - * do not want extra data processing and buffering overhead. - * @example Disabling default data processing - * var listener = AWS.EventListeners.Core.HTTP_DATA; - * request.removeListener('httpData', listener); - * @return [Function] - * @readonly - */ - Core: {} /* doc hack */ -}; +var util = __nccwpck_require__(77985); +var endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED']; /** + * Generate key (except resources and operation part) to index the endpoints in the cache + * If input shape has endpointdiscoveryid trait then use + * accessKey + operation + resources + region + service as cache key + * If input shape doesn't have endpointdiscoveryid trait then use + * accessKey + region + service as cache key + * @return [map] object with keys to index endpoints. * @api private */ -function getOperationAuthtype(req) { - if (!req.service.api.operations) { - return ''; +function getCacheKey(request) { + var service = request.service; + var api = service.api || {}; + var operations = api.operations; + var identifiers = {}; + if (service.config.region) { + identifiers.region = service.config.region; } - var operation = req.service.api.operations[req.operation]; - return operation ? operation.authtype : ''; + if (api.serviceId) { + identifiers.serviceId = api.serviceId; + } + if (service.config.credentials.accessKeyId) { + identifiers.accessKeyId = service.config.credentials.accessKeyId; + } + return identifiers; } /** + * Recursive helper for marshallCustomIdentifiers(). + * Looks for required string input members that have 'endpointdiscoveryid' trait. * @api private */ -function getIdentityType(req) { - var service = req.service; - - if (service.config.signatureVersion) { - return service.config.signatureVersion; - } - - if (service.api.signatureVersion) { - return service.api.signatureVersion; - } - - return getOperationAuthtype(req); -} - -AWS.EventListeners = { - Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) { - addAsync( - 'VALIDATE_CREDENTIALS', 'validate', - function VALIDATE_CREDENTIALS(req, done) { - if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none - - var identityType = getIdentityType(req); - if (identityType === 'bearer') { - req.service.config.getToken(function(err) { - if (err) { - req.response.error = AWS.util.error(err, {code: 'TokenError'}); - } - done(); - }); - return; - } - - req.service.config.getCredentials(function(err) { - if (err) { - req.response.error = AWS.util.error(err, - { - code: 'CredentialsError', - message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1' - } - ); - } - done(); - }); - }); - - add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) { - if (!req.service.isGlobalEndpoint) { - var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); - if (!req.service.config.region) { - req.response.error = AWS.util.error(new Error(), - {code: 'ConfigError', message: 'Missing region in config'}); - } else if (!dnsHostRegex.test(req.service.config.region)) { - req.response.error = AWS.util.error(new Error(), - {code: 'ConfigError', message: 'Invalid region in config'}); - } - } - }); - - add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) { - if (!req.service.api.operations) { - return; - } - var operation = req.service.api.operations[req.operation]; - if (!operation) { - return; - } - var idempotentMembers = operation.idempotentMembers; - if (!idempotentMembers.length) { - return; - } - // creates a copy of params so user's param object isn't mutated - var params = AWS.util.copy(req.params); - for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) { - if (!params[idempotentMembers[i]]) { - // add the member - params[idempotentMembers[i]] = AWS.util.uuid.v4(); - } +function marshallCustomIdentifiersHelper(result, params, shape) { + if (!shape || params === undefined || params === null) return; + if (shape.type === 'structure' && shape.required && shape.required.length > 0) { + util.arrayEach(shape.required, function(name) { + var memberShape = shape.members[name]; + if (memberShape.endpointDiscoveryId === true) { + var locationName = memberShape.isLocationName ? memberShape.name : name; + result[locationName] = String(params[name]); + } else { + marshallCustomIdentifiersHelper(result, params[name], memberShape); } - req.params = params; }); + } +} - add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) { - if (!req.service.api.operations) { - return; - } - var rules = req.service.api.operations[req.operation].input; - var validation = req.service.config.paramValidation; - new AWS.ParamValidator(validation).validate(rules, req.params); - }); +/** + * Get custom identifiers for cache key. + * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait. + * @param [object] request object + * @param [object] input shape of the given operation's api + * @api private + */ +function marshallCustomIdentifiers(request, shape) { + var identifiers = {}; + marshallCustomIdentifiersHelper(identifiers, request.params, shape); + return identifiers; +} - add('COMPUTE_CHECKSUM', 'afterBuild', function COMPUTE_CHECKSUM(req) { - if (!req.service.api.operations) { - return; - } - var operation = req.service.api.operations[req.operation]; - if (!operation) { - return; - } - var body = req.httpRequest.body; - var isNonStreamingPayload = body && (AWS.util.Buffer.isBuffer(body) || typeof body === 'string'); - var headers = req.httpRequest.headers; - if ( - operation.httpChecksumRequired && - req.service.config.computeChecksums && - isNonStreamingPayload && - !headers['Content-MD5'] - ) { - var md5 = AWS.util.crypto.md5(body, 'base64'); - headers['Content-MD5'] = md5; - } - }); +/** + * Call endpoint discovery operation when it's optional. + * When endpoint is available in cache then use the cached endpoints. If endpoints + * are unavailable then use regional endpoints and call endpoint discovery operation + * asynchronously. This is turned off by default. + * @param [object] request object + * @api private + */ +function optionalDiscoverEndpoint(request) { + var service = request.service; + var api = service.api; + var operationModel = api.operations ? api.operations[request.operation] : undefined; + var inputShape = operationModel ? operationModel.input : undefined; - addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) { - req.haltHandlersOnError(); - if (!req.service.api.operations) { - return; - } - var operation = req.service.api.operations[req.operation]; - var authtype = operation ? operation.authtype : ''; - if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none - if (req.service.getSignerClass(req) === AWS.Signers.V4) { - var body = req.httpRequest.body || ''; - if (authtype.indexOf('unsigned-body') >= 0) { - req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; - return done(); - } - AWS.util.computeSha256(body, function(err, sha) { - if (err) { - done(err); - } - else { - req.httpRequest.headers['X-Amz-Content-Sha256'] = sha; - done(); - } - }); - } else { - done(); - } + var identifiers = marshallCustomIdentifiers(request, inputShape); + var cacheKey = getCacheKey(request); + if (Object.keys(identifiers).length > 0) { + cacheKey = util.update(cacheKey, identifiers); + if (operationModel) cacheKey.operation = operationModel.name; + } + var endpoints = AWS.endpointCache.get(cacheKey); + if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { + //endpoint operation is being made but response not yet received + //or endpoint operation just failed in 1 minute + return; + } else if (endpoints && endpoints.length > 0) { + //found endpoint record from cache + request.httpRequest.updateEndpoint(endpoints[0].Address); + } else { + //endpoint record not in cache or outdated. make discovery operation + var endpointRequest = service.makeRequest(api.endpointOperation, { + Operation: operationModel.name, + Identifiers: identifiers, }); - - add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) { - var authtype = getOperationAuthtype(req); - var payloadMember = AWS.util.getRequestPayloadShape(req); - if (req.httpRequest.headers['Content-Length'] === undefined) { - try { - var length = AWS.util.string.byteLength(req.httpRequest.body); - req.httpRequest.headers['Content-Length'] = length; - } catch (err) { - if (payloadMember && payloadMember.isStreaming) { - if (payloadMember.requiresLength) { - //streaming payload requires length(s3, glacier) - throw err; - } else if (authtype.indexOf('unsigned-body') >= 0) { - //unbounded streaming payload(lex, mediastore) - req.httpRequest.headers['Transfer-Encoding'] = 'chunked'; - return; - } else { - throw err; - } - } - throw err; - } + addApiVersionHeader(endpointRequest); + endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); + endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK); + //put in a placeholder for endpoints already requested, prevent + //too much in-flight calls + AWS.endpointCache.put(cacheKey, [{ + Address: '', + CachePeriodInMinutes: 1 + }]); + endpointRequest.send(function(err, data) { + if (data && data.Endpoints) { + AWS.endpointCache.put(cacheKey, data.Endpoints); + } else if (err) { + AWS.endpointCache.put(cacheKey, [{ + Address: '', + CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute + }]); } }); + } +} - add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) { - req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host; - }); +var requestQueue = {}; - add('SET_TRACE_ID', 'afterBuild', function SET_TRACE_ID(req) { - var traceIdHeaderName = 'X-Amzn-Trace-Id'; - if (AWS.util.isNode() && !Object.hasOwnProperty.call(req.httpRequest.headers, traceIdHeaderName)) { - var ENV_LAMBDA_FUNCTION_NAME = 'AWS_LAMBDA_FUNCTION_NAME'; - var ENV_TRACE_ID = '_X_AMZN_TRACE_ID'; - var functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; - var traceId = process.env[ENV_TRACE_ID]; - if ( - typeof functionName === 'string' && - functionName.length > 0 && - typeof traceId === 'string' && - traceId.length > 0 - ) { - req.httpRequest.headers[traceIdHeaderName] = traceId; - } - } +/** + * Call endpoint discovery operation when it's required. + * When endpoint is available in cache then use cached ones. If endpoints are + * unavailable then SDK should call endpoint operation then use returned new + * endpoint for the api call. SDK will automatically attempt to do endpoint + * discovery. This is turned off by default + * @param [object] request object + * @api private + */ +function requiredDiscoverEndpoint(request, done) { + var service = request.service; + var api = service.api; + var operationModel = api.operations ? api.operations[request.operation] : undefined; + var inputShape = operationModel ? operationModel.input : undefined; + + var identifiers = marshallCustomIdentifiers(request, inputShape); + var cacheKey = getCacheKey(request); + if (Object.keys(identifiers).length > 0) { + cacheKey = util.update(cacheKey, identifiers); + if (operationModel) cacheKey.operation = operationModel.name; + } + var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey); + var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys + if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { + //endpoint operation is being made but response not yet received + //push request object to a pending queue + if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = []; + requestQueue[cacheKeyStr].push({request: request, callback: done}); + return; + } else if (endpoints && endpoints.length > 0) { + request.httpRequest.updateEndpoint(endpoints[0].Address); + done(); + } else { + var endpointRequest = service.makeRequest(api.endpointOperation, { + Operation: operationModel.name, + Identifiers: identifiers, }); + endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); + addApiVersionHeader(endpointRequest); - add('RESTART', 'restart', function RESTART() { - var err = this.response.error; - if (!err || !err.retryable) return; + //put in a placeholder for endpoints already requested, prevent + //too much in-flight calls + AWS.endpointCache.put(cacheKeyStr, [{ + Address: '', + CachePeriodInMinutes: 60 //long-live cache + }]); + endpointRequest.send(function(err, data) { + if (err) { + request.response.error = util.error(err, { retryable: false }); + AWS.endpointCache.remove(cacheKey); - this.httpRequest = new AWS.HttpRequest( - this.service.endpoint, - this.service.region - ); + //fail all the pending requests in batch + if (requestQueue[cacheKeyStr]) { + var pendingRequests = requestQueue[cacheKeyStr]; + util.arrayEach(pendingRequests, function(requestContext) { + requestContext.request.response.error = util.error(err, { retryable: false }); + requestContext.callback(); + }); + delete requestQueue[cacheKeyStr]; + } + } else if (data) { + AWS.endpointCache.put(cacheKeyStr, data.Endpoints); + request.httpRequest.updateEndpoint(data.Endpoints[0].Address); - if (this.response.retryCount < this.service.config.maxRetries) { - this.response.retryCount++; - } else { - this.response.error = null; + //update the endpoint for all the pending requests in batch + if (requestQueue[cacheKeyStr]) { + var pendingRequests = requestQueue[cacheKeyStr]; + util.arrayEach(pendingRequests, function(requestContext) { + requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address); + requestContext.callback(); + }); + delete requestQueue[cacheKeyStr]; + } } + done(); }); + } +} - var addToHead = true; - addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead); +/** + * add api version header to endpoint operation + * @api private + */ +function addApiVersionHeader(endpointRequest) { + var api = endpointRequest.service.api; + var apiVersion = api.apiVersion; + if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) { + endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion; + } +} - addAsync('SIGN', 'sign', function SIGN(req, done) { - var service = req.service; - var identityType = getIdentityType(req); - if (!identityType || identityType.length === 0) return done(); // none +/** + * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid + * endpoint from cache. + * @api private + */ +function invalidateCachedEndpoints(response) { + var error = response.error; + var httpResponse = response.httpResponse; + if (error && + (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) + ) { + var request = response.request; + var operations = request.service.api.operations || {}; + var inputShape = operations[request.operation] ? operations[request.operation].input : undefined; + var identifiers = marshallCustomIdentifiers(request, inputShape); + var cacheKey = getCacheKey(request); + if (Object.keys(identifiers).length > 0) { + cacheKey = util.update(cacheKey, identifiers); + if (operations[request.operation]) cacheKey.operation = operations[request.operation].name; + } + AWS.endpointCache.remove(cacheKey); + } +} - if (identityType === 'bearer') { - service.config.getToken(function (err, token) { - if (err) { - req.response.error = err; - return done(); - } +/** + * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime. + * @param [object] client Service client object. + * @api private + */ +function hasCustomEndpoint(client) { + //if set endpoint is set for specific client, enable endpoint discovery will raise an error. + if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) { + throw util.error(new Error(), { + code: 'ConfigurationException', + message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.' + }); + }; + var svcConfig = AWS.config[client.serviceIdentifier] || {}; + return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint)); +} - try { - var SignerClass = service.getSignerClass(req); - var signer = new SignerClass(req.httpRequest); - signer.addAuthorization(token); - } catch (e) { - req.response.error = e; - } - done(); - }); - } else { - service.config.getCredentials(function (err, credentials) { - if (err) { - req.response.error = err; - return done(); - } +/** + * @api private + */ +function isFalsy(value) { + return ['false', '0'].indexOf(value) >= 0; +} - try { - var date = service.getSkewCorrectedDate(); - var SignerClass = service.getSignerClass(req); - var operations = req.service.api.operations || {}; - var operation = operations[req.operation]; - var signer = new SignerClass(req.httpRequest, - service.getSigningName(req), - { - signatureCache: service.config.signatureCache, - operation: operation, - signatureVersion: service.api.signatureVersion - }); - signer.setServiceClientId(service._clientId); +/** + * If endpoint discovery should perform for this request when no operation requires endpoint + * discovery for the given service. + * SDK performs config resolution in order like below: + * 1. If set in client configuration. + * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY. + * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'. + * @param [object] request request object. + * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this + * function returns undefined + * @api private + */ +function resolveEndpointDiscoveryConfig(request) { + var service = request.service || {}; + if (service.config.endpointDiscoveryEnabled !== undefined) { + return service.config.endpointDiscoveryEnabled; + } - // clear old authorization headers - delete req.httpRequest.headers['Authorization']; - delete req.httpRequest.headers['Date']; - delete req.httpRequest.headers['X-Amz-Date']; + //shared ini file is only available in Node + //not to check env in browser + if (util.isBrowser()) return undefined; - // add new authorization - signer.addAuthorization(credentials, date); - req.signedAt = date; - } catch (e) { - req.response.error = e; - } - done(); + // If any of recognized endpoint discovery config env is set + for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) { + var env = endpointDiscoveryEnabledEnvs[i]; + if (Object.prototype.hasOwnProperty.call(process.env, env)) { + if (process.env[env] === '' || process.env[env] === undefined) { + throw util.error(new Error(), { + code: 'ConfigurationException', + message: 'environmental variable ' + env + ' cannot be set to nothing' }); - } - }); + return !isFalsy(process.env[env]); + } + } - add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) { - if (this.service.successfulResponse(resp, this)) { - resp.data = {}; - resp.error = null; - } else { - resp.data = null; - resp.error = AWS.util.error(new Error(), - {code: 'UnknownError', message: 'An unknown error occurred.'}); - } - }); + var configFile = {}; + try { + configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({ + isConfig: true, + filename: process.env[AWS.util.sharedConfigFileEnv] + }) : {}; + } catch (e) {} + var sharedFileConfig = configFile[ + process.env.AWS_PROFILE || AWS.util.defaultProfile + ] || {}; + if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) { + if (sharedFileConfig.endpoint_discovery_enabled === undefined) { + throw util.error(new Error(), { + code: 'ConfigurationException', + message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing' + }); + } + return !isFalsy(sharedFileConfig.endpoint_discovery_enabled); + } + return undefined; +} - add('ERROR', 'error', function ERROR(err, resp) { - var awsQueryCompatible = resp.request.service.api.awsQueryCompatible; - if (awsQueryCompatible) { - var headers = resp.httpResponse.headers; - var queryErrorCode = headers ? headers['x-amzn-query-error'] : undefined; - if (queryErrorCode && queryErrorCode.includes(';')) { - resp.error.code = queryErrorCode.split(';')[0]; - } +/** + * attach endpoint discovery logic to request object + * @param [object] request + * @api private + */ +function discoverEndpoint(request, done) { + var service = request.service || {}; + if (hasCustomEndpoint(service) || request.isPresigned()) return done(); + + var operations = service.api.operations || {}; + var operationModel = operations[request.operation]; + var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL'; + var isEnabled = resolveEndpointDiscoveryConfig(request); + var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery; + if (isEnabled || hasRequiredEndpointDiscovery) { + // Once a customer enables endpoint discovery, the SDK should start appending + // the string endpoint-discovery to the user-agent on all requests. + request.httpRequest.appendToUserAgent('endpoint-discovery'); + } + switch (isEndpointDiscoveryRequired) { + case 'OPTIONAL': + if (isEnabled || hasRequiredEndpointDiscovery) { + // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery + // by default for all operations of that service, including operations where endpoint discovery is optional. + optionalDiscoverEndpoint(request); + request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); } - }, true); + done(); + break; + case 'REQUIRED': + if (isEnabled === false) { + // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client, + // then the SDK must return a clear and actionable exception. + request.response.error = util.error(new Error(), { + code: 'ConfigurationException', + message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation + + '() requires it. Please check your configurations.' + }); + done(); + break; + } + request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); + requiredDiscoverEndpoint(request, done); + break; + case 'NULL': + default: + done(); + break; + } +} - addAsync('SEND', 'send', function SEND(resp, done) { - resp.httpResponse._abortCallback = done; - resp.error = null; - resp.data = null; +module.exports = { + discoverEndpoint: discoverEndpoint, + requiredDiscoverEndpoint: requiredDiscoverEndpoint, + optionalDiscoverEndpoint: optionalDiscoverEndpoint, + marshallCustomIdentifiers: marshallCustomIdentifiers, + getCacheKey: getCacheKey, + invalidateCachedEndpoint: invalidateCachedEndpoints, +}; - function callback(httpResp) { - resp.httpResponse.stream = httpResp; - var stream = resp.request.httpRequest.stream; - var service = resp.request.service; - var api = service.api; - var operationName = resp.request.operation; - var operation = api.operations[operationName] || {}; - httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) { - resp.request.emit( - 'httpHeaders', - [statusCode, headers, resp, statusMessage] - ); +/***/ }), - if (!resp.httpResponse.streaming) { - if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check - // if we detect event streams, we're going to have to - // return the stream immediately - if (operation.hasEventOutput && service.successfulResponse(resp)) { - // skip reading the IncomingStream - resp.request.emit('httpDone'); - done(); - return; - } +/***/ 76663: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - httpResp.on('readable', function onReadable() { - var data = httpResp.read(); - if (data !== null) { - resp.request.emit('httpData', [data, resp]); - } - }); - } else { // legacy streams API - httpResp.on('data', function onData(data) { - resp.request.emit('httpData', [data, resp]); - }); - } - } - }); +var AWS = __nccwpck_require__(28437); +var util = AWS.util; +var typeOf = (__nccwpck_require__(48084).typeOf); +var DynamoDBSet = __nccwpck_require__(20304); +var NumberValue = __nccwpck_require__(91593); - httpResp.on('end', function onEnd() { - if (!stream || !stream.didCallback) { - if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) { - // don't concatenate response chunks when streaming event stream data when response is successful - return; - } - resp.request.emit('httpDone'); - done(); - } - }); +AWS.DynamoDB.Converter = { + /** + * Convert a JavaScript value to its equivalent DynamoDB AttributeValue type + * + * @param data [any] The data to convert to a DynamoDB AttributeValue + * @param options [map] + * @option options convertEmptyValues [Boolean] Whether to automatically + * convert empty strings, blobs, + * and sets to `null` + * @option options wrapNumbers [Boolean] Whether to return numbers as a + * NumberValue object instead of + * converting them to native JavaScript + * numbers. This allows for the safe + * round-trip transport of numbers of + * arbitrary size. + * @return [map] An object in the Amazon DynamoDB AttributeValue format + * + * @see AWS.DynamoDB.Converter.marshall AWS.DynamoDB.Converter.marshall to + * convert entire records (rather than individual attributes) + */ + input: function convertInput(data, options) { + options = options || {}; + var type = typeOf(data); + if (type === 'Object') { + return formatMap(data, options); + } else if (type === 'Array') { + return formatList(data, options); + } else if (type === 'Set') { + return formatSet(data, options); + } else if (type === 'String') { + if (data.length === 0 && options.convertEmptyValues) { + return convertInput(null); } - - function progress(httpResp) { - httpResp.on('sendProgress', function onSendProgress(value) { - resp.request.emit('httpUploadProgress', [value, resp]); - }); - - httpResp.on('receiveProgress', function onReceiveProgress(value) { - resp.request.emit('httpDownloadProgress', [value, resp]); - }); + return { S: data }; + } else if (type === 'Number' || type === 'NumberValue') { + return { N: data.toString() }; + } else if (type === 'Binary') { + if (data.length === 0 && options.convertEmptyValues) { + return convertInput(null); } + return { B: data }; + } else if (type === 'Boolean') { + return { BOOL: data }; + } else if (type === 'null') { + return { NULL: true }; + } else if (type !== 'undefined' && type !== 'Function') { + // this value has a custom constructor + return formatMap(data, options); + } + }, - function error(err) { - if (err.code !== 'RequestAbortedError') { - var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError'; - err = AWS.util.error(err, { - code: errCode, - region: resp.request.httpRequest.region, - hostname: resp.request.httpRequest.endpoint.hostname, - retryable: true - }); - } - resp.error = err; - resp.request.emit('httpError', [resp.error, resp], function() { - done(); - }); - } + /** + * Convert a JavaScript object into a DynamoDB record. + * + * @param data [any] The data to convert to a DynamoDB record + * @param options [map] + * @option options convertEmptyValues [Boolean] Whether to automatically + * convert empty strings, blobs, + * and sets to `null` + * @option options wrapNumbers [Boolean] Whether to return numbers as a + * NumberValue object instead of + * converting them to native JavaScript + * numbers. This allows for the safe + * round-trip transport of numbers of + * arbitrary size. + * + * @return [map] An object in the DynamoDB record format. + * + * @example Convert a JavaScript object into a DynamoDB record + * var marshalled = AWS.DynamoDB.Converter.marshall({ + * string: 'foo', + * list: ['fizz', 'buzz', 'pop'], + * map: { + * nestedMap: { + * key: 'value', + * } + * }, + * number: 123, + * nullValue: null, + * boolValue: true, + * stringSet: new DynamoDBSet(['foo', 'bar', 'baz']) + * }); + */ + marshall: function marshallItem(data, options) { + return AWS.DynamoDB.Converter.input(data, options).M; + }, - function executeSend() { - var http = AWS.HttpClient.getInstance(); - var httpOptions = resp.request.service.config.httpOptions || {}; - try { - var stream = http.handleRequest(resp.request.httpRequest, httpOptions, - callback, error); - progress(stream); - } catch (err) { - error(err); + /** + * Convert a DynamoDB AttributeValue object to its equivalent JavaScript type. + * + * @param data [map] An object in the Amazon DynamoDB AttributeValue format + * @param options [map] + * @option options convertEmptyValues [Boolean] Whether to automatically + * convert empty strings, blobs, + * and sets to `null` + * @option options wrapNumbers [Boolean] Whether to return numbers as a + * NumberValue object instead of + * converting them to native JavaScript + * numbers. This allows for the safe + * round-trip transport of numbers of + * arbitrary size. + * + * @return [Object|Array|String|Number|Boolean|null] + * + * @see AWS.DynamoDB.Converter.unmarshall AWS.DynamoDB.Converter.unmarshall to + * convert entire records (rather than individual attributes) + */ + output: function convertOutput(data, options) { + options = options || {}; + var list, map, i; + for (var type in data) { + var values = data[type]; + if (type === 'M') { + map = {}; + for (var key in values) { + map[key] = convertOutput(values[key], options); } - } - var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000; - if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign - this.emit('sign', [this], function(err) { - if (err) done(err); - else executeSend(); - }); - } else { - executeSend(); - } - }); - - add('HTTP_HEADERS', 'httpHeaders', - function HTTP_HEADERS(statusCode, headers, resp, statusMessage) { - resp.httpResponse.statusCode = statusCode; - resp.httpResponse.statusMessage = statusMessage; - resp.httpResponse.headers = headers; - resp.httpResponse.body = AWS.util.buffer.toBuffer(''); - resp.httpResponse.buffers = []; - resp.httpResponse.numBytes = 0; - var dateHeader = headers.date || headers.Date; - var service = resp.request.service; - if (dateHeader) { - var serverTime = Date.parse(dateHeader); - if (service.config.correctClockSkew - && service.isClockSkewed(serverTime)) { - service.applyClockOffset(serverTime); + return map; + } else if (type === 'L') { + list = []; + for (i = 0; i < values.length; i++) { + list.push(convertOutput(values[i], options)); } - } - }); - - add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) { - if (chunk) { - if (AWS.util.isNode()) { - resp.httpResponse.numBytes += chunk.length; - - var total = resp.httpResponse.headers['content-length']; - var progress = { loaded: resp.httpResponse.numBytes, total: total }; - resp.request.emit('httpDownloadProgress', [progress, resp]); + return list; + } else if (type === 'SS') { + list = []; + for (i = 0; i < values.length; i++) { + list.push(values[i] + ''); } - - resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk)); - } - }); - - add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) { - // convert buffers array into single buffer - if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) { - var body = AWS.util.buffer.concat(resp.httpResponse.buffers); - resp.httpResponse.body = body; - } - delete resp.httpResponse.numBytes; - delete resp.httpResponse.buffers; - }); - - add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) { - if (resp.httpResponse.statusCode) { - resp.error.statusCode = resp.httpResponse.statusCode; - if (resp.error.retryable === undefined) { - resp.error.retryable = this.service.retryableError(resp.error, this); + return new DynamoDBSet(list); + } else if (type === 'NS') { + list = []; + for (i = 0; i < values.length; i++) { + list.push(convertNumber(values[i], options.wrapNumbers)); } + return new DynamoDBSet(list); + } else if (type === 'BS') { + list = []; + for (i = 0; i < values.length; i++) { + list.push(AWS.util.buffer.toBuffer(values[i])); + } + return new DynamoDBSet(list); + } else if (type === 'S') { + return values + ''; + } else if (type === 'N') { + return convertNumber(values, options.wrapNumbers); + } else if (type === 'B') { + return util.buffer.toBuffer(values); + } else if (type === 'BOOL') { + return (values === 'true' || values === 'TRUE' || values === true); + } else if (type === 'NULL') { + return null; } - }); + } + }, - add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) { - if (!resp.error) return; - switch (resp.error.code) { - case 'RequestExpired': // EC2 only - case 'ExpiredTokenException': - case 'ExpiredToken': - resp.error.retryable = true; - resp.request.service.config.credentials.expired = true; - } - }); + /** + * Convert a DynamoDB record into a JavaScript object. + * + * @param data [any] The DynamoDB record + * @param options [map] + * @option options convertEmptyValues [Boolean] Whether to automatically + * convert empty strings, blobs, + * and sets to `null` + * @option options wrapNumbers [Boolean] Whether to return numbers as a + * NumberValue object instead of + * converting them to native JavaScript + * numbers. This allows for the safe + * round-trip transport of numbers of + * arbitrary size. + * + * @return [map] An object whose properties have been converted from + * DynamoDB's AttributeValue format into their corresponding native + * JavaScript types. + * + * @example Convert a record received from a DynamoDB stream + * var unmarshalled = AWS.DynamoDB.Converter.unmarshall({ + * string: {S: 'foo'}, + * list: {L: [{S: 'fizz'}, {S: 'buzz'}, {S: 'pop'}]}, + * map: { + * M: { + * nestedMap: { + * M: { + * key: {S: 'value'} + * } + * } + * } + * }, + * number: {N: '123'}, + * nullValue: {NULL: true}, + * boolValue: {BOOL: true} + * }); + */ + unmarshall: function unmarshall(data, options) { + return AWS.DynamoDB.Converter.output({M: data}, options); + } +}; - add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) { - var err = resp.error; - if (!err) return; - if (typeof err.code === 'string' && typeof err.message === 'string') { - if (err.code.match(/Signature/) && err.message.match(/expired/)) { - resp.error.retryable = true; - } - } - }); +/** + * @api private + * @param data [Array] + * @param options [map] + */ +function formatList(data, options) { + var list = {L: []}; + for (var i = 0; i < data.length; i++) { + list['L'].push(AWS.DynamoDB.Converter.input(data[i], options)); + } + return list; +} - add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) { - if (!resp.error) return; - if (this.service.clockSkewError(resp.error) - && this.service.config.correctClockSkew) { - resp.error.retryable = true; - } - }); +/** + * @api private + * @param value [String] + * @param wrapNumbers [Boolean] + */ +function convertNumber(value, wrapNumbers) { + return wrapNumbers ? new NumberValue(value) : Number(value); +} - add('REDIRECT', 'retry', function REDIRECT(resp) { - if (resp.error && resp.error.statusCode >= 300 && - resp.error.statusCode < 400 && resp.httpResponse.headers['location']) { - this.httpRequest.endpoint = - new AWS.Endpoint(resp.httpResponse.headers['location']); - this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host; - resp.error.redirect = true; - resp.error.retryable = true; - } - }); +/** + * @api private + * @param data [map] + * @param options [map] + */ +function formatMap(data, options) { + var map = {M: {}}; + for (var key in data) { + var formatted = AWS.DynamoDB.Converter.input(data[key], options); + if (formatted !== void 0) { + map['M'][key] = formatted; + } + } + return map; +} - add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) { - if (resp.error) { - if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { - resp.error.retryDelay = 0; - } else if (resp.retryCount < resp.maxRetries) { - resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0; - } - } - }); +/** + * @api private + */ +function formatSet(data, options) { + options = options || {}; + var values = data.values; + if (options.convertEmptyValues) { + values = filterEmptySetValues(data); + if (values.length === 0) { + return AWS.DynamoDB.Converter.input(null); + } + } - addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) { - var delay, willRetry = false; + var map = {}; + switch (data.type) { + case 'String': map['SS'] = values; break; + case 'Binary': map['BS'] = values; break; + case 'Number': map['NS'] = values.map(function (value) { + return value.toString(); + }); + } + return map; +} - if (resp.error) { - delay = resp.error.retryDelay || 0; - if (resp.error.retryable && resp.retryCount < resp.maxRetries) { - resp.retryCount++; - willRetry = true; - } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { - resp.redirectCount++; - willRetry = true; +/** + * @api private + */ +function filterEmptySetValues(set) { + var nonEmptyValues = []; + var potentiallyEmptyTypes = { + String: true, + Binary: true, + Number: false + }; + if (potentiallyEmptyTypes[set.type]) { + for (var i = 0; i < set.values.length; i++) { + if (set.values[i].length === 0) { + continue; + } + nonEmptyValues.push(set.values[i]); } - } - // delay < 0 is a signal from customBackoff to skip retries - if (willRetry && delay >= 0) { - resp.error = null; - setTimeout(done, delay); - } else { - done(); - } - }); - }), + return nonEmptyValues; + } - CorePost: new SequentialExecutor().addNamedListeners(function(add) { - add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId); - add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId); + return set.values; +} - add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) { - function isDNSError(err) { - return err.errno === 'ENOTFOUND' || - typeof err.errno === 'number' && - typeof AWS.util.getSystemErrorName === 'function' && - ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0); - } - if (err.code === 'NetworkingError' && isDNSError(err)) { - var message = 'Inaccessible host: `' + err.hostname + '\' at port `' + err.port + - '\'. This service may not be available in the `' + err.region + - '\' region.'; - this.response.error = AWS.util.error(new Error(message), { - code: 'UnknownEndpoint', - region: err.region, - hostname: err.hostname, - retryable: true, - originalError: err - }); - } - }); - }), +/** + * @api private + */ +module.exports = AWS.DynamoDB.Converter; - Logger: new SequentialExecutor().addNamedListeners(function(add) { - add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) { - var req = resp.request; - var logger = req.service.config.logger; - if (!logger) return; - function filterSensitiveLog(inputShape, shape) { - if (!shape) { - return shape; - } - if (inputShape.isSensitive) { - return '***SensitiveInformation***'; - } - switch (inputShape.type) { - case 'structure': - var struct = {}; - AWS.util.each(shape, function(subShapeName, subShape) { - if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) { - struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape); - } else { - struct[subShapeName] = subShape; - } - }); - return struct; - case 'list': - var list = []; - AWS.util.arrayEach(shape, function(subShape, index) { - list.push(filterSensitiveLog(inputShape.member, subShape)); - }); - return list; - case 'map': - var map = {}; - AWS.util.each(shape, function(key, value) { - map[key] = filterSensitiveLog(inputShape.value, value); - }); - return map; - default: - return shape; - } - } - function buildMessage() { - var time = resp.request.service.getSkewCorrectedDate().getTime(); - var delta = (time - req.startTime.getTime()) / 1000; - var ansi = logger.isTTY ? true : false; - var status = resp.httpResponse.statusCode; - var censoredParams = req.params; - if ( - req.service.api.operations && - req.service.api.operations[req.operation] && - req.service.api.operations[req.operation].input - ) { - var inputShape = req.service.api.operations[req.operation].input; - censoredParams = filterSensitiveLog(inputShape, req.params); - } - var params = (__nccwpck_require__(73837).inspect)(censoredParams, true, null); - var message = ''; - if (ansi) message += '\x1B[33m'; - message += '[AWS ' + req.service.serviceIdentifier + ' ' + status; - message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]'; - if (ansi) message += '\x1B[0;1m'; - message += ' ' + AWS.util.string.lowerFirst(req.operation); - message += '(' + params + ')'; - if (ansi) message += '\x1B[0m'; - return message; - } +/***/ }), - var line = buildMessage(); - if (typeof logger.log === 'function') { - logger.log(line); - } else if (typeof logger.write === 'function') { - logger.write(line + '\n'); - } - }); - }), +/***/ 90030: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - Json: new SequentialExecutor().addNamedListeners(function(add) { - var svc = __nccwpck_require__(30083); - add('BUILD', 'build', svc.buildRequest); - add('EXTRACT_DATA', 'extractData', svc.extractData); - add('EXTRACT_ERROR', 'extractError', svc.extractError); - }), +var AWS = __nccwpck_require__(28437); +var Translator = __nccwpck_require__(34222); +var DynamoDBSet = __nccwpck_require__(20304); - Rest: new SequentialExecutor().addNamedListeners(function(add) { - var svc = __nccwpck_require__(98200); - add('BUILD', 'build', svc.buildRequest); - add('EXTRACT_DATA', 'extractData', svc.extractData); - add('EXTRACT_ERROR', 'extractError', svc.extractError); - }), +/** + * The document client simplifies working with items in Amazon DynamoDB + * by abstracting away the notion of attribute values. This abstraction + * annotates native JavaScript types supplied as input parameters, as well + * as converts annotated response data to native JavaScript types. + * + * ## Marshalling Input and Unmarshalling Response Data + * + * The document client affords developers the use of native JavaScript types + * instead of `AttributeValue`s to simplify the JavaScript development + * experience with Amazon DynamoDB. JavaScript objects passed in as parameters + * are marshalled into `AttributeValue` shapes required by Amazon DynamoDB. + * Responses from DynamoDB are unmarshalled into plain JavaScript objects + * by the `DocumentClient`. The `DocumentClient`, does not accept + * `AttributeValue`s in favor of native JavaScript types. + * + * | JavaScript Type | DynamoDB AttributeValue | + * |:----------------------------------------------------------------------:|-------------------------| + * | String | S | + * | Number | N | + * | Boolean | BOOL | + * | null | NULL | + * | Array | L | + * | Object | M | + * | Buffer, File, Blob, ArrayBuffer, DataView, and JavaScript typed arrays | B | + * + * ## Support for Sets + * + * The `DocumentClient` offers a convenient way to create sets from + * JavaScript Arrays. The type of set is inferred from the first element + * in the array. DynamoDB supports string, number, and binary sets. To + * learn more about supported types see the + * [Amazon DynamoDB Data Model Documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) + * For more information see {AWS.DynamoDB.DocumentClient.createSet} + * + */ +AWS.DynamoDB.DocumentClient = AWS.util.inherit({ - RestJson: new SequentialExecutor().addNamedListeners(function(add) { - var svc = __nccwpck_require__(5883); - add('BUILD', 'build', svc.buildRequest); - add('EXTRACT_DATA', 'extractData', svc.extractData); - add('EXTRACT_ERROR', 'extractError', svc.extractError); - add('UNSET_CONTENT_LENGTH', 'afterBuild', svc.unsetContentLength); - }), + /** + * Creates a DynamoDB document client with a set of configuration options. + * + * @option options params [map] An optional map of parameters to bind to every + * request sent by this service object. + * @option options service [AWS.DynamoDB] An optional pre-configured instance + * of the AWS.DynamoDB service object. This instance's config will be + * copied to a new instance used by this client. You should not need to + * retain a reference to the input object, and may destroy it or allow it + * to be garbage collected. + * @option options convertEmptyValues [Boolean] set to true if you would like + * the document client to convert empty values (0-length strings, binary + * buffers, and sets) to be converted to NULL types when persisting to + * DynamoDB. + * @option options wrapNumbers [Boolean] Set to true to return numbers as a + * NumberValue object instead of converting them to native JavaScript numbers. + * This allows for the safe round-trip transport of numbers of arbitrary size. + * @see AWS.DynamoDB.constructor + * + */ + constructor: function DocumentClient(options) { + var self = this; + self.options = options || {}; + self.configure(self.options); + }, - RestXml: new SequentialExecutor().addNamedListeners(function(add) { - var svc = __nccwpck_require__(15143); - add('BUILD', 'build', svc.buildRequest); - add('EXTRACT_DATA', 'extractData', svc.extractData); - add('EXTRACT_ERROR', 'extractError', svc.extractError); - }), + /** + * @api private + */ + configure: function configure(options) { + var self = this; + self.service = options.service; + self.bindServiceObject(options); + self.attrValue = options.attrValue = + self.service.api.operations.putItem.input.members.Item.value.shape; + }, - Query: new SequentialExecutor().addNamedListeners(function(add) { - var svc = __nccwpck_require__(90761); - add('BUILD', 'build', svc.buildRequest); - add('EXTRACT_DATA', 'extractData', svc.extractData); - add('EXTRACT_ERROR', 'extractError', svc.extractError); - }) -}; + /** + * @api private + */ + bindServiceObject: function bindServiceObject(options) { + var self = this; + options = options || {}; + if (!self.service) { + self.service = new AWS.DynamoDB(options); + } else { + var config = AWS.util.copy(self.service.config); + self.service = new self.service.constructor.__super__(config); + self.service.config.params = + AWS.util.merge(self.service.config.params || {}, options.params); + } + }, -/***/ }), + /** + * @api private + */ + makeServiceRequest: function(operation, params, callback) { + var self = this; + var request = self.service[operation](params); + self.setupRequest(request); + self.setupResponse(request); + if (typeof callback === 'function') { + request.send(callback); + } + return request; + }, -/***/ 1556: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * @api private + */ + serviceClientOperationsMap: { + batchGet: 'batchGetItem', + batchWrite: 'batchWriteItem', + delete: 'deleteItem', + get: 'getItem', + put: 'putItem', + query: 'query', + scan: 'scan', + update: 'updateItem', + transactGet: 'transactGetItems', + transactWrite: 'transactWriteItems' + }, -var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; + /** + * Returns the attributes of one or more items from one or more tables + * by delegating to `AWS.DynamoDB.batchGetItem()`. + * + * Supply the same parameters as {AWS.DynamoDB.batchGetItem} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.batchGetItem + * @example Get items from multiple tables + * var params = { + * RequestItems: { + * 'Table-1': { + * Keys: [ + * { + * HashKey: 'haskey', + * NumberRangeKey: 1 + * } + * ] + * }, + * 'Table-2': { + * Keys: [ + * { foo: 'bar' }, + * ] + * } + * } + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.batchGet(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + batchGet: function(params, callback) { + var operation = this.serviceClientOperationsMap['batchGet']; + return this.makeServiceRequest(operation, params, callback); + }, -/** - * The endpoint that a service will talk to, for example, - * `'https://ec2.ap-southeast-1.amazonaws.com'`. If - * you need to override an endpoint for a service, you can - * set the endpoint on a service by passing the endpoint - * object with the `endpoint` option key: - * - * ```javascript - * var ep = new AWS.Endpoint('awsproxy.example.com'); - * var s3 = new AWS.S3({endpoint: ep}); - * s3.service.endpoint.hostname == 'awsproxy.example.com' - * ``` - * - * Note that if you do not specify a protocol, the protocol will - * be selected based on your current {AWS.config} configuration. - * - * @!attribute protocol - * @return [String] the protocol (http or https) of the endpoint - * URL - * @!attribute hostname - * @return [String] the host portion of the endpoint, e.g., - * example.com - * @!attribute host - * @return [String] the host portion of the endpoint including - * the port, e.g., example.com:80 - * @!attribute port - * @return [Integer] the port of the endpoint - * @!attribute href - * @return [String] the full URL of the endpoint - */ -AWS.Endpoint = inherit({ + /** + * Puts or deletes multiple items in one or more tables by delegating + * to `AWS.DynamoDB.batchWriteItem()`. + * + * Supply the same parameters as {AWS.DynamoDB.batchWriteItem} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.batchWriteItem + * @example Write to and delete from a table + * var params = { + * RequestItems: { + * 'Table-1': [ + * { + * DeleteRequest: { + * Key: { HashKey: 'someKey' } + * } + * }, + * { + * PutRequest: { + * Item: { + * HashKey: 'anotherKey', + * NumAttribute: 1, + * BoolAttribute: true, + * ListAttribute: [1, 'two', false], + * MapAttribute: { foo: 'bar' } + * } + * } + * } + * ] + * } + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.batchWrite(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + batchWrite: function(params, callback) { + var operation = this.serviceClientOperationsMap['batchWrite']; + return this.makeServiceRequest(operation, params, callback); + }, /** - * @overload Endpoint(endpoint) - * Constructs a new endpoint given an endpoint URL. If the - * URL omits a protocol (http or https), the default protocol - * set in the global {AWS.config} will be used. - * @param endpoint [String] the URL to construct an endpoint from + * Deletes a single item in a table by primary key by delegating to + * `AWS.DynamoDB.deleteItem()` + * + * Supply the same parameters as {AWS.DynamoDB.deleteItem} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.deleteItem + * @example Delete an item from a table + * var params = { + * TableName : 'Table', + * Key: { + * HashKey: 'hashkey', + * NumberRangeKey: 1 + * } + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.delete(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * */ - constructor: function Endpoint(endpoint, config) { - AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']); + delete: function(params, callback) { + var operation = this.serviceClientOperationsMap['delete']; + return this.makeServiceRequest(operation, params, callback); + }, - if (typeof endpoint === 'undefined' || endpoint === null) { - throw new Error('Invalid endpoint: ' + endpoint); - } else if (typeof endpoint !== 'string') { - return AWS.util.copy(endpoint); - } + /** + * Returns a set of attributes for the item with the given primary key + * by delegating to `AWS.DynamoDB.getItem()`. + * + * Supply the same parameters as {AWS.DynamoDB.getItem} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.getItem + * @example Get an item from a table + * var params = { + * TableName : 'Table', + * Key: { + * HashKey: 'hashkey' + * } + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.get(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + get: function(params, callback) { + var operation = this.serviceClientOperationsMap['get']; + return this.makeServiceRequest(operation, params, callback); + }, - if (!endpoint.match(/^http/)) { - var useSSL = config && config.sslEnabled !== undefined ? - config.sslEnabled : AWS.config.sslEnabled; - endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint; - } + /** + * Creates a new item, or replaces an old item with a new item by + * delegating to `AWS.DynamoDB.putItem()`. + * + * Supply the same parameters as {AWS.DynamoDB.putItem} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.putItem + * @example Create a new item in a table + * var params = { + * TableName : 'Table', + * Item: { + * HashKey: 'haskey', + * NumAttribute: 1, + * BoolAttribute: true, + * ListAttribute: [1, 'two', false], + * MapAttribute: { foo: 'bar'}, + * NullAttribute: null + * } + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.put(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + put: function(params, callback) { + var operation = this.serviceClientOperationsMap['put']; + return this.makeServiceRequest(operation, params, callback); + }, - AWS.util.update(this, AWS.util.urlParse(endpoint)); + /** + * Edits an existing item's attributes, or adds a new item to the table if + * it does not already exist by delegating to `AWS.DynamoDB.updateItem()`. + * + * Supply the same parameters as {AWS.DynamoDB.updateItem} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.updateItem + * @example Update an item with expressions + * var params = { + * TableName: 'Table', + * Key: { HashKey : 'hashkey' }, + * UpdateExpression: 'set #a = :x + :y', + * ConditionExpression: '#a < :MAX', + * ExpressionAttributeNames: {'#a' : 'Sum'}, + * ExpressionAttributeValues: { + * ':x' : 20, + * ':y' : 45, + * ':MAX' : 100, + * } + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.update(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + update: function(params, callback) { + var operation = this.serviceClientOperationsMap['update']; + return this.makeServiceRequest(operation, params, callback); + }, - // Ensure the port property is set as an integer - if (this.port) { - this.port = parseInt(this.port, 10); - } else { - this.port = this.protocol === 'https:' ? 443 : 80; - } - } + /** + * Returns one or more items and item attributes by accessing every item + * in a table or a secondary index. + * + * Supply the same parameters as {AWS.DynamoDB.scan} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.scan + * @example Scan the table with a filter expression + * var params = { + * TableName : 'Table', + * FilterExpression : 'Year = :this_year', + * ExpressionAttributeValues : {':this_year' : 2015} + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.scan(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + scan: function(params, callback) { + var operation = this.serviceClientOperationsMap['scan']; + return this.makeServiceRequest(operation, params, callback); + }, -}); + /** + * Directly access items from a table by primary key or a secondary index. + * + * Supply the same parameters as {AWS.DynamoDB.query} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.query + * @example Query an index + * var params = { + * TableName: 'Table', + * IndexName: 'Index', + * KeyConditionExpression: 'HashKey = :hkey and RangeKey > :rkey', + * ExpressionAttributeValues: { + * ':hkey': 'key', + * ':rkey': 2015 + * } + * }; + * + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * documentClient.query(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + query: function(params, callback) { + var operation = this.serviceClientOperationsMap['query']; + return this.makeServiceRequest(operation, params, callback); + }, -/** - * The low level HTTP request object, encapsulating all HTTP header - * and body data sent by a service request. - * - * @!attribute method - * @return [String] the HTTP method of the request - * @!attribute path - * @return [String] the path portion of the URI, e.g., - * "/list/?start=5&num=10" - * @!attribute headers - * @return [map] - * a map of header keys and their respective values - * @!attribute body - * @return [String] the request body payload - * @!attribute endpoint - * @return [AWS.Endpoint] the endpoint for the request - * @!attribute region - * @api private - * @return [String] the region, for signing purposes only. - */ -AWS.HttpRequest = inherit({ + /** + * Synchronous write operation that groups up to 100 action requests. + * + * Supply the same parameters as {AWS.DynamoDB.transactWriteItems} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.transactWriteItems + * @example Get items from multiple tables + * var params = { + * TransactItems: [{ + * Put: { + * TableName : 'Table0', + * Item: { + * HashKey: 'haskey', + * NumAttribute: 1, + * BoolAttribute: true, + * ListAttribute: [1, 'two', false], + * MapAttribute: { foo: 'bar'}, + * NullAttribute: null + * } + * } + * }, { + * Update: { + * TableName: 'Table1', + * Key: { HashKey : 'hashkey' }, + * UpdateExpression: 'set #a = :x + :y', + * ConditionExpression: '#a < :MAX', + * ExpressionAttributeNames: {'#a' : 'Sum'}, + * ExpressionAttributeValues: { + * ':x' : 20, + * ':y' : 45, + * ':MAX' : 100, + * } + * } + * }] + * }; + * + * documentClient.transactWrite(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + */ + transactWrite: function(params, callback) { + var operation = this.serviceClientOperationsMap['transactWrite']; + return this.makeServiceRequest(operation, params, callback); + }, /** - * @api private + * Atomically retrieves multiple items from one or more tables (but not from indexes) + * in a single account and region. + * + * Supply the same parameters as {AWS.DynamoDB.transactGetItems} with + * `AttributeValue`s substituted by native JavaScript types. + * + * @see AWS.DynamoDB.transactGetItems + * @example Get items from multiple tables + * var params = { + * TransactItems: [{ + * Get: { + * TableName : 'Table0', + * Key: { + * HashKey: 'hashkey0' + * } + * } + * }, { + * Get: { + * TableName : 'Table1', + * Key: { + * HashKey: 'hashkey1' + * } + * } + * }] + * }; + * + * documentClient.transactGet(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); */ - constructor: function HttpRequest(endpoint, region) { - endpoint = new AWS.Endpoint(endpoint); - this.method = 'POST'; - this.path = endpoint.path || '/'; - this.headers = {}; - this.body = ''; - this.endpoint = endpoint; - this.region = region; - this._userAgent = ''; - this.setUserAgent(); + transactGet: function(params, callback) { + var operation = this.serviceClientOperationsMap['transactGet']; + return this.makeServiceRequest(operation, params, callback); + }, + + /** + * Creates a set of elements inferring the type of set from + * the type of the first element. Amazon DynamoDB currently supports + * the number sets, string sets, and binary sets. For more information + * about DynamoDB data types see the documentation on the + * [Amazon DynamoDB Data Model](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModel.DataTypes). + * + * @param list [Array] Collection to represent your DynamoDB Set + * @param options [map] + * * **validate** [Boolean] set to true if you want to validate the type + * of each element in the set. Defaults to `false`. + * @example Creating a number set + * var documentClient = new AWS.DynamoDB.DocumentClient(); + * + * var params = { + * Item: { + * hashkey: 'hashkey' + * numbers: documentClient.createSet([1, 2, 3]); + * } + * }; + * + * documentClient.put(params, function(err, data) { + * if (err) console.log(err); + * else console.log(data); + * }); + * + */ + createSet: function(list, options) { + options = options || {}; + return new DynamoDBSet(list, options); }, /** * @api private */ - setUserAgent: function setUserAgent() { - this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent(); - }, - - getUserAgentHeaderName: function getUserAgentHeaderName() { - var prefix = AWS.util.isBrowser() ? 'X-Amz-' : ''; - return prefix + 'User-Agent'; + getTranslator: function() { + return new Translator(this.options); }, /** * @api private */ - appendToUserAgent: function appendToUserAgent(agentPartial) { - if (typeof agentPartial === 'string' && agentPartial) { - this._userAgent += ' ' + agentPartial; - } - this.headers[this.getUserAgentHeaderName()] = this._userAgent; + setupRequest: function setupRequest(request) { + var self = this; + var translator = self.getTranslator(); + var operation = request.operation; + var inputShape = request.service.api.operations[operation].input; + request._events.validate.unshift(function(req) { + req.rawParams = AWS.util.copy(req.params); + req.params = translator.translateInput(req.rawParams, inputShape); + }); }, /** * @api private */ - getUserAgent: function getUserAgent() { - return this._userAgent; - }, + setupResponse: function setupResponse(request) { + var self = this; + var translator = self.getTranslator(); + var outputShape = self.service.api.operations[request.operation].output; + request.on('extractData', function(response) { + response.data = translator.translateOutput(response.data, outputShape); + }); - /** - * @return [String] the part of the {path} excluding the - * query string - */ - pathname: function pathname() { - return this.path.split('?', 1)[0]; - }, + var response = request.response; + response.nextPage = function(cb) { + var resp = this; + var req = resp.request; + var config; + var service = req.service; + var operation = req.operation; + try { + config = service.paginationConfig(operation, true); + } catch (e) { resp.error = e; } - /** - * @return [String] the query string portion of the {path} - */ - search: function search() { - var query = this.path.split('?', 2)[1]; - if (query) { - query = AWS.util.queryStringParse(query); - return AWS.util.queryParamsToString(query); - } - return ''; - }, + if (!resp.hasNextPage()) { + if (cb) cb(resp.error, null); + else if (resp.error) throw resp.error; + return null; + } - /** - * @api private - * update httpRequest endpoint with endpoint string - */ - updateEndpoint: function updateEndpoint(endpointStr) { - var newEndpoint = new AWS.Endpoint(endpointStr); - this.endpoint = newEndpoint; - this.path = newEndpoint.path || '/'; - if (this.headers['Host']) { - this.headers['Host'] = newEndpoint.host; - } + var params = AWS.util.copy(req.rawParams); + if (!resp.nextPageTokens) { + return cb ? cb(null, null) : null; + } else { + var inputTokens = config.inputToken; + if (typeof inputTokens === 'string') inputTokens = [inputTokens]; + for (var i = 0; i < inputTokens.length; i++) { + params[inputTokens[i]] = resp.nextPageTokens[i]; + } + return self[operation](params, cb); + } + }; } + }); /** - * The low level HTTP response object, encapsulating all HTTP header - * and body data returned from the request. + * @api private + */ +module.exports = AWS.DynamoDB.DocumentClient; + + +/***/ }), + +/***/ 91593: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var util = (__nccwpck_require__(28437).util); + +/** + * An object recognizable as a numeric value that stores the underlying number + * as a string. * - * @!attribute statusCode - * @return [Integer] the HTTP status code of the response (e.g., 200, 404) - * @!attribute headers - * @return [map] - * a map of response header keys and their respective values - * @!attribute body - * @return [String] the response body payload - * @!attribute [r] streaming - * @return [Boolean] whether this response is being streamed at a low-level. - * Defaults to `false` (buffered reads). Do not modify this manually, use - * {createUnbufferedStream} to convert the stream to unbuffered mode - * instead. + * Intended to be a deserialization target for the DynamoDB Document Client when + * the `wrapNumbers` flag is set. This allows for numeric values that lose + * precision when converted to JavaScript's `number` type. */ -AWS.HttpResponse = inherit({ +var DynamoDBNumberValue = util.inherit({ + constructor: function NumberValue(value) { + this.wrapperName = 'NumberValue'; + this.value = value.toString(); + }, /** - * @api private + * Render the underlying value as a number when converting to JSON. */ - constructor: function HttpResponse() { - this.statusCode = undefined; - this.headers = {}; - this.body = undefined; - this.streaming = false; - this.stream = null; + toJSON: function () { + return this.toNumber(); }, /** - * Disables buffering on the HTTP response and returns the stream for reading. - * @return [Stream, XMLHttpRequest, null] the underlying stream object. - * Use this object to directly read data off of the stream. - * @note This object is only available after the {AWS.Request~httpHeaders} - * event has fired. This method must be called prior to - * {AWS.Request~httpData}. - * @example Taking control of a stream - * request.on('httpHeaders', function(statusCode, headers) { - * if (statusCode < 300) { - * if (headers.etag === 'xyz') { - * // pipe the stream, disabling buffering - * var stream = this.response.httpResponse.createUnbufferedStream(); - * stream.pipe(process.stdout); - * } else { // abort this request and set a better error message - * this.abort(); - * this.response.error = new Error('Invalid ETag'); - * } - * } - * }).send(console.log); + * Convert the underlying value to a JavaScript number. */ - createUnbufferedStream: function createUnbufferedStream() { - this.streaming = true; - return this.stream; + toNumber: function () { + return Number(this.value); + }, + + /** + * Return a string representing the unaltered value provided to the + * constructor. + */ + toString: function () { + return this.value; } }); - -AWS.HttpClient = inherit({}); - /** * @api private */ -AWS.HttpClient.getInstance = function getInstance() { - if (this.singleton === undefined) { - this.singleton = new this(); - } - return this.singleton; -}; +module.exports = DynamoDBNumberValue; /***/ }), -/***/ 2310: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 20304: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var AWS = __nccwpck_require__(28437); -var Stream = AWS.util.stream.Stream; -var TransformStream = AWS.util.stream.Transform; -var ReadableStream = AWS.util.stream.Readable; -__nccwpck_require__(1556); -var CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED'; +var util = (__nccwpck_require__(28437).util); +var typeOf = (__nccwpck_require__(48084).typeOf); /** * @api private */ -AWS.NodeHttpClient = AWS.util.inherit({ - handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) { - var self = this; - var endpoint = httpRequest.endpoint; - var pathPrefix = ''; - if (!httpOptions) httpOptions = {}; - if (httpOptions.proxy) { - pathPrefix = endpoint.protocol + '//' + endpoint.hostname; - if (endpoint.port !== 80 && endpoint.port !== 443) { - pathPrefix += ':' + endpoint.port; - } - endpoint = new AWS.Endpoint(httpOptions.proxy); - } - - var useSSL = endpoint.protocol === 'https:'; - var http = useSSL ? __nccwpck_require__(95687) : __nccwpck_require__(13685); - var options = { - host: endpoint.hostname, - port: endpoint.port, - method: httpRequest.method, - headers: httpRequest.headers, - path: pathPrefix + httpRequest.path - }; - - AWS.util.update(options, httpOptions); - - if (!httpOptions.agent) { - options.agent = this.getAgent(useSSL, { - keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false - }); - } - - delete options.proxy; // proxy isn't an HTTP option - delete options.timeout; // timeout isn't an HTTP option - - var stream = http.request(options, function (httpResp) { - if (stream.didCallback) return; - - callback(httpResp); - httpResp.emit( - 'headers', - httpResp.statusCode, - httpResp.headers, - httpResp.statusMessage - ); - }); - httpRequest.stream = stream; // attach stream to httpRequest - stream.didCallback = false; - - // connection timeout support - if (httpOptions.connectTimeout) { - var connectTimeoutId; - stream.on('socket', function(socket) { - if (socket.connecting) { - connectTimeoutId = setTimeout(function connectTimeout() { - if (stream.didCallback) return; stream.didCallback = true; - - stream.abort(); - errCallback(AWS.util.error( - new Error('Socket timed out without establishing a connection'), - {code: 'TimeoutError'} - )); - }, httpOptions.connectTimeout); - socket.on('connect', function() { - clearTimeout(connectTimeoutId); - connectTimeoutId = null; - }); - } - }); - } - - // timeout support - stream.setTimeout(httpOptions.timeout || 0, function() { - if (stream.didCallback) return; stream.didCallback = true; +var memberTypeToSetType = { + 'String': 'String', + 'Number': 'Number', + 'NumberValue': 'Number', + 'Binary': 'Binary' +}; - var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms'; - errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'})); - stream.abort(); - }); +/** + * @api private + */ +var DynamoDBSet = util.inherit({ - stream.on('error', function(err) { - if (connectTimeoutId) { - clearTimeout(connectTimeoutId); - connectTimeoutId = null; - } - if (stream.didCallback) return; stream.didCallback = true; - if ('ECONNRESET' === err.code || 'EPIPE' === err.code || 'ETIMEDOUT' === err.code) { - errCallback(AWS.util.error(err, {code: 'TimeoutError'})); - } else { - errCallback(err); - } - }); + constructor: function Set(list, options) { + options = options || {}; + this.wrapperName = 'Set'; + this.initialize(list, options.validate); + }, - var expect = httpRequest.headers.Expect || httpRequest.headers.expect; - if (expect === '100-continue') { - stream.once('continue', function() { - self.writeBody(stream, httpRequest); - }); - } else { - this.writeBody(stream, httpRequest); + initialize: function(list, validate) { + var self = this; + self.values = [].concat(list); + self.detectType(); + if (validate) { + self.validate(); } - - return stream; }, - writeBody: function writeBody(stream, httpRequest) { - var body = httpRequest.body; - var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10); - - if (body instanceof Stream) { - // For progress support of streaming content - - // pipe the data through a transform stream to emit 'sendProgress' events - var progressStream = this.progressStream(stream, totalBytes); - if (progressStream) { - body.pipe(progressStream).pipe(stream); - } else { - body.pipe(stream); - } - } else if (body) { - // The provided body is a buffer/string and is already fully available in memory - - // For performance it's best to send it as a whole by calling stream.end(body), - // Callers expect a 'sendProgress' event which is best emitted once - // the http request stream has been fully written and all data flushed. - // The use of totalBytes is important over body.length for strings where - // length is char length and not byte length. - stream.once('finish', function() { - stream.emit('sendProgress', { - loaded: totalBytes, - total: totalBytes - }); + detectType: function() { + this.type = memberTypeToSetType[typeOf(this.values[0])]; + if (!this.type) { + throw util.error(new Error(), { + code: 'InvalidSetType', + message: 'Sets can contain string, number, or binary values' }); - stream.end(body); - } else { - // no request body - stream.end(); } }, - /** - * Create the https.Agent or http.Agent according to the request schema. - */ - getAgent: function getAgent(useSSL, agentOptions) { - var http = useSSL ? __nccwpck_require__(95687) : __nccwpck_require__(13685); - if (useSSL) { - if (!AWS.NodeHttpClient.sslAgent) { - AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({ - rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true - }, agentOptions || {})); - AWS.NodeHttpClient.sslAgent.setMaxListeners(0); - - // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity. - // Users can bypass this default by supplying their own Agent as part of SDK configuration. - Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', { - enumerable: true, - get: function() { - var defaultMaxSockets = 50; - var globalAgent = http.globalAgent; - if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') { - return globalAgent.maxSockets; - } - return defaultMaxSockets; - } + validate: function() { + var self = this; + var length = self.values.length; + var values = self.values; + for (var i = 0; i < length; i++) { + if (memberTypeToSetType[typeOf(values[i])] !== self.type) { + throw util.error(new Error(), { + code: 'InvalidType', + message: self.type + ' Set contains ' + typeOf(values[i]) + ' value' }); } - return AWS.NodeHttpClient.sslAgent; - } else { - if (!AWS.NodeHttpClient.agent) { - AWS.NodeHttpClient.agent = new http.Agent(agentOptions); - } - return AWS.NodeHttpClient.agent; } }, - progressStream: function progressStream(stream, totalBytes) { - if (typeof TransformStream === 'undefined') { - // for node 0.8 there is no streaming progress - return; - } - var loadedBytes = 0; - var reporter = new TransformStream(); - reporter._transform = function(chunk, encoding, callback) { - if (chunk) { - loadedBytes += chunk.length; - stream.emit('sendProgress', { - loaded: loadedBytes, - total: totalBytes - }); - } - callback(null, chunk); - }; - return reporter; - }, + /** + * Render the underlying values only when converting to JSON. + */ + toJSON: function() { + var self = this; + return self.values; + } - emitter: null }); -/** - * @!ignore - */ - -/** - * @api private - */ -AWS.HttpClient.prototype = AWS.NodeHttpClient.prototype; - /** * @api private */ -AWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1; +module.exports = DynamoDBSet; /***/ }), -/***/ 47495: +/***/ 34222: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __nccwpck_require__(77985); - -function JsonBuilder() { } - -JsonBuilder.prototype.build = function(value, shape) { - return JSON.stringify(translate(value, shape)); -}; - -function translate(value, shape) { - if (!shape || value === undefined || value === null) return undefined; - - switch (shape.type) { - case 'structure': return translateStructure(value, shape); - case 'map': return translateMap(value, shape); - case 'list': return translateList(value, shape); - default: return translateScalar(value, shape); - } -} - -function translateStructure(structure, shape) { - if (shape.isDocument) { - return structure; - } - var struct = {}; - util.each(structure, function(name, value) { - var memberShape = shape.members[name]; - if (memberShape) { - if (memberShape.location !== 'body') return; - var locationName = memberShape.isLocationName ? memberShape.name : name; - var result = translate(value, memberShape); - if (result !== undefined) struct[locationName] = result; - } - }); - return struct; -} - -function translateList(list, shape) { - var out = []; - util.arrayEach(list, function(value) { - var result = translate(value, shape.member); - if (result !== undefined) out.push(result); - }); - return out; -} - -function translateMap(map, shape) { - var out = {}; - util.each(map, function(key, value) { - var result = translate(value, shape.value); - if (result !== undefined) out[key] = result; - }); - return out; -} - -function translateScalar(value, shape) { - return shape.toWireFormat(value); -} - -/** - * @api private - */ -module.exports = JsonBuilder; - - -/***/ }), - -/***/ 5474: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var util = (__nccwpck_require__(28437).util); +var convert = __nccwpck_require__(76663); -var util = __nccwpck_require__(77985); +var Translator = function(options) { + options = options || {}; + this.attrValue = options.attrValue; + this.convertEmptyValues = Boolean(options.convertEmptyValues); + this.wrapNumbers = Boolean(options.wrapNumbers); +}; -function JsonParser() { } +Translator.prototype.translateInput = function(value, shape) { + this.mode = 'input'; + return this.translate(value, shape); +}; -JsonParser.prototype.parse = function(value, shape) { - return translate(JSON.parse(value), shape); +Translator.prototype.translateOutput = function(value, shape) { + this.mode = 'output'; + return this.translate(value, shape); }; -function translate(value, shape) { +Translator.prototype.translate = function(value, shape) { + var self = this; if (!shape || value === undefined) return undefined; + if (shape.shape === self.attrValue) { + return convert[self.mode](value, { + convertEmptyValues: self.convertEmptyValues, + wrapNumbers: self.wrapNumbers, + }); + } switch (shape.type) { - case 'structure': return translateStructure(value, shape); - case 'map': return translateMap(value, shape); - case 'list': return translateList(value, shape); - default: return translateScalar(value, shape); + case 'structure': return self.translateStructure(value, shape); + case 'map': return self.translateMap(value, shape); + case 'list': return self.translateList(value, shape); + default: return self.translateScalar(value, shape); } -} +}; -function translateStructure(structure, shape) { +Translator.prototype.translateStructure = function(structure, shape) { + var self = this; if (structure == null) return undefined; - if (shape.isDocument) return structure; var struct = {}; - var shapeMembers = shape.members; - var isAwsQueryCompatible = shape.api && shape.api.awsQueryCompatible; - util.each(shapeMembers, function(name, memberShape) { - var locationName = memberShape.isLocationName ? memberShape.name : name; - if (Object.prototype.hasOwnProperty.call(structure, locationName)) { - var value = structure[locationName]; - var result = translate(value, memberShape); + util.each(structure, function(name, value) { + var memberShape = shape.members[name]; + if (memberShape) { + var result = self.translate(value, memberShape); if (result !== undefined) struct[name] = result; - } else if (isAwsQueryCompatible && memberShape.defaultValue) { - if (memberShape.type === 'list') { - struct[name] = typeof memberShape.defaultValue === 'function' ? memberShape.defaultValue() : memberShape.defaultValue; - } } }); return struct; -} +}; -function translateList(list, shape) { +Translator.prototype.translateList = function(list, shape) { + var self = this; if (list == null) return undefined; var out = []; util.arrayEach(list, function(value) { - var result = translate(value, shape.member); + var result = self.translate(value, shape.member); if (result === undefined) out.push(null); else out.push(result); }); return out; -} +}; -function translateMap(map, shape) { +Translator.prototype.translateMap = function(map, shape) { + var self = this; if (map == null) return undefined; var out = {}; util.each(map, function(key, value) { - var result = translate(value, shape.value); + var result = self.translate(value, shape.value); if (result === undefined) out[key] = null; else out[key] = result; }); return out; -} +}; -function translateScalar(value, shape) { +Translator.prototype.translateScalar = function(value, shape) { return shape.toType(value); -} +}; /** * @api private */ -module.exports = JsonParser; +module.exports = Translator; /***/ }), -/***/ 93985: -/***/ ((module) => { - -var warning = [ - 'We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.\n', - 'Please migrate your code to use AWS SDK for JavaScript (v3).', - 'For more information, check the migration guide at https://a.co/7PzMCcy' -].join('\n'); - -module.exports = { - suppress: false -}; +/***/ 48084: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * To suppress this message: - * @example - * require('aws-sdk/lib/maintenance_mode_message').suppress = true; - */ -function emitWarning() { - if (typeof process === 'undefined') - return; +var util = (__nccwpck_require__(28437).util); - // Skip maintenance mode message in Lambda environments - if ( - typeof process.env === 'object' && - typeof process.env.AWS_EXECUTION_ENV !== 'undefined' && - process.env.AWS_EXECUTION_ENV.indexOf('AWS_Lambda_') === 0 - ) { - return; +function typeOf(data) { + if (data === null && typeof data === 'object') { + return 'null'; + } else if (data !== undefined && isBinary(data)) { + return 'Binary'; + } else if (data !== undefined && data.constructor) { + return data.wrapperName || util.typeName(data.constructor); + } else if (data !== undefined && typeof data === 'object') { + // this object is the result of Object.create(null), hence the absence of a + // defined constructor + return 'Object'; + } else { + return 'undefined'; } +} - if ( - typeof process.env === 'object' && - typeof process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE !== 'undefined' - ) { - return; +function isBinary(data) { + var types = [ + 'Buffer', 'File', 'Blob', 'ArrayBuffer', 'DataView', + 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', + 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', + 'Float32Array', 'Float64Array' + ]; + if (util.isNode()) { + var Stream = util.stream.Stream; + if (util.Buffer.isBuffer(data) || data instanceof Stream) { + return true; + } } - if (typeof process.emitWarning === 'function') { - process.emitWarning(warning, { - type: 'NOTE' - }); + for (var i = 0; i < types.length; i++) { + if (data !== undefined && data.constructor) { + if (util.isType(data, types[i])) return true; + if (util.typeName(data.constructor) === types[i]) return true; + } } + + return false; } -setTimeout(function () { - if (!module.exports.suppress) { - emitWarning(); - } -}, 0); +/** + * @api private + */ +module.exports = { + typeOf: typeOf, + isBinary: isBinary +}; /***/ }), -/***/ 25768: +/***/ 63727: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var AWS = __nccwpck_require__(28437); -__nccwpck_require__(1556); -var inherit = AWS.util.inherit; -var getMetadataServiceEndpoint = __nccwpck_require__(608); -var URL = (__nccwpck_require__(57310).URL); - -/** - * Represents a metadata service available on EC2 instances. Using the - * {request} method, you can receieve metadata about any available resource - * on the metadata service. - * - * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED - * environment variable to a truthy value. - * - * @!attribute [r] httpOptions - * @return [map] a map of options to pass to the underlying HTTP request: - * - * * **timeout** (Number) — a timeout value in milliseconds to wait - * before aborting the connection. Set to 0 for no timeout. - * - * @!macro nobrowser - */ -AWS.MetadataService = inherit({ - /** - * @return [String] the endpoint of the instance metadata service - */ - endpoint: getMetadataServiceEndpoint(), - - /** - * @!ignore - */ +var eventMessageChunker = (__nccwpck_require__(73630).eventMessageChunker); +var parseEvent = (__nccwpck_require__(52123).parseEvent); - /** - * Default HTTP options. By default, the metadata service is set to not - * timeout on long requests. This means that on non-EC2 machines, this - * request will never return. If you are calling this operation from an - * environment that may not always run on EC2, set a `timeout` value so - * the SDK will abort the request after a given number of milliseconds. - */ - httpOptions: { timeout: 0 }, +function createEventStream(body, parser, model) { + var eventMessages = eventMessageChunker(body); - /** - * when enabled, metadata service will not fetch token - */ - disableFetchToken: false, + var events = []; - /** - * Creates a new MetadataService object with a given set of options. - * - * @option options host [String] the hostname of the instance metadata - * service - * @option options httpOptions [map] a map of options to pass to the - * underlying HTTP request: - * - * * **timeout** (Number) — a timeout value in milliseconds to wait - * before aborting the connection. Set to 0 for no timeout. - * @option options maxRetries [Integer] the maximum number of retries to - * perform for timeout errors - * @option options retryDelayOptions [map] A set of options to configure the - * retry delay on retryable errors. See AWS.Config for details. - * @option options ec2MetadataV1Disabled [boolean] Whether to block IMDS v1 fallback. - * @option options profile [string] A profile to check for IMDSv1 fallback settings. - * @option options filename [string] Optional filename for the config file. - */ - constructor: function MetadataService(options) { - if (options && options.host) { - options.endpoint = 'http://' + options.host; - delete options.host; + for (var i = 0; i < eventMessages.length; i++) { + events.push(parseEvent(parser, eventMessages[i], model)); } - this.profile = options && options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; - this.ec2MetadataV1Disabled = !!(options && options.ec2MetadataV1Disabled); - this.filename = options && options.filename; - AWS.util.update(this, options); - }, - /** - * Sends a request to the instance metadata service for a given resource. - * - * @param path [String] the path of the resource to get - * - * @param options [map] an optional map used to make request - * - * * **method** (String) — HTTP request method - * - * * **headers** (map) — a map of response header keys and their respective values - * - * @callback callback function(err, data) - * Called when a response is available from the service. - * @param err [Error, null] if an error occurred, this value will be set - * @param data [String, null] if the request was successful, the body of - * the response - */ - request: function request(path, options, callback) { - if (arguments.length === 2) { - callback = options; - options = {}; - } + return events; +} - if (process.env[AWS.util.imdsDisabledEnv]) { - callback(new Error('EC2 Instance Metadata Service access disabled')); - return; - } +/** + * @api private + */ +module.exports = { + createEventStream: createEventStream +}; - path = path || '/'; - // Verify that host is a valid URL - if (URL) { new URL(this.endpoint); } +/***/ }), - var httpRequest = new AWS.HttpRequest(this.endpoint + path); - httpRequest.method = options.method || 'GET'; - if (options.headers) { - httpRequest.headers = options.headers; - } - AWS.util.handleRequestWithRetries(httpRequest, this, callback); - }, +/***/ 18518: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - */ - loadCredentialsCallbacks: [], +var util = (__nccwpck_require__(28437).util); +var Transform = (__nccwpck_require__(12781).Transform); +var allocBuffer = util.buffer.alloc; - /** - * Fetches metadata token used for getting credentials - * - * @api private - * @callback callback function(err, token) - * Called when token is loaded from the resource - */ - fetchMetadataToken: function fetchMetadataToken(callback) { - var self = this; - var tokenFetchPath = '/latest/api/token'; - self.request( - tokenFetchPath, - { - 'method': 'PUT', - 'headers': { - 'x-aws-ec2-metadata-token-ttl-seconds': '21600' - } - }, - callback - ); - }, +/** @type {Transform} */ +function EventMessageChunkerStream(options) { + Transform.call(this, options); - /** - * Fetches credentials - * - * @api private - * @callback cb function(err, creds) - * Called when credentials are loaded from the resource - */ - fetchCredentials: function fetchCredentials(options, cb) { - var self = this; - var basePath = '/latest/meta-data/iam/security-credentials/'; + this.currentMessageTotalLength = 0; + this.currentMessagePendingLength = 0; + /** @type {Buffer} */ + this.currentMessage = null; - var isImdsV1Fallback = self.disableFetchToken - || !(options && options.headers && options.headers['x-aws-ec2-metadata-token']); + /** @type {Buffer} */ + this.messageLengthBuffer = null; +} - if (isImdsV1Fallback && !(process.env.AWS_EC2_METADATA_DISABLED)) { - try { - var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader, this.filename); - var profileSettings = profiles[this.profile] || {}; - } catch (e) { - profileSettings = {}; - } +EventMessageChunkerStream.prototype = Object.create(Transform.prototype); - if (profileSettings.ec2_metadata_v1_disabled && profileSettings.ec2_metadata_v1_disabled !== 'false') { - return cb(AWS.util.error( - new Error('AWS EC2 Metadata v1 fallback has been blocked by AWS config file profile.') - )); - } +/** + * + * @param {Buffer} chunk + * @param {string} encoding + * @param {*} callback + */ +EventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) { + var chunkLength = chunk.length; + var currentOffset = 0; - if (self.ec2MetadataV1Disabled) { - return cb(AWS.util.error( - new Error('AWS EC2 Metadata v1 fallback has been blocked by AWS.MetadataService::options.ec2MetadataV1Disabled=true.') - )); - } + while (currentOffset < chunkLength) { + // create new message if necessary + if (!this.currentMessage) { + // working on a new message, determine total length + var bytesRemaining = chunkLength - currentOffset; + // prevent edge case where total length spans 2 chunks + if (!this.messageLengthBuffer) { + this.messageLengthBuffer = allocBuffer(4); + } + var numBytesForTotal = Math.min( + 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer + bytesRemaining // bytes left in chunk + ); - if (process.env.AWS_EC2_METADATA_V1_DISABLED && process.env.AWS_EC2_METADATA_V1_DISABLED !== 'false') { - return cb(AWS.util.error( - new Error('AWS EC2 Metadata v1 fallback has been blocked by process.env.AWS_EC2_METADATA_V1_DISABLED.') - )); - } - } + chunk.copy( + this.messageLengthBuffer, + this.currentMessagePendingLength, + currentOffset, + currentOffset + numBytesForTotal + ); - self.request(basePath, options, function (err, roleName) { - if (err) { - self.disableFetchToken = !(err.statusCode === 401); - cb(AWS.util.error( - err, - { - message: 'EC2 Metadata roleName request returned error' - } - )); - return; - } - roleName = roleName.split('\n')[0]; // grab first (and only) role - self.request(basePath + roleName, options, function (credErr, credData) { - if (credErr) { - self.disableFetchToken = !(credErr.statusCode === 401); - cb(AWS.util.error( - credErr, - { - message: 'EC2 Metadata creds request returned error' + this.currentMessagePendingLength += numBytesForTotal; + currentOffset += numBytesForTotal; + + if (this.currentMessagePendingLength < 4) { + // not enough information to create the current message + break; } - )); - return; - } - try { - var credentials = JSON.parse(credData); - cb(null, credentials); - } catch (parseError) { - cb(parseError); + this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)); + this.messageLengthBuffer = null; } - }); - }); - }, - /** - * Loads a set of credentials stored in the instance metadata service - * - * @api private - * @callback callback function(err, credentials) - * Called when credentials are loaded from the resource - * @param err [Error] if an error occurred, this value will be set - * @param credentials [Object] the raw JSON object containing all - * metadata from the credentials resource - */ - loadCredentials: function loadCredentials(callback) { - var self = this; - self.loadCredentialsCallbacks.push(callback); - if (self.loadCredentialsCallbacks.length > 1) { return; } + // write data into current message + var numBytesToWrite = Math.min( + this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message + chunkLength - currentOffset // number of bytes left in the original chunk + ); + chunk.copy( + this.currentMessage, // target buffer + this.currentMessagePendingLength, // target offset + currentOffset, // chunk offset + currentOffset + numBytesToWrite // chunk end to write + ); + this.currentMessagePendingLength += numBytesToWrite; + currentOffset += numBytesToWrite; - function callbacks(err, creds) { - var cb; - while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) { - cb(err, creds); - } + // check if a message is ready to be pushed + if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) { + // push out the message + this.push(this.currentMessage); + // cleanup + this.currentMessage = null; + this.currentMessageTotalLength = 0; + this.currentMessagePendingLength = 0; + } } - if (self.disableFetchToken) { - self.fetchCredentials({}, callbacks); - } else { - self.fetchMetadataToken(function(tokenError, token) { - if (tokenError) { - if (tokenError.code === 'TimeoutError') { - self.disableFetchToken = true; - } else if (tokenError.retryable === true) { - callbacks(AWS.util.error( - tokenError, - { - message: 'EC2 Metadata token request returned error' - } - )); - return; - } else if (tokenError.statusCode === 400) { - callbacks(AWS.util.error( - tokenError, - { - message: 'EC2 Metadata token request returned 400' - } - )); - return; - } - } - var options = {}; - if (token) { - options.headers = { - 'x-aws-ec2-metadata-token': token - }; + callback(); +}; + +EventMessageChunkerStream.prototype._flush = function(callback) { + if (this.currentMessageTotalLength) { + if (this.currentMessageTotalLength === this.currentMessagePendingLength) { + callback(null, this.currentMessage); + } else { + callback(new Error('Truncated event message received.')); } - self.fetchCredentials(options, callbacks); - }); + } else { + callback(); + } +}; +/** + * @param {number} size Size of the message to be allocated. + * @api private + */ +EventMessageChunkerStream.prototype.allocateMessage = function(size) { + if (typeof size !== 'number') { + throw new Error('Attempted to allocate an event message where size was not a number: ' + size); } - } -}); + this.currentMessageTotalLength = size; + this.currentMessagePendingLength = 4; + this.currentMessage = allocBuffer(size); + this.currentMessage.writeUInt32BE(size, 0); +}; /** * @api private */ -module.exports = AWS.MetadataService; - - -/***/ }), - -/***/ 83205: -/***/ ((module) => { - -var getEndpoint = function() { - return { - IPv4: 'http://169.254.169.254', - IPv6: 'http://[fd00:ec2::254]', - }; +module.exports = { + EventMessageChunkerStream: EventMessageChunkerStream }; -module.exports = getEndpoint; - /***/ }), -/***/ 95578: +/***/ 73630: /***/ ((module) => { -var ENV_ENDPOINT_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT'; -var CONFIG_ENDPOINT_NAME = 'ec2_metadata_service_endpoint'; - -var getEndpointConfigOptions = function() { - return { - environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_NAME]; }, - configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_NAME]; }, - default: undefined, - }; -}; +/** + * Takes in a buffer of event messages and splits them into individual messages. + * @param {Buffer} buffer + * @api private + */ +function eventMessageChunker(buffer) { + /** @type Buffer[] */ + var messages = []; + var offset = 0; -module.exports = getEndpointConfigOptions; + while (offset < buffer.length) { + var totalLength = buffer.readInt32BE(offset); + // create new buffer for individual message (shares memory with original) + var message = buffer.slice(offset, totalLength + offset); + // increment offset to it starts at the next message + offset += totalLength; -/***/ }), + messages.push(message); + } -/***/ 37997: -/***/ ((module) => { + return messages; +} -var getEndpointMode = function() { - return { - IPv4: 'IPv4', - IPv6: 'IPv6', - }; +/** + * @api private + */ +module.exports = { + eventMessageChunker: eventMessageChunker }; -module.exports = getEndpointMode; - /***/ }), -/***/ 45509: +/***/ 93773: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var EndpointMode = __nccwpck_require__(37997)(); +var Transform = (__nccwpck_require__(12781).Transform); +var parseEvent = (__nccwpck_require__(52123).parseEvent); -var ENV_ENDPOINT_MODE_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE'; -var CONFIG_ENDPOINT_MODE_NAME = 'ec2_metadata_service_endpoint_mode'; +/** @type {Transform} */ +function EventUnmarshallerStream(options) { + options = options || {}; + // set output to object mode + options.readableObjectMode = true; + Transform.call(this, options); + this._readableState.objectMode = true; -var getEndpointModeConfigOptions = function() { - return { - environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_MODE_NAME]; }, - configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_MODE_NAME]; }, - default: EndpointMode.IPv4, - }; + this.parser = options.parser; + this.eventStreamModel = options.eventStreamModel; +} + +EventUnmarshallerStream.prototype = Object.create(Transform.prototype); + +/** + * + * @param {Buffer} chunk + * @param {string} encoding + * @param {*} callback + */ +EventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) { + try { + var event = parseEvent(this.parser, chunk, this.eventStreamModel); + this.push(event); + return callback(); + } catch (err) { + callback(err); + } }; -module.exports = getEndpointModeConfigOptions; +/** + * @api private + */ +module.exports = { + EventUnmarshallerStream: EventUnmarshallerStream +}; /***/ }), -/***/ 608: +/***/ 48583: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var AWS = __nccwpck_require__(28437); +var util = (__nccwpck_require__(28437).util); +var toBuffer = util.buffer.toBuffer; -var Endpoint = __nccwpck_require__(83205)(); -var EndpointMode = __nccwpck_require__(37997)(); +/** + * A lossless representation of a signed, 64-bit integer. Instances of this + * class may be used in arithmetic expressions as if they were numeric + * primitives, but the binary representation will be preserved unchanged as the + * `bytes` property of the object. The bytes should be encoded as big-endian, + * two's complement integers. + * @param {Buffer} bytes + * + * @api private + */ +function Int64(bytes) { + if (bytes.length !== 8) { + throw new Error('Int64 buffers must be exactly 8 bytes'); + } + if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes); -var ENDPOINT_CONFIG_OPTIONS = __nccwpck_require__(95578)(); -var ENDPOINT_MODE_CONFIG_OPTIONS = __nccwpck_require__(45509)(); + this.bytes = bytes; +} -var getMetadataServiceEndpoint = function() { - var endpoint = AWS.util.loadConfig(ENDPOINT_CONFIG_OPTIONS); - if (endpoint !== undefined) return endpoint; +/** + * @param {number} number + * @returns {Int64} + * + * @api private + */ +Int64.fromNumber = function(number) { + if (number > 9223372036854775807 || number < -9223372036854775808) { + throw new Error( + number + ' is too large (or, if negative, too small) to represent as an Int64' + ); + } - var endpointMode = AWS.util.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS); - switch (endpointMode) { - case EndpointMode.IPv4: - return Endpoint.IPv4; - case EndpointMode.IPv6: - return Endpoint.IPv6; - default: - throw new Error('Unsupported endpoint mode: ' + endpointMode); - } -}; + var bytes = new Uint8Array(8); + for ( + var i = 7, remaining = Math.abs(Math.round(number)); + i > -1 && remaining > 0; + i--, remaining /= 256 + ) { + bytes[i] = remaining; + } -module.exports = getMetadataServiceEndpoint; + if (number < 0) { + negate(bytes); + } + return new Int64(bytes); +}; -/***/ }), +/** + * @returns {number} + * + * @api private + */ +Int64.prototype.valueOf = function() { + var bytes = this.bytes.slice(0); + var negative = bytes[0] & 128; + if (negative) { + negate(bytes); + } -/***/ 17657: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1); +}; -var Collection = __nccwpck_require__(71965); -var Operation = __nccwpck_require__(28083); -var Shape = __nccwpck_require__(71349); -var Paginator = __nccwpck_require__(45938); -var ResourceWaiter = __nccwpck_require__(41368); -var metadata = __nccwpck_require__(17752); +Int64.prototype.toString = function() { + return String(this.valueOf()); +}; -var util = __nccwpck_require__(77985); -var property = util.property; -var memoizedProperty = util.memoizedProperty; +/** + * @param {Buffer} bytes + * + * @api private + */ +function negate(bytes) { + for (var i = 0; i < 8; i++) { + bytes[i] ^= 0xFF; + } + for (var i = 7; i > -1; i--) { + bytes[i]++; + if (bytes[i] !== 0) { + break; + } + } +} -function Api(api, options) { - var self = this; - api = api || {}; - options = options || {}; - options.api = this; +/** + * @api private + */ +module.exports = { + Int64: Int64 +}; - api.metadata = api.metadata || {}; - var serviceIdentifier = options.serviceIdentifier; - delete options.serviceIdentifier; +/***/ }), - property(this, 'isApi', true, false); - property(this, 'apiVersion', api.metadata.apiVersion); - property(this, 'endpointPrefix', api.metadata.endpointPrefix); - property(this, 'signingName', api.metadata.signingName); - property(this, 'globalEndpoint', api.metadata.globalEndpoint); - property(this, 'signatureVersion', api.metadata.signatureVersion); - property(this, 'jsonVersion', api.metadata.jsonVersion); - property(this, 'targetPrefix', api.metadata.targetPrefix); - property(this, 'protocol', api.metadata.protocol); - property(this, 'timestampFormat', api.metadata.timestampFormat); - property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace); - property(this, 'abbreviation', api.metadata.serviceAbbreviation); - property(this, 'fullName', api.metadata.serviceFullName); - property(this, 'serviceId', api.metadata.serviceId); - if (serviceIdentifier && metadata[serviceIdentifier]) { - property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false); - } +/***/ 52123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - memoizedProperty(this, 'className', function() { - var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName; - if (!name) return null; +var parseMessage = (__nccwpck_require__(30866).parseMessage); - name = name.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g, ''); - if (name === 'ElasticLoadBalancing') name = 'ELB'; - return name; - }); +/** + * + * @param {*} parser + * @param {Buffer} message + * @param {*} shape + * @api private + */ +function parseEvent(parser, message, shape) { + var parsedMessage = parseMessage(message); - function addEndpointOperation(name, operation) { - if (operation.endpointoperation === true) { - property(self, 'endpointOperation', util.string.lowerFirst(name)); - } - if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) { - property( - self, - 'hasRequiredEndpointDiscovery', - operation.endpointdiscovery.required === true - ); + // check if message is an event or error + var messageType = parsedMessage.headers[':message-type']; + if (messageType) { + if (messageType.value === 'error') { + throw parseError(parsedMessage); + } else if (messageType.value !== 'event') { + // not sure how to parse non-events/non-errors, ignore for now + return; + } } - } - property(this, 'operations', new Collection(api.operations, options, function(name, operation) { - return new Operation(name, operation, options); - }, util.string.lowerFirst, addEndpointOperation)); + // determine event type + var eventType = parsedMessage.headers[':event-type']; + // check that the event type is modeled + var eventModel = shape.members[eventType.value]; + if (!eventModel) { + return; + } - property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) { - return Shape.create(shape, options); - })); + var result = {}; + // check if an event payload exists + var eventPayloadMemberName = eventModel.eventPayloadMemberName; + if (eventPayloadMemberName) { + var payloadShape = eventModel.members[eventPayloadMemberName]; + // if the shape is binary, return the byte array + if (payloadShape.type === 'binary') { + result[eventPayloadMemberName] = parsedMessage.body; + } else { + result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape); + } + } - property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) { - return new Paginator(name, paginator, options); - })); + // read event headers + var eventHeaderNames = eventModel.eventHeaderMemberNames; + for (var i = 0; i < eventHeaderNames.length; i++) { + var name = eventHeaderNames[i]; + if (parsedMessage.headers[name]) { + // parse the header! + result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value); + } + } - property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) { - return new ResourceWaiter(name, waiter, options); - }, util.string.lowerFirst)); + var output = {}; + output[eventType.value] = result; + return output; +} - if (options.documentation) { - property(this, 'documentation', api.documentation); - property(this, 'documentationUrl', api.documentationUrl); - } - property(this, 'awsQueryCompatible', api.metadata.awsQueryCompatible); +function parseError(message) { + var errorCode = message.headers[':error-code']; + var errorMessage = message.headers[':error-message']; + var error = new Error(errorMessage.value || errorMessage); + error.code = error.name = errorCode.value || errorCode; + return error; } /** * @api private */ -module.exports = Api; +module.exports = { + parseEvent: parseEvent +}; /***/ }), -/***/ 71965: +/***/ 30866: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var memoizedProperty = (__nccwpck_require__(77985).memoizedProperty); +var Int64 = (__nccwpck_require__(48583).Int64); -function memoize(name, value, factory, nameTr) { - memoizedProperty(this, nameTr(name), function() { - return factory(name, value); - }); -} +var splitMessage = (__nccwpck_require__(71765).splitMessage); -function Collection(iterable, options, factory, nameTr, callback) { - nameTr = nameTr || String; - var self = this; +var BOOLEAN_TAG = 'boolean'; +var BYTE_TAG = 'byte'; +var SHORT_TAG = 'short'; +var INT_TAG = 'integer'; +var LONG_TAG = 'long'; +var BINARY_TAG = 'binary'; +var STRING_TAG = 'string'; +var TIMESTAMP_TAG = 'timestamp'; +var UUID_TAG = 'uuid'; - for (var id in iterable) { - if (Object.prototype.hasOwnProperty.call(iterable, id)) { - memoize.call(self, id, iterable[id], factory, nameTr); - if (callback) callback(id, iterable[id]); +/** + * @api private + * + * @param {Buffer} headers + */ +function parseHeaders(headers) { + var out = {}; + var position = 0; + while (position < headers.length) { + var nameLength = headers.readUInt8(position++); + var name = headers.slice(position, position + nameLength).toString(); + position += nameLength; + switch (headers.readUInt8(position++)) { + case 0 /* boolTrue */: + out[name] = { + type: BOOLEAN_TAG, + value: true + }; + break; + case 1 /* boolFalse */: + out[name] = { + type: BOOLEAN_TAG, + value: false + }; + break; + case 2 /* byte */: + out[name] = { + type: BYTE_TAG, + value: headers.readInt8(position++) + }; + break; + case 3 /* short */: + out[name] = { + type: SHORT_TAG, + value: headers.readInt16BE(position) + }; + position += 2; + break; + case 4 /* integer */: + out[name] = { + type: INT_TAG, + value: headers.readInt32BE(position) + }; + position += 4; + break; + case 5 /* long */: + out[name] = { + type: LONG_TAG, + value: new Int64(headers.slice(position, position + 8)) + }; + position += 8; + break; + case 6 /* byteArray */: + var binaryLength = headers.readUInt16BE(position); + position += 2; + out[name] = { + type: BINARY_TAG, + value: headers.slice(position, position + binaryLength) + }; + position += binaryLength; + break; + case 7 /* string */: + var stringLength = headers.readUInt16BE(position); + position += 2; + out[name] = { + type: STRING_TAG, + value: headers.slice( + position, + position + stringLength + ).toString() + }; + position += stringLength; + break; + case 8 /* timestamp */: + out[name] = { + type: TIMESTAMP_TAG, + value: new Date( + new Int64(headers.slice(position, position + 8)) + .valueOf() + ) + }; + position += 8; + break; + case 9 /* uuid */: + var uuidChars = headers.slice(position, position + 16) + .toString('hex'); + position += 16; + out[name] = { + type: UUID_TAG, + value: uuidChars.substr(0, 8) + '-' + + uuidChars.substr(8, 4) + '-' + + uuidChars.substr(12, 4) + '-' + + uuidChars.substr(16, 4) + '-' + + uuidChars.substr(20) + }; + break; + default: + throw new Error('Unrecognized header type tag'); + } } - } + return out; +} + +function parseMessage(message) { + var parsed = splitMessage(message); + return { headers: parseHeaders(parsed.headers), body: parsed.body }; } /** * @api private */ -module.exports = Collection; - - -/***/ }), +module.exports = { + parseMessage: parseMessage +}; + + +/***/ }), + +/***/ 71765: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var util = (__nccwpck_require__(28437).util); +var toBuffer = util.buffer.toBuffer; + +// All prelude components are unsigned, 32-bit integers +var PRELUDE_MEMBER_LENGTH = 4; +// The prelude consists of two components +var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; +// Checksums are always CRC32 hashes. +var CHECKSUM_LENGTH = 4; +// Messages must include a full prelude, a prelude checksum, and a message checksum +var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; + +/** + * @api private + * + * @param {Buffer} message + */ +function splitMessage(message) { + if (!util.Buffer.isBuffer(message)) message = toBuffer(message); -/***/ 28083: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (message.length < MINIMUM_MESSAGE_LENGTH) { + throw new Error('Provided message too short to accommodate event stream message overhead'); + } -var Shape = __nccwpck_require__(71349); + if (message.length !== message.readUInt32BE(0)) { + throw new Error('Reported message length does not match received message length'); + } -var util = __nccwpck_require__(77985); -var property = util.property; -var memoizedProperty = util.memoizedProperty; + var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH); -function Operation(name, operation, options) { - var self = this; - options = options || {}; + if ( + expectedPreludeChecksum !== util.crypto.crc32( + message.slice(0, PRELUDE_LENGTH) + ) + ) { + throw new Error( + 'The prelude checksum specified in the message (' + + expectedPreludeChecksum + + ') does not match the calculated CRC32 checksum.' + ); + } - property(this, 'name', operation.name || name); - property(this, 'api', options.api, false); + var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH); - operation.http = operation.http || {}; - property(this, 'endpoint', operation.endpoint); - property(this, 'httpMethod', operation.http.method || 'POST'); - property(this, 'httpPath', operation.http.requestUri || '/'); - property(this, 'authtype', operation.authtype || ''); - property( - this, - 'endpointDiscoveryRequired', - operation.endpointdiscovery ? - (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') : - 'NULL' - ); + if ( + expectedMessageChecksum !== util.crypto.crc32( + message.slice(0, message.length - CHECKSUM_LENGTH) + ) + ) { + throw new Error( + 'The message checksum did not match the expected value of ' + + expectedMessageChecksum + ); + } - // httpChecksum replaces usage of httpChecksumRequired, but some APIs - // (s3control) still uses old trait. - var httpChecksumRequired = operation.httpChecksumRequired - || (operation.httpChecksum && operation.httpChecksum.requestChecksumRequired); - property(this, 'httpChecksumRequired', httpChecksumRequired, false); + var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH; + var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH); - memoizedProperty(this, 'input', function() { - if (!operation.input) { - return new Shape.create({type: 'structure'}, options); - } - return Shape.create(operation.input, options); - }); + return { + headers: message.slice(headersStart, headersEnd), + body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH), + }; +} - memoizedProperty(this, 'output', function() { - if (!operation.output) { - return new Shape.create({type: 'structure'}, options); - } - return Shape.create(operation.output, options); - }); +/** + * @api private + */ +module.exports = { + splitMessage: splitMessage +}; - memoizedProperty(this, 'errors', function() { - var list = []; - if (!operation.errors) return null; - for (var i = 0; i < operation.errors.length; i++) { - list.push(Shape.create(operation.errors[i], options)); - } +/***/ }), - return list; - }); +/***/ 69643: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - memoizedProperty(this, 'paginator', function() { - return options.api.paginators[name]; - }); +/** + * What is necessary to create an event stream in node? + * - http response stream + * - parser + * - event stream model + */ - if (options.documentation) { - property(this, 'documentation', operation.documentation); - property(this, 'documentationUrl', operation.documentationUrl); - } +var EventMessageChunkerStream = (__nccwpck_require__(18518).EventMessageChunkerStream); +var EventUnmarshallerStream = (__nccwpck_require__(93773).EventUnmarshallerStream); - // idempotentMembers only tracks top-level input shapes - memoizedProperty(this, 'idempotentMembers', function() { - var idempotentMembers = []; - var input = self.input; - var members = input.members; - if (!input.members) { - return idempotentMembers; - } - for (var name in members) { - if (!members.hasOwnProperty(name)) { - continue; - } - if (members[name].isIdempotent === true) { - idempotentMembers.push(name); - } - } - return idempotentMembers; - }); +function createEventStream(stream, parser, model) { + var eventStream = new EventUnmarshallerStream({ + parser: parser, + eventStreamModel: model + }); - memoizedProperty(this, 'hasEventOutput', function() { - var output = self.output; - return hasEventStream(output); - }); -} + var eventMessageChunker = new EventMessageChunkerStream(); -function hasEventStream(topLevelShape) { - var members = topLevelShape.members; - var payload = topLevelShape.payload; + stream.pipe( + eventMessageChunker + ).pipe(eventStream); - if (!topLevelShape.members) { - return false; - } + stream.on('error', function(err) { + eventMessageChunker.emit('error', err); + }); - if (payload) { - var payloadMember = members[payload]; - return payloadMember.isEventStream; - } + eventMessageChunker.on('error', function(err) { + eventStream.emit('error', err); + }); - // check if any member is an event stream - for (var name in members) { - if (!members.hasOwnProperty(name)) { - if (members[name].isEventStream === true) { - return true; - } - } - } - return false; + return eventStream; } /** * @api private */ -module.exports = Operation; +module.exports = { + createEventStream: createEventStream +}; /***/ }), -/***/ 45938: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 54995: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -var property = (__nccwpck_require__(77985).property); +var AWS = __nccwpck_require__(28437); +var SequentialExecutor = __nccwpck_require__(55948); +var DISCOVER_ENDPOINT = (__nccwpck_require__(45313).discoverEndpoint); +/** + * The namespace used to register global event listeners for request building + * and sending. + */ +AWS.EventListeners = { + /** + * @!attribute VALIDATE_CREDENTIALS + * A request listener that validates whether the request is being + * sent with credentials. + * Handles the {AWS.Request~validate 'validate' Request event} + * @example Sending a request without validating credentials + * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS; + * request.removeListener('validate', listener); + * @readonly + * @return [Function] + * @!attribute VALIDATE_REGION + * A request listener that validates whether the region is set + * for a request. + * Handles the {AWS.Request~validate 'validate' Request event} + * @example Sending a request without validating region configuration + * var listener = AWS.EventListeners.Core.VALIDATE_REGION; + * request.removeListener('validate', listener); + * @readonly + * @return [Function] + * @!attribute VALIDATE_PARAMETERS + * A request listener that validates input parameters in a request. + * Handles the {AWS.Request~validate 'validate' Request event} + * @example Sending a request without validating parameters + * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS; + * request.removeListener('validate', listener); + * @example Disable parameter validation globally + * AWS.EventListeners.Core.removeListener('validate', + * AWS.EventListeners.Core.VALIDATE_REGION); + * @readonly + * @return [Function] + * @!attribute SEND + * A request listener that initiates the HTTP connection for a + * request being sent. Handles the {AWS.Request~send 'send' Request event} + * @example Replacing the HTTP handler + * var listener = AWS.EventListeners.Core.SEND; + * request.removeListener('send', listener); + * request.on('send', function(response) { + * customHandler.send(response); + * }); + * @return [Function] + * @readonly + * @!attribute HTTP_DATA + * A request listener that reads data from the HTTP connection in order + * to build the response data. + * Handles the {AWS.Request~httpData 'httpData' Request event}. + * Remove this handler if you are overriding the 'httpData' event and + * do not want extra data processing and buffering overhead. + * @example Disabling default data processing + * var listener = AWS.EventListeners.Core.HTTP_DATA; + * request.removeListener('httpData', listener); + * @return [Function] + * @readonly + */ + Core: {} /* doc hack */ +}; -function Paginator(name, paginator) { - property(this, 'inputToken', paginator.input_token); - property(this, 'limitKey', paginator.limit_key); - property(this, 'moreResults', paginator.more_results); - property(this, 'outputToken', paginator.output_token); - property(this, 'resultKey', paginator.result_key); +/** + * @api private + */ +function getOperationAuthtype(req) { + if (!req.service.api.operations) { + return ''; + } + var operation = req.service.api.operations[req.operation]; + return operation ? operation.authtype : ''; } /** * @api private */ -module.exports = Paginator; - - -/***/ }), - -/***/ 41368: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var util = __nccwpck_require__(77985); -var property = util.property; - -function ResourceWaiter(name, waiter, options) { - options = options || {}; - property(this, 'name', name); - property(this, 'api', options.api, false); +function getIdentityType(req) { + var service = req.service; - if (waiter.operation) { - property(this, 'operation', util.string.lowerFirst(waiter.operation)); + if (service.config.signatureVersion) { + return service.config.signatureVersion; } - var self = this; - var keys = [ - 'type', - 'description', - 'delay', - 'maxAttempts', - 'acceptors' - ]; + if (service.api.signatureVersion) { + return service.api.signatureVersion; + } - keys.forEach(function(key) { - var value = waiter[key]; - if (value) { - property(self, key, value); - } - }); + return getOperationAuthtype(req); } -/** - * @api private - */ -module.exports = ResourceWaiter; +AWS.EventListeners = { + Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) { + addAsync( + 'VALIDATE_CREDENTIALS', 'validate', + function VALIDATE_CREDENTIALS(req, done) { + if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none + var identityType = getIdentityType(req); + if (identityType === 'bearer') { + req.service.config.getToken(function(err) { + if (err) { + req.response.error = AWS.util.error(err, {code: 'TokenError'}); + } + done(); + }); + return; + } -/***/ }), + req.service.config.getCredentials(function(err) { + if (err) { + req.response.error = AWS.util.error(err, + { + code: 'CredentialsError', + message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1' + } + ); + } + done(); + }); + }); -/***/ 71349: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) { + if (!req.service.isGlobalEndpoint) { + var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!req.service.config.region) { + req.response.error = AWS.util.error(new Error(), + {code: 'ConfigError', message: 'Missing region in config'}); + } else if (!dnsHostRegex.test(req.service.config.region)) { + req.response.error = AWS.util.error(new Error(), + {code: 'ConfigError', message: 'Invalid region in config'}); + } + } + }); -var Collection = __nccwpck_require__(71965); + add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) { + if (!req.service.api.operations) { + return; + } + var operation = req.service.api.operations[req.operation]; + if (!operation) { + return; + } + var idempotentMembers = operation.idempotentMembers; + if (!idempotentMembers.length) { + return; + } + // creates a copy of params so user's param object isn't mutated + var params = AWS.util.copy(req.params); + for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) { + if (!params[idempotentMembers[i]]) { + // add the member + params[idempotentMembers[i]] = AWS.util.uuid.v4(); + } + } + req.params = params; + }); -var util = __nccwpck_require__(77985); + add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) { + if (!req.service.api.operations) { + return; + } + var rules = req.service.api.operations[req.operation].input; + var validation = req.service.config.paramValidation; + new AWS.ParamValidator(validation).validate(rules, req.params); + }); -function property(obj, name, value) { - if (value !== null && value !== undefined) { - util.property.apply(this, arguments); - } -} + add('COMPUTE_CHECKSUM', 'afterBuild', function COMPUTE_CHECKSUM(req) { + if (!req.service.api.operations) { + return; + } + var operation = req.service.api.operations[req.operation]; + if (!operation) { + return; + } + var body = req.httpRequest.body; + var isNonStreamingPayload = body && (AWS.util.Buffer.isBuffer(body) || typeof body === 'string'); + var headers = req.httpRequest.headers; + if ( + operation.httpChecksumRequired && + req.service.config.computeChecksums && + isNonStreamingPayload && + !headers['Content-MD5'] + ) { + var md5 = AWS.util.crypto.md5(body, 'base64'); + headers['Content-MD5'] = md5; + } + }); -function memoizedProperty(obj, name) { - if (!obj.constructor.prototype[name]) { - util.memoizedProperty.apply(this, arguments); - } -} + addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) { + req.haltHandlersOnError(); + if (!req.service.api.operations) { + return; + } + var operation = req.service.api.operations[req.operation]; + var authtype = operation ? operation.authtype : ''; + if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none + if (req.service.getSignerClass(req) === AWS.Signers.V4) { + var body = req.httpRequest.body || ''; + if (authtype.indexOf('unsigned-body') >= 0) { + req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; + return done(); + } + AWS.util.computeSha256(body, function(err, sha) { + if (err) { + done(err); + } + else { + req.httpRequest.headers['X-Amz-Content-Sha256'] = sha; + done(); + } + }); + } else { + done(); + } + }); -function Shape(shape, options, memberName) { - options = options || {}; + add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) { + var authtype = getOperationAuthtype(req); + var payloadMember = AWS.util.getRequestPayloadShape(req); + if (req.httpRequest.headers['Content-Length'] === undefined) { + try { + var length = AWS.util.string.byteLength(req.httpRequest.body); + req.httpRequest.headers['Content-Length'] = length; + } catch (err) { + if (payloadMember && payloadMember.isStreaming) { + if (payloadMember.requiresLength) { + //streaming payload requires length(s3, glacier) + throw err; + } else if (authtype.indexOf('unsigned-body') >= 0) { + //unbounded streaming payload(lex, mediastore) + req.httpRequest.headers['Transfer-Encoding'] = 'chunked'; + return; + } else { + throw err; + } + } + throw err; + } + } + }); - property(this, 'shape', shape.shape); - property(this, 'api', options.api, false); - property(this, 'type', shape.type); - property(this, 'enum', shape.enum); - property(this, 'min', shape.min); - property(this, 'max', shape.max); - property(this, 'pattern', shape.pattern); - property(this, 'location', shape.location || this.location || 'body'); - property(this, 'name', this.name || shape.xmlName || shape.queryName || - shape.locationName || memberName); - property(this, 'isStreaming', shape.streaming || this.isStreaming || false); - property(this, 'requiresLength', shape.requiresLength, false); - property(this, 'isComposite', shape.isComposite || false); - property(this, 'isShape', true, false); - property(this, 'isQueryName', Boolean(shape.queryName), false); - property(this, 'isLocationName', Boolean(shape.locationName), false); - property(this, 'isIdempotent', shape.idempotencyToken === true); - property(this, 'isJsonValue', shape.jsonvalue === true); - property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true); - property(this, 'isEventStream', Boolean(shape.eventstream), false); - property(this, 'isEvent', Boolean(shape.event), false); - property(this, 'isEventPayload', Boolean(shape.eventpayload), false); - property(this, 'isEventHeader', Boolean(shape.eventheader), false); - property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false); - property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false); - property(this, 'hostLabel', Boolean(shape.hostLabel), false); + add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) { + req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host; + }); - if (options.documentation) { - property(this, 'documentation', shape.documentation); - property(this, 'documentationUrl', shape.documentationUrl); - } + add('SET_TRACE_ID', 'afterBuild', function SET_TRACE_ID(req) { + var traceIdHeaderName = 'X-Amzn-Trace-Id'; + if (AWS.util.isNode() && !Object.hasOwnProperty.call(req.httpRequest.headers, traceIdHeaderName)) { + var ENV_LAMBDA_FUNCTION_NAME = 'AWS_LAMBDA_FUNCTION_NAME'; + var ENV_TRACE_ID = '_X_AMZN_TRACE_ID'; + var functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + var traceId = process.env[ENV_TRACE_ID]; + if ( + typeof functionName === 'string' && + functionName.length > 0 && + typeof traceId === 'string' && + traceId.length > 0 + ) { + req.httpRequest.headers[traceIdHeaderName] = traceId; + } + } + }); - if (shape.xmlAttribute) { - property(this, 'isXmlAttribute', shape.xmlAttribute || false); - } + add('RESTART', 'restart', function RESTART() { + var err = this.response.error; + if (!err || !err.retryable) return; - // type conversion and parsing - property(this, 'defaultValue', null); - this.toWireFormat = function(value) { - if (value === null || value === undefined) return ''; - return value; - }; - this.toType = function(value) { return value; }; -} + this.httpRequest = new AWS.HttpRequest( + this.service.endpoint, + this.service.region + ); -/** - * @api private - */ -Shape.normalizedTypes = { - character: 'string', - double: 'float', - long: 'integer', - short: 'integer', - biginteger: 'integer', - bigdecimal: 'float', - blob: 'binary' -}; + if (this.response.retryCount < this.service.config.maxRetries) { + this.response.retryCount++; + } else { + this.response.error = null; + } + }); -/** - * @api private - */ -Shape.types = { - 'structure': StructureShape, - 'list': ListShape, - 'map': MapShape, - 'boolean': BooleanShape, - 'timestamp': TimestampShape, - 'float': FloatShape, - 'integer': IntegerShape, - 'string': StringShape, - 'base64': Base64Shape, - 'binary': BinaryShape -}; + var addToHead = true; + addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead); -Shape.resolve = function resolve(shape, options) { - if (shape.shape) { - var refShape = options.api.shapes[shape.shape]; - if (!refShape) { - throw new Error('Cannot find shape reference: ' + shape.shape); - } + addAsync('SIGN', 'sign', function SIGN(req, done) { + var service = req.service; + var identityType = getIdentityType(req); + if (!identityType || identityType.length === 0) return done(); // none - return refShape; - } else { - return null; - } -}; + if (identityType === 'bearer') { + service.config.getToken(function (err, token) { + if (err) { + req.response.error = err; + return done(); + } -Shape.create = function create(shape, options, memberName) { - if (shape.isShape) return shape; + try { + var SignerClass = service.getSignerClass(req); + var signer = new SignerClass(req.httpRequest); + signer.addAuthorization(token); + } catch (e) { + req.response.error = e; + } + done(); + }); + } else { + service.config.getCredentials(function (err, credentials) { + if (err) { + req.response.error = err; + return done(); + } - var refShape = Shape.resolve(shape, options); - if (refShape) { - var filteredKeys = Object.keys(shape); - if (!options.documentation) { - filteredKeys = filteredKeys.filter(function(name) { - return !name.match(/documentation/); - }); - } + try { + var date = service.getSkewCorrectedDate(); + var SignerClass = service.getSignerClass(req); + var operations = req.service.api.operations || {}; + var operation = operations[req.operation]; + var signer = new SignerClass(req.httpRequest, + service.getSigningName(req), + { + signatureCache: service.config.signatureCache, + operation: operation, + signatureVersion: service.api.signatureVersion + }); + signer.setServiceClientId(service._clientId); - // create an inline shape with extra members - var InlineShape = function() { - refShape.constructor.call(this, shape, options, memberName); - }; - InlineShape.prototype = refShape; - return new InlineShape(); - } else { - // set type if not set - if (!shape.type) { - if (shape.members) shape.type = 'structure'; - else if (shape.member) shape.type = 'list'; - else if (shape.key) shape.type = 'map'; - else shape.type = 'string'; - } + // clear old authorization headers + delete req.httpRequest.headers['Authorization']; + delete req.httpRequest.headers['Date']; + delete req.httpRequest.headers['X-Amz-Date']; - // normalize types - var origType = shape.type; - if (Shape.normalizedTypes[shape.type]) { - shape.type = Shape.normalizedTypes[shape.type]; - } + // add new authorization + signer.addAuthorization(credentials, date); + req.signedAt = date; + } catch (e) { + req.response.error = e; + } + done(); + }); - if (Shape.types[shape.type]) { - return new Shape.types[shape.type](shape, options, memberName); - } else { - throw new Error('Unrecognized shape type: ' + origType); - } - } -}; + } + }); -function CompositeShape(shape) { - Shape.apply(this, arguments); - property(this, 'isComposite', true); + add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) { + if (this.service.successfulResponse(resp, this)) { + resp.data = {}; + resp.error = null; + } else { + resp.data = null; + resp.error = AWS.util.error(new Error(), + {code: 'UnknownError', message: 'An unknown error occurred.'}); + } + }); - if (shape.flattened) { - property(this, 'flattened', shape.flattened || false); - } -} + add('ERROR', 'error', function ERROR(err, resp) { + var awsQueryCompatible = resp.request.service.api.awsQueryCompatible; + if (awsQueryCompatible) { + var headers = resp.httpResponse.headers; + var queryErrorCode = headers ? headers['x-amzn-query-error'] : undefined; + if (queryErrorCode && queryErrorCode.includes(';')) { + resp.error.code = queryErrorCode.split(';')[0]; + } + } + }, true); -function StructureShape(shape, options) { - var self = this; - var requiredMap = null, firstInit = !this.isShape; + addAsync('SEND', 'send', function SEND(resp, done) { + resp.httpResponse._abortCallback = done; + resp.error = null; + resp.data = null; - CompositeShape.apply(this, arguments); + function callback(httpResp) { + resp.httpResponse.stream = httpResp; + var stream = resp.request.httpRequest.stream; + var service = resp.request.service; + var api = service.api; + var operationName = resp.request.operation; + var operation = api.operations[operationName] || {}; - if (firstInit) { - property(this, 'defaultValue', function() { return {}; }); - property(this, 'members', {}); - property(this, 'memberNames', []); - property(this, 'required', []); - property(this, 'isRequired', function() { return false; }); - property(this, 'isDocument', Boolean(shape.document)); - } + httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) { + resp.request.emit( + 'httpHeaders', + [statusCode, headers, resp, statusMessage] + ); - if (shape.members) { - property(this, 'members', new Collection(shape.members, options, function(name, member) { - return Shape.create(member, options, name); - })); - memoizedProperty(this, 'memberNames', function() { - return shape.xmlOrder || Object.keys(shape.members); - }); + if (!resp.httpResponse.streaming) { + if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check + // if we detect event streams, we're going to have to + // return the stream immediately + if (operation.hasEventOutput && service.successfulResponse(resp)) { + // skip reading the IncomingStream + resp.request.emit('httpDone'); + done(); + return; + } - if (shape.event) { - memoizedProperty(this, 'eventPayloadMemberName', function() { - var members = self.members; - var memberNames = self.memberNames; - // iterate over members to find ones that are event payloads - for (var i = 0, iLen = memberNames.length; i < iLen; i++) { - if (members[memberNames[i]].isEventPayload) { - return memberNames[i]; + httpResp.on('readable', function onReadable() { + var data = httpResp.read(); + if (data !== null) { + resp.request.emit('httpData', [data, resp]); + } + }); + } else { // legacy streams API + httpResp.on('data', function onData(data) { + resp.request.emit('httpData', [data, resp]); + }); + } } - } - }); + }); - memoizedProperty(this, 'eventHeaderMemberNames', function() { - var members = self.members; - var memberNames = self.memberNames; - var eventHeaderMemberNames = []; - // iterate over members to find ones that are event headers - for (var i = 0, iLen = memberNames.length; i < iLen; i++) { - if (members[memberNames[i]].isEventHeader) { - eventHeaderMemberNames.push(memberNames[i]); + httpResp.on('end', function onEnd() { + if (!stream || !stream.didCallback) { + if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) { + // don't concatenate response chunks when streaming event stream data when response is successful + return; + } + resp.request.emit('httpDone'); + done(); } - } - return eventHeaderMemberNames; - }); - } - } - - if (shape.required) { - property(this, 'required', shape.required); - property(this, 'isRequired', function(name) { - if (!requiredMap) { - requiredMap = {}; - for (var i = 0; i < shape.required.length; i++) { - requiredMap[shape.required[i]] = true; - } + }); } - return requiredMap[name]; - }, false, true); - } + function progress(httpResp) { + httpResp.on('sendProgress', function onSendProgress(value) { + resp.request.emit('httpUploadProgress', [value, resp]); + }); - property(this, 'resultWrapper', shape.resultWrapper || null); + httpResp.on('receiveProgress', function onReceiveProgress(value) { + resp.request.emit('httpDownloadProgress', [value, resp]); + }); + } - if (shape.payload) { - property(this, 'payload', shape.payload); - } + function error(err) { + if (err.code !== 'RequestAbortedError') { + var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError'; + err = AWS.util.error(err, { + code: errCode, + region: resp.request.httpRequest.region, + hostname: resp.request.httpRequest.endpoint.hostname, + retryable: true + }); + } + resp.error = err; + resp.request.emit('httpError', [resp.error, resp], function() { + done(); + }); + } - if (typeof shape.xmlNamespace === 'string') { - property(this, 'xmlNamespaceUri', shape.xmlNamespace); - } else if (typeof shape.xmlNamespace === 'object') { - property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix); - property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri); - } -} + function executeSend() { + var http = AWS.HttpClient.getInstance(); + var httpOptions = resp.request.service.config.httpOptions || {}; + try { + var stream = http.handleRequest(resp.request.httpRequest, httpOptions, + callback, error); + progress(stream); + } catch (err) { + error(err); + } + } + var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000; + if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign + this.emit('sign', [this], function(err) { + if (err) done(err); + else executeSend(); + }); + } else { + executeSend(); + } + }); -function ListShape(shape, options) { - var self = this, firstInit = !this.isShape; - CompositeShape.apply(this, arguments); + add('HTTP_HEADERS', 'httpHeaders', + function HTTP_HEADERS(statusCode, headers, resp, statusMessage) { + resp.httpResponse.statusCode = statusCode; + resp.httpResponse.statusMessage = statusMessage; + resp.httpResponse.headers = headers; + resp.httpResponse.body = AWS.util.buffer.toBuffer(''); + resp.httpResponse.buffers = []; + resp.httpResponse.numBytes = 0; + var dateHeader = headers.date || headers.Date; + var service = resp.request.service; + if (dateHeader) { + var serverTime = Date.parse(dateHeader); + if (service.config.correctClockSkew + && service.isClockSkewed(serverTime)) { + service.applyClockOffset(serverTime); + } + } + }); - if (firstInit) { - property(this, 'defaultValue', function() { return []; }); - } + add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) { + if (chunk) { + if (AWS.util.isNode()) { + resp.httpResponse.numBytes += chunk.length; - if (shape.member) { - memoizedProperty(this, 'member', function() { - return Shape.create(shape.member, options); - }); - } + var total = resp.httpResponse.headers['content-length']; + var progress = { loaded: resp.httpResponse.numBytes, total: total }; + resp.request.emit('httpDownloadProgress', [progress, resp]); + } - if (this.flattened) { - var oldName = this.name; - memoizedProperty(this, 'name', function() { - return self.member.name || oldName; + resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk)); + } }); - } -} -function MapShape(shape, options) { - var firstInit = !this.isShape; - CompositeShape.apply(this, arguments); - - if (firstInit) { - property(this, 'defaultValue', function() { return {}; }); - property(this, 'key', Shape.create({type: 'string'}, options)); - property(this, 'value', Shape.create({type: 'string'}, options)); - } + add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) { + // convert buffers array into single buffer + if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) { + var body = AWS.util.buffer.concat(resp.httpResponse.buffers); + resp.httpResponse.body = body; + } + delete resp.httpResponse.numBytes; + delete resp.httpResponse.buffers; + }); - if (shape.key) { - memoizedProperty(this, 'key', function() { - return Shape.create(shape.key, options); + add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) { + if (resp.httpResponse.statusCode) { + resp.error.statusCode = resp.httpResponse.statusCode; + if (resp.error.retryable === undefined) { + resp.error.retryable = this.service.retryableError(resp.error, this); + } + } }); - } - if (shape.value) { - memoizedProperty(this, 'value', function() { - return Shape.create(shape.value, options); + + add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) { + if (!resp.error) return; + switch (resp.error.code) { + case 'RequestExpired': // EC2 only + case 'ExpiredTokenException': + case 'ExpiredToken': + resp.error.retryable = true; + resp.request.service.config.credentials.expired = true; + } }); - } -} -function TimestampShape(shape) { - var self = this; - Shape.apply(this, arguments); + add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) { + var err = resp.error; + if (!err) return; + if (typeof err.code === 'string' && typeof err.message === 'string') { + if (err.code.match(/Signature/) && err.message.match(/expired/)) { + resp.error.retryable = true; + } + } + }); - if (shape.timestampFormat) { - property(this, 'timestampFormat', shape.timestampFormat); - } else if (self.isTimestampFormatSet && this.timestampFormat) { - property(this, 'timestampFormat', this.timestampFormat); - } else if (this.location === 'header') { - property(this, 'timestampFormat', 'rfc822'); - } else if (this.location === 'querystring') { - property(this, 'timestampFormat', 'iso8601'); - } else if (this.api) { - switch (this.api.protocol) { - case 'json': - case 'rest-json': - property(this, 'timestampFormat', 'unixTimestamp'); - break; - case 'rest-xml': - case 'query': - case 'ec2': - property(this, 'timestampFormat', 'iso8601'); - break; - } - } + add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) { + if (!resp.error) return; + if (this.service.clockSkewError(resp.error) + && this.service.config.correctClockSkew) { + resp.error.retryable = true; + } + }); - this.toType = function(value) { - if (value === null || value === undefined) return null; - if (typeof value.toUTCString === 'function') return value; - return typeof value === 'string' || typeof value === 'number' ? - util.date.parseTimestamp(value) : null; - }; + add('REDIRECT', 'retry', function REDIRECT(resp) { + if (resp.error && resp.error.statusCode >= 300 && + resp.error.statusCode < 400 && resp.httpResponse.headers['location']) { + this.httpRequest.endpoint = + new AWS.Endpoint(resp.httpResponse.headers['location']); + this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host; + this.httpRequest.path = this.httpRequest.endpoint.path; + resp.error.redirect = true; + resp.error.retryable = true; + } + }); - this.toWireFormat = function(value) { - return util.date.format(value, self.timestampFormat); - }; -} + add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) { + if (resp.error) { + if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { + resp.error.retryDelay = 0; + } else if (resp.retryCount < resp.maxRetries) { + resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0; + } + } + }); -function StringShape() { - Shape.apply(this, arguments); + addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) { + var delay, willRetry = false; - var nullLessProtocols = ['rest-xml', 'query', 'ec2']; - this.toType = function(value) { - value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ? - value || '' : value; - if (this.isJsonValue) { - return JSON.parse(value); - } + if (resp.error) { + delay = resp.error.retryDelay || 0; + if (resp.error.retryable && resp.retryCount < resp.maxRetries) { + resp.retryCount++; + willRetry = true; + } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { + resp.redirectCount++; + willRetry = true; + } + } - return value && typeof value.toString === 'function' ? - value.toString() : value; - }; + // delay < 0 is a signal from customBackoff to skip retries + if (willRetry && delay >= 0) { + resp.error = null; + setTimeout(done, delay); + } else { + done(); + } + }); + }), - this.toWireFormat = function(value) { - return this.isJsonValue ? JSON.stringify(value) : value; - }; -} + CorePost: new SequentialExecutor().addNamedListeners(function(add) { + add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId); + add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId); -function FloatShape() { - Shape.apply(this, arguments); + add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) { + function isDNSError(err) { + return err.errno === 'ENOTFOUND' || + typeof err.errno === 'number' && + typeof AWS.util.getSystemErrorName === 'function' && + ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0); + } + if (err.code === 'NetworkingError' && isDNSError(err)) { + var message = 'Inaccessible host: `' + err.hostname + '\' at port `' + err.port + + '\'. This service may not be available in the `' + err.region + + '\' region.'; + this.response.error = AWS.util.error(new Error(message), { + code: 'UnknownEndpoint', + region: err.region, + hostname: err.hostname, + retryable: true, + originalError: err + }); + } + }); + }), - this.toType = function(value) { - if (value === null || value === undefined) return null; - return parseFloat(value); - }; - this.toWireFormat = this.toType; -} + Logger: new SequentialExecutor().addNamedListeners(function(add) { + add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) { + var req = resp.request; + var logger = req.service.config.logger; + if (!logger) return; + function filterSensitiveLog(inputShape, shape) { + if (!shape) { + return shape; + } + if (inputShape.isSensitive) { + return '***SensitiveInformation***'; + } + switch (inputShape.type) { + case 'structure': + var struct = {}; + AWS.util.each(shape, function(subShapeName, subShape) { + if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) { + struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape); + } else { + struct[subShapeName] = subShape; + } + }); + return struct; + case 'list': + var list = []; + AWS.util.arrayEach(shape, function(subShape, index) { + list.push(filterSensitiveLog(inputShape.member, subShape)); + }); + return list; + case 'map': + var map = {}; + AWS.util.each(shape, function(key, value) { + map[key] = filterSensitiveLog(inputShape.value, value); + }); + return map; + default: + return shape; + } + } -function IntegerShape() { - Shape.apply(this, arguments); + function buildMessage() { + var time = resp.request.service.getSkewCorrectedDate().getTime(); + var delta = (time - req.startTime.getTime()) / 1000; + var ansi = logger.isTTY ? true : false; + var status = resp.httpResponse.statusCode; + var censoredParams = req.params; + if ( + req.service.api.operations && + req.service.api.operations[req.operation] && + req.service.api.operations[req.operation].input + ) { + var inputShape = req.service.api.operations[req.operation].input; + censoredParams = filterSensitiveLog(inputShape, req.params); + } + var params = (__nccwpck_require__(73837).inspect)(censoredParams, true, null); + var message = ''; + if (ansi) message += '\x1B[33m'; + message += '[AWS ' + req.service.serviceIdentifier + ' ' + status; + message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]'; + if (ansi) message += '\x1B[0;1m'; + message += ' ' + AWS.util.string.lowerFirst(req.operation); + message += '(' + params + ')'; + if (ansi) message += '\x1B[0m'; + return message; + } - this.toType = function(value) { - if (value === null || value === undefined) return null; - return parseInt(value, 10); - }; - this.toWireFormat = this.toType; -} + var line = buildMessage(); + if (typeof logger.log === 'function') { + logger.log(line); + } else if (typeof logger.write === 'function') { + logger.write(line + '\n'); + } + }); + }), -function BinaryShape() { - Shape.apply(this, arguments); - this.toType = function(value) { - var buf = util.base64.decode(value); - if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') { - /* Node.js can create a Buffer that is not isolated. - * i.e. buf.byteLength !== buf.buffer.byteLength - * This means that the sensitive data is accessible to anyone with access to buf.buffer. - * If this is the node shared Buffer, then other code within this process _could_ find this secret. - * Copy sensitive data to an isolated Buffer and zero the sensitive data. - * While this is safe to do here, copying this code somewhere else may produce unexpected results. - */ - var secureBuf = util.Buffer.alloc(buf.length, buf); - buf.fill(0); - buf = secureBuf; - } - return buf; - }; - this.toWireFormat = util.base64.encode; -} + Json: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __nccwpck_require__(30083); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }), -function Base64Shape() { - BinaryShape.apply(this, arguments); -} + Rest: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __nccwpck_require__(98200); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }), -function BooleanShape() { - Shape.apply(this, arguments); + RestJson: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __nccwpck_require__(5883); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + add('UNSET_CONTENT_LENGTH', 'afterBuild', svc.unsetContentLength); + }), - this.toType = function(value) { - if (typeof value === 'boolean') return value; - if (value === null || value === undefined) return null; - return value === 'true'; - }; -} + RestXml: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __nccwpck_require__(15143); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }), -/** - * @api private - */ -Shape.shapes = { - StructureShape: StructureShape, - ListShape: ListShape, - MapShape: MapShape, - StringShape: StringShape, - BooleanShape: BooleanShape, - Base64Shape: Base64Shape + Query: new SequentialExecutor().addNamedListeners(function(add) { + var svc = __nccwpck_require__(90761); + add('BUILD', 'build', svc.buildRequest); + add('EXTRACT_DATA', 'extractData', svc.extractData); + add('EXTRACT_ERROR', 'extractError', svc.extractError); + }) }; -/** - * @api private - */ -module.exports = Shape; - /***/ }), -/***/ 73639: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 1556: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __nccwpck_require__(77985); +var AWS = __nccwpck_require__(28437); +var inherit = AWS.util.inherit; -var region_utils = __nccwpck_require__(99517); -var isFipsRegion = region_utils.isFipsRegion; -var getRealRegion = region_utils.getRealRegion; +/** + * The endpoint that a service will talk to, for example, + * `'https://ec2.ap-southeast-1.amazonaws.com'`. If + * you need to override an endpoint for a service, you can + * set the endpoint on a service by passing the endpoint + * object with the `endpoint` option key: + * + * ```javascript + * var ep = new AWS.Endpoint('awsproxy.example.com'); + * var s3 = new AWS.S3({endpoint: ep}); + * s3.service.endpoint.hostname == 'awsproxy.example.com' + * ``` + * + * Note that if you do not specify a protocol, the protocol will + * be selected based on your current {AWS.config} configuration. + * + * @!attribute protocol + * @return [String] the protocol (http or https) of the endpoint + * URL + * @!attribute hostname + * @return [String] the host portion of the endpoint, e.g., + * example.com + * @!attribute host + * @return [String] the host portion of the endpoint including + * the port, e.g., example.com:80 + * @!attribute port + * @return [Integer] the port of the endpoint + * @!attribute href + * @return [String] the full URL of the endpoint + */ +AWS.Endpoint = inherit({ -util.isBrowser = function() { return false; }; -util.isNode = function() { return true; }; + /** + * @overload Endpoint(endpoint) + * Constructs a new endpoint given an endpoint URL. If the + * URL omits a protocol (http or https), the default protocol + * set in the global {AWS.config} will be used. + * @param endpoint [String] the URL to construct an endpoint from + */ + constructor: function Endpoint(endpoint, config) { + AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']); -// node.js specific modules -util.crypto.lib = __nccwpck_require__(6113); -util.Buffer = (__nccwpck_require__(14300).Buffer); -util.domain = __nccwpck_require__(13639); -util.stream = __nccwpck_require__(12781); -util.url = __nccwpck_require__(57310); -util.querystring = __nccwpck_require__(63477); -util.environment = 'nodejs'; -util.createEventStream = util.stream.Readable ? - (__nccwpck_require__(69643).createEventStream) : (__nccwpck_require__(63727).createEventStream); -util.realClock = __nccwpck_require__(81370); -util.clientSideMonitoring = { - Publisher: (__nccwpck_require__(66807).Publisher), - configProvider: __nccwpck_require__(91822), -}; -util.iniLoader = (__nccwpck_require__(29697)/* .iniLoader */ .b); -util.getSystemErrorName = (__nccwpck_require__(73837).getSystemErrorName); + if (typeof endpoint === 'undefined' || endpoint === null) { + throw new Error('Invalid endpoint: ' + endpoint); + } else if (typeof endpoint !== 'string') { + return AWS.util.copy(endpoint); + } -util.loadConfig = function(options) { - var envValue = options.environmentVariableSelector(process.env); - if (envValue !== undefined) { - return envValue; - } + if (!endpoint.match(/^http/)) { + var useSSL = config && config.sslEnabled !== undefined ? + config.sslEnabled : AWS.config.sslEnabled; + endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint; + } - var configFile = {}; - try { - configFile = util.iniLoader ? util.iniLoader.loadFrom({ - isConfig: true, - filename: process.env[util.sharedConfigFileEnv] - }) : {}; - } catch (e) {} - var sharedFileConfig = configFile[ - process.env.AWS_PROFILE || util.defaultProfile - ] || {}; - var configValue = options.configFileSelector(sharedFileConfig); - if (configValue !== undefined) { - return configValue; - } + AWS.util.update(this, AWS.util.urlParse(endpoint)); - if (typeof options.default === 'function') { - return options.default(); + // Ensure the port property is set as an integer + if (this.port) { + this.port = parseInt(this.port, 10); + } else { + this.port = this.protocol === 'https:' ? 443 : 80; + } } - return options.default; -}; -var AWS; +}); /** - * @api private + * The low level HTTP request object, encapsulating all HTTP header + * and body data sent by a service request. + * + * @!attribute method + * @return [String] the HTTP method of the request + * @!attribute path + * @return [String] the path portion of the URI, e.g., + * "/list/?start=5&num=10" + * @!attribute headers + * @return [map] + * a map of header keys and their respective values + * @!attribute body + * @return [String] the request body payload + * @!attribute endpoint + * @return [AWS.Endpoint] the endpoint for the request + * @!attribute region + * @api private + * @return [String] the region, for signing purposes only. */ -module.exports = AWS = __nccwpck_require__(28437); - -__nccwpck_require__(53819); -__nccwpck_require__(36965); -__nccwpck_require__(77360); -__nccwpck_require__(57083); -__nccwpck_require__(74998); -__nccwpck_require__(3498); -__nccwpck_require__(15037); -__nccwpck_require__(80371); +AWS.HttpRequest = inherit({ -// Load the xml2js XML parser -AWS.XML.Parser = __nccwpck_require__(96752); + /** + * @api private + */ + constructor: function HttpRequest(endpoint, region) { + endpoint = new AWS.Endpoint(endpoint); + this.method = 'POST'; + this.path = endpoint.path || '/'; + this.headers = {}; + this.body = ''; + this.endpoint = endpoint; + this.region = region; + this._userAgent = ''; + this.setUserAgent(); + }, -// Load Node HTTP client -__nccwpck_require__(2310); + /** + * @api private + */ + setUserAgent: function setUserAgent() { + this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent(); + }, -__nccwpck_require__(95417); + getUserAgentHeaderName: function getUserAgentHeaderName() { + var prefix = AWS.util.isBrowser() ? 'X-Amz-' : ''; + return prefix + 'User-Agent'; + }, -// Load custom credential providers -__nccwpck_require__(11017); -__nccwpck_require__(73379); -__nccwpck_require__(88764); -__nccwpck_require__(10645); -__nccwpck_require__(57714); -__nccwpck_require__(27454); -__nccwpck_require__(13754); -__nccwpck_require__(80371); -__nccwpck_require__(68335); + /** + * @api private + */ + appendToUserAgent: function appendToUserAgent(agentPartial) { + if (typeof agentPartial === 'string' && agentPartial) { + this._userAgent += ' ' + agentPartial; + } + this.headers[this.getUserAgentHeaderName()] = this._userAgent; + }, -// Setup default providers for credentials chain -// If this changes, please update documentation for -// AWS.CredentialProviderChain.defaultProviders in -// credentials/credential_provider_chain.js -AWS.CredentialProviderChain.defaultProviders = [ - function () { return new AWS.EnvironmentCredentials('AWS'); }, - function () { return new AWS.EnvironmentCredentials('AMAZON'); }, - function () { return new AWS.SsoCredentials(); }, - function () { return new AWS.SharedIniFileCredentials(); }, - function () { return new AWS.ECSCredentials(); }, - function () { return new AWS.ProcessCredentials(); }, - function () { return new AWS.TokenFileWebIdentityCredentials(); }, - function () { return new AWS.EC2MetadataCredentials(); } -]; + /** + * @api private + */ + getUserAgent: function getUserAgent() { + return this._userAgent; + }, -// Load custom token providers -__nccwpck_require__(82647); -__nccwpck_require__(50126); -__nccwpck_require__(90327); + /** + * @return [String] the part of the {path} excluding the + * query string + */ + pathname: function pathname() { + return this.path.split('?', 1)[0]; + }, -// Setup default providers for token chain -// If this changes, please update documentation for -// AWS.TokenProviderChain.defaultProviders in -// token/token_provider_chain.js -AWS.TokenProviderChain.defaultProviders = [ - function () { return new AWS.SSOTokenProvider(); }, -]; + /** + * @return [String] the query string portion of the {path} + */ + search: function search() { + var query = this.path.split('?', 2)[1]; + if (query) { + query = AWS.util.queryStringParse(query); + return AWS.util.queryParamsToString(query); + } + return ''; + }, -var getRegion = function() { - var env = process.env; - var region = env.AWS_REGION || env.AMAZON_REGION; - if (env[AWS.util.configOptInEnv]) { - var toCheck = [ - {filename: env[AWS.util.sharedCredentialsFileEnv]}, - {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]} - ]; - var iniLoader = AWS.util.iniLoader; - while (!region && toCheck.length) { - var configFile = {}; - var fileInfo = toCheck.shift(); - try { - configFile = iniLoader.loadFrom(fileInfo); - } catch (err) { - if (fileInfo.isConfig) throw err; - } - var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile]; - region = profile && profile.region; + /** + * @api private + * update httpRequest endpoint with endpoint string + */ + updateEndpoint: function updateEndpoint(endpointStr) { + var newEndpoint = new AWS.Endpoint(endpointStr); + this.endpoint = newEndpoint; + this.path = newEndpoint.path || '/'; + if (this.headers['Host']) { + this.headers['Host'] = newEndpoint.host; } } - return region; -}; - -var getBooleanValue = function(value) { - return value === 'true' ? true: value === 'false' ? false: undefined; -}; +}); -var USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: function(env) { - return getBooleanValue(env['AWS_USE_FIPS_ENDPOINT']); - }, - configFileSelector: function(profile) { - return getBooleanValue(profile['use_fips_endpoint']); - }, - default: false, -}; +/** + * The low level HTTP response object, encapsulating all HTTP header + * and body data returned from the request. + * + * @!attribute statusCode + * @return [Integer] the HTTP status code of the response (e.g., 200, 404) + * @!attribute headers + * @return [map] + * a map of response header keys and their respective values + * @!attribute body + * @return [String] the response body payload + * @!attribute [r] streaming + * @return [Boolean] whether this response is being streamed at a low-level. + * Defaults to `false` (buffered reads). Do not modify this manually, use + * {createUnbufferedStream} to convert the stream to unbuffered mode + * instead. + */ +AWS.HttpResponse = inherit({ -var USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: function(env) { - return getBooleanValue(env['AWS_USE_DUALSTACK_ENDPOINT']); - }, - configFileSelector: function(profile) { - return getBooleanValue(profile['use_dualstack_endpoint']); + /** + * @api private + */ + constructor: function HttpResponse() { + this.statusCode = undefined; + this.headers = {}; + this.body = undefined; + this.streaming = false; + this.stream = null; }, - default: false, -}; -// Update configuration keys -AWS.util.update(AWS.Config.prototype.keys, { - credentials: function () { - var credentials = null; - new AWS.CredentialProviderChain([ - function () { return new AWS.EnvironmentCredentials('AWS'); }, - function () { return new AWS.EnvironmentCredentials('AMAZON'); }, - function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); } - ]).resolve(function(err, creds) { - if (!err) credentials = creds; - }); - return credentials; - }, - credentialProvider: function() { - return new AWS.CredentialProviderChain(); - }, - logger: function () { - return process.env.AWSJS_DEBUG ? console : null; - }, - region: function() { - var region = getRegion(); - return region ? getRealRegion(region): undefined; - }, - tokenProvider: function() { - return new AWS.TokenProviderChain(); - }, - useFipsEndpoint: function() { - var region = getRegion(); - return isFipsRegion(region) - ? true - : util.loadConfig(USE_FIPS_ENDPOINT_CONFIG_OPTIONS); - }, - useDualstackEndpoint: function() { - return util.loadConfig(USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS); + /** + * Disables buffering on the HTTP response and returns the stream for reading. + * @return [Stream, XMLHttpRequest, null] the underlying stream object. + * Use this object to directly read data off of the stream. + * @note This object is only available after the {AWS.Request~httpHeaders} + * event has fired. This method must be called prior to + * {AWS.Request~httpData}. + * @example Taking control of a stream + * request.on('httpHeaders', function(statusCode, headers) { + * if (statusCode < 300) { + * if (headers.etag === 'xyz') { + * // pipe the stream, disabling buffering + * var stream = this.response.httpResponse.createUnbufferedStream(); + * stream.pipe(process.stdout); + * } else { // abort this request and set a better error message + * this.abort(); + * this.response.error = new Error('Invalid ETag'); + * } + * } + * }).send(console.log); + */ + createUnbufferedStream: function createUnbufferedStream() { + this.streaming = true; + return this.stream; } }); -// Reset configuration -AWS.config = new AWS.Config(); + +AWS.HttpClient = inherit({}); + +/** + * @api private + */ +AWS.HttpClient.getInstance = function getInstance() { + if (this.singleton === undefined) { + this.singleton = new this(); + } + return this.singleton; +}; /***/ }), -/***/ 99127: +/***/ 2310: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); +var Stream = AWS.util.stream.Stream; +var TransformStream = AWS.util.stream.Transform; +var ReadableStream = AWS.util.stream.Readable; +__nccwpck_require__(1556); +var CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED'; /** * @api private */ -AWS.ParamValidator = AWS.util.inherit({ - /** - * Create a new validator object. - * - * @param validation [Boolean|map] whether input parameters should be - * validated against the operation description before sending the - * request. Pass a map to enable any of the following specific - * validation features: - * - * * **min** [Boolean] — Validates that a value meets the min - * constraint. This is enabled by default when paramValidation is set - * to `true`. - * * **max** [Boolean] — Validates that a value meets the max - * constraint. - * * **pattern** [Boolean] — Validates that a string value matches a - * regular expression. - * * **enum** [Boolean] — Validates that a string value matches one - * of the allowable enum values. - */ - constructor: function ParamValidator(validation) { - if (validation === true || validation === undefined) { - validation = {'min': true}; +AWS.NodeHttpClient = AWS.util.inherit({ + handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) { + var self = this; + var endpoint = httpRequest.endpoint; + var pathPrefix = ''; + if (!httpOptions) httpOptions = {}; + if (httpOptions.proxy) { + pathPrefix = endpoint.protocol + '//' + endpoint.hostname; + if (endpoint.port !== 80 && endpoint.port !== 443) { + pathPrefix += ':' + endpoint.port; + } + endpoint = new AWS.Endpoint(httpOptions.proxy); } - this.validation = validation; - }, - validate: function validate(shape, params, context) { - this.errors = []; - this.validateMember(shape, params || {}, context || 'params'); + var useSSL = endpoint.protocol === 'https:'; + var http = useSSL ? __nccwpck_require__(95687) : __nccwpck_require__(13685); + var options = { + host: endpoint.hostname, + port: endpoint.port, + method: httpRequest.method, + headers: httpRequest.headers, + path: pathPrefix + httpRequest.path + }; - if (this.errors.length > 1) { - var msg = this.errors.join('\n* '); - msg = 'There were ' + this.errors.length + - ' validation errors:\n* ' + msg; - throw AWS.util.error(new Error(msg), - {code: 'MultipleValidationErrors', errors: this.errors}); - } else if (this.errors.length === 1) { - throw this.errors[0]; - } else { - return true; - } - }, + AWS.util.update(options, httpOptions); - fail: function fail(code, message) { - this.errors.push(AWS.util.error(new Error(message), {code: code})); - }, + if (!httpOptions.agent) { + options.agent = this.getAgent(useSSL, { + keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false + }); + } - validateStructure: function validateStructure(shape, params, context) { - if (shape.isDocument) return true; + delete options.proxy; // proxy isn't an HTTP option + delete options.timeout; // timeout isn't an HTTP option - this.validateType(params, context, ['object'], 'structure'); - var paramName; - for (var i = 0; shape.required && i < shape.required.length; i++) { - paramName = shape.required[i]; - var value = params[paramName]; - if (value === undefined || value === null) { - this.fail('MissingRequiredParameter', - 'Missing required key \'' + paramName + '\' in ' + context); - } - } + var stream = http.request(options, function (httpResp) { + if (stream.didCallback) return; - // validate hash members - for (paramName in params) { - if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue; + callback(httpResp); + httpResp.emit( + 'headers', + httpResp.statusCode, + httpResp.headers, + httpResp.statusMessage + ); + }); + httpRequest.stream = stream; // attach stream to httpRequest + stream.didCallback = false; - var paramValue = params[paramName], - memberShape = shape.members[paramName]; + // connection timeout support + if (httpOptions.connectTimeout) { + var connectTimeoutId; + stream.on('socket', function(socket) { + if (socket.connecting) { + connectTimeoutId = setTimeout(function connectTimeout() { + if (stream.didCallback) return; stream.didCallback = true; - if (memberShape !== undefined) { - var memberContext = [context, paramName].join('.'); - this.validateMember(memberShape, paramValue, memberContext); - } else if (paramValue !== undefined && paramValue !== null) { - this.fail('UnexpectedParameter', - 'Unexpected key \'' + paramName + '\' found in ' + context); - } + stream.abort(); + errCallback(AWS.util.error( + new Error('Socket timed out without establishing a connection'), + {code: 'TimeoutError'} + )); + }, httpOptions.connectTimeout); + socket.on('connect', function() { + clearTimeout(connectTimeoutId); + connectTimeoutId = null; + }); + } + }); } - return true; - }, + // timeout support + stream.setTimeout(httpOptions.timeout || 0, function() { + if (stream.didCallback) return; stream.didCallback = true; - validateMember: function validateMember(shape, param, context) { - switch (shape.type) { - case 'structure': - return this.validateStructure(shape, param, context); - case 'list': - return this.validateList(shape, param, context); - case 'map': - return this.validateMap(shape, param, context); - default: - return this.validateScalar(shape, param, context); - } - }, + var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms'; + errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'})); + stream.abort(); + }); - validateList: function validateList(shape, params, context) { - if (this.validateType(params, context, [Array])) { - this.validateRange(shape, params.length, context, 'list member count'); - // validate array members - for (var i = 0; i < params.length; i++) { - this.validateMember(shape.member, params[i], context + '[' + i + ']'); + stream.on('error', function(err) { + if (connectTimeoutId) { + clearTimeout(connectTimeoutId); + connectTimeoutId = null; } - } - }, - - validateMap: function validateMap(shape, params, context) { - if (this.validateType(params, context, ['object'], 'map')) { - // Build up a count of map members to validate range traits. - var mapCount = 0; - for (var param in params) { - if (!Object.prototype.hasOwnProperty.call(params, param)) continue; - // Validate any map key trait constraints - this.validateMember(shape.key, param, - context + '[key=\'' + param + '\']'); - this.validateMember(shape.value, params[param], - context + '[\'' + param + '\']'); - mapCount++; + if (stream.didCallback) return; stream.didCallback = true; + if ('ECONNRESET' === err.code || 'EPIPE' === err.code || 'ETIMEDOUT' === err.code) { + errCallback(AWS.util.error(err, {code: 'TimeoutError'})); + } else { + errCallback(err); } - this.validateRange(shape, mapCount, context, 'map member count'); - } - }, + }); - validateScalar: function validateScalar(shape, value, context) { - switch (shape.type) { - case null: - case undefined: - case 'string': - return this.validateString(shape, value, context); - case 'base64': - case 'binary': - return this.validatePayload(value, context); - case 'integer': - case 'float': - return this.validateNumber(shape, value, context); - case 'boolean': - return this.validateType(value, context, ['boolean']); - case 'timestamp': - return this.validateType(value, context, [Date, - /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'number'], - 'Date object, ISO-8601 string, or a UNIX timestamp'); - default: - return this.fail('UnkownType', 'Unhandled type ' + - shape.type + ' for ' + context); + var expect = httpRequest.headers.Expect || httpRequest.headers.expect; + if (expect === '100-continue') { + stream.once('continue', function() { + self.writeBody(stream, httpRequest); + }); + } else { + this.writeBody(stream, httpRequest); } - }, - validateString: function validateString(shape, value, context) { - var validTypes = ['string']; - if (shape.isJsonValue) { - validTypes = validTypes.concat(['number', 'object', 'boolean']); - } - if (value !== null && this.validateType(value, context, validTypes)) { - this.validateEnum(shape, value, context); - this.validateRange(shape, value.length, context, 'string length'); - this.validatePattern(shape, value, context); - this.validateUri(shape, value, context); - } + return stream; }, - validateUri: function validateUri(shape, value, context) { - if (shape['location'] === 'uri') { - if (value.length === 0) { - this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,' - + ' but found "' + value +'" for ' + context); - } - } - }, + writeBody: function writeBody(stream, httpRequest) { + var body = httpRequest.body; + var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10); - validatePattern: function validatePattern(shape, value, context) { - if (this.validation['pattern'] && shape['pattern'] !== undefined) { - if (!(new RegExp(shape['pattern'])).test(value)) { - this.fail('PatternMatchError', 'Provided value "' + value + '" ' - + 'does not match regex pattern /' + shape['pattern'] + '/ for ' - + context); + if (body instanceof Stream) { + // For progress support of streaming content - + // pipe the data through a transform stream to emit 'sendProgress' events + var progressStream = this.progressStream(stream, totalBytes); + if (progressStream) { + body.pipe(progressStream).pipe(stream); + } else { + body.pipe(stream); } + } else if (body) { + // The provided body is a buffer/string and is already fully available in memory - + // For performance it's best to send it as a whole by calling stream.end(body), + // Callers expect a 'sendProgress' event which is best emitted once + // the http request stream has been fully written and all data flushed. + // The use of totalBytes is important over body.length for strings where + // length is char length and not byte length. + stream.once('finish', function() { + stream.emit('sendProgress', { + loaded: totalBytes, + total: totalBytes + }); + }); + stream.end(body); + } else { + // no request body + stream.end(); } }, - validateRange: function validateRange(shape, value, context, descriptor) { - if (this.validation['min']) { - if (shape['min'] !== undefined && value < shape['min']) { - this.fail('MinRangeError', 'Expected ' + descriptor + ' >= ' - + shape['min'] + ', but found ' + value + ' for ' + context); + /** + * Create the https.Agent or http.Agent according to the request schema. + */ + getAgent: function getAgent(useSSL, agentOptions) { + var http = useSSL ? __nccwpck_require__(95687) : __nccwpck_require__(13685); + if (useSSL) { + if (!AWS.NodeHttpClient.sslAgent) { + AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({ + rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true + }, agentOptions || {})); + AWS.NodeHttpClient.sslAgent.setMaxListeners(0); + + // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity. + // Users can bypass this default by supplying their own Agent as part of SDK configuration. + Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', { + enumerable: true, + get: function() { + var defaultMaxSockets = 50; + var globalAgent = http.globalAgent; + if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') { + return globalAgent.maxSockets; + } + return defaultMaxSockets; + } + }); } - } - if (this.validation['max']) { - if (shape['max'] !== undefined && value > shape['max']) { - this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= ' - + shape['max'] + ', but found ' + value + ' for ' + context); + return AWS.NodeHttpClient.sslAgent; + } else { + if (!AWS.NodeHttpClient.agent) { + AWS.NodeHttpClient.agent = new http.Agent(agentOptions); } + return AWS.NodeHttpClient.agent; } }, - validateEnum: function validateRange(shape, value, context) { - if (this.validation['enum'] && shape['enum'] !== undefined) { - // Fail if the string value is not present in the enum list - if (shape['enum'].indexOf(value) === -1) { - this.fail('EnumError', 'Found string value of ' + value + ', but ' - + 'expected ' + shape['enum'].join('|') + ' for ' + context); - } + progressStream: function progressStream(stream, totalBytes) { + if (typeof TransformStream === 'undefined') { + // for node 0.8 there is no streaming progress + return; } + var loadedBytes = 0; + var reporter = new TransformStream(); + reporter._transform = function(chunk, encoding, callback) { + if (chunk) { + loadedBytes += chunk.length; + stream.emit('sendProgress', { + loaded: loadedBytes, + total: totalBytes + }); + } + callback(null, chunk); + }; + return reporter; }, - validateType: function validateType(value, context, acceptedTypes, type) { - // We will not log an error for null or undefined, but we will return - // false so that callers know that the expected type was not strictly met. - if (value === null || value === undefined) return false; + emitter: null +}); - var foundInvalidType = false; - for (var i = 0; i < acceptedTypes.length; i++) { - if (typeof acceptedTypes[i] === 'string') { - if (typeof value === acceptedTypes[i]) return true; - } else if (acceptedTypes[i] instanceof RegExp) { - if ((value || '').toString().match(acceptedTypes[i])) return true; - } else { - if (value instanceof acceptedTypes[i]) return true; - if (AWS.util.isType(value, acceptedTypes[i])) return true; - if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice(); - acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]); - } - foundInvalidType = true; - } +/** + * @!ignore + */ - var acceptedType = type; - if (!acceptedType) { - acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1'); - } +/** + * @api private + */ +AWS.HttpClient.prototype = AWS.NodeHttpClient.prototype; - var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : ''; - this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' + - vowel + ' ' + acceptedType); - return false; - }, +/** + * @api private + */ +AWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1; - validateNumber: function validateNumber(shape, value, context) { - if (value === null || value === undefined) return; - if (typeof value === 'string') { - var castedValue = parseFloat(value); - if (castedValue.toString() === value) value = castedValue; - } - if (this.validateType(value, context, ['number'])) { - this.validateRange(shape, value, context, 'numeric value'); - } - }, - validatePayload: function validatePayload(value, context) { - if (value === null || value === undefined) return; - if (typeof value === 'string') return; - if (value && typeof value.byteLength === 'number') return; // typed arrays - if (AWS.util.isNode()) { // special check for buffer/stream in Node.js - var Stream = AWS.util.stream.Stream; - if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return; - } else { - if (typeof Blob !== void 0 && value instanceof Blob) return; - } +/***/ }), - var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView']; - if (value) { - for (var i = 0; i < types.length; i++) { - if (AWS.util.isType(value, types[i])) return; - if (AWS.util.typeName(value.constructor) === types[i]) return; - } - } +/***/ 47495: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' + - 'string, Buffer, Stream, Blob, or typed array object'); +var util = __nccwpck_require__(77985); + +function JsonBuilder() { } + +JsonBuilder.prototype.build = function(value, shape) { + return JSON.stringify(translate(value, shape)); +}; + +function translate(value, shape) { + if (!shape || value === undefined || value === null) return undefined; + + switch (shape.type) { + case 'structure': return translateStructure(value, shape); + case 'map': return translateMap(value, shape); + case 'list': return translateList(value, shape); + default: return translateScalar(value, shape); } -}); +} +function translateStructure(structure, shape) { + if (shape.isDocument) { + return structure; + } + var struct = {}; + util.each(structure, function(name, value) { + var memberShape = shape.members[name]; + if (memberShape) { + if (memberShape.location !== 'body') return; + var locationName = memberShape.isLocationName ? memberShape.name : name; + var result = translate(value, memberShape); + if (result !== undefined) struct[locationName] = result; + } + }); + return struct; +} -/***/ }), +function translateList(list, shape) { + var out = []; + util.arrayEach(list, function(value) { + var result = translate(value, shape.member); + if (result !== undefined) out.push(result); + }); + return out; +} -/***/ 44086: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +function translateMap(map, shape) { + var out = {}; + util.each(map, function(key, value) { + var result = translate(value, shape.value); + if (result !== undefined) out[key] = result; + }); + return out; +} -var AWS = __nccwpck_require__(28437); -var rest = AWS.Protocol.Rest; +function translateScalar(value, shape) { + return shape.toWireFormat(value); +} /** - * A presigner object can be used to generate presigned urls for the Polly service. + * @api private */ -AWS.Polly.Presigner = AWS.util.inherit({ - /** - * Creates a presigner object with a set of configuration options. - * - * @option options params [map] An optional map of parameters to bind to every - * request sent by this service object. - * @option options service [AWS.Polly] An optional pre-configured instance - * of the AWS.Polly service object to use for requests. The object may - * bound parameters used by the presigner. - * @see AWS.Polly.constructor - */ - constructor: function Signer(options) { - options = options || {}; - this.options = options; - this.service = options.service; - this.bindServiceObject(options); - this._operations = {}; - }, +module.exports = JsonBuilder; - /** - * @api private - */ - bindServiceObject: function bindServiceObject(options) { - options = options || {}; - if (!this.service) { - this.service = new AWS.Polly(options); - } else { - var config = AWS.util.copy(this.service.config); - this.service = new this.service.constructor.__super__(config); - this.service.config.params = AWS.util.merge(this.service.config.params || {}, options.params); - } - }, - /** - * @api private - */ - modifyInputMembers: function modifyInputMembers(input) { - // make copies of the input so we don't overwrite the api - // need to be careful to copy anything we access/modify - var modifiedInput = AWS.util.copy(input); - modifiedInput.members = AWS.util.copy(input.members); - AWS.util.each(input.members, function(name, member) { - modifiedInput.members[name] = AWS.util.copy(member); - // update location and locationName - if (!member.location || member.location === 'body') { - modifiedInput.members[name].location = 'querystring'; - modifiedInput.members[name].locationName = name; - } - }); - return modifiedInput; - }, +/***/ }), - /** - * @api private - */ - convertPostToGet: function convertPostToGet(req) { - // convert method - req.httpRequest.method = 'GET'; +/***/ 5474: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var operation = req.service.api.operations[req.operation]; - // get cached operation input first - var input = this._operations[req.operation]; - if (!input) { - // modify the original input - this._operations[req.operation] = input = this.modifyInputMembers(operation.input); - } +var util = __nccwpck_require__(77985); - var uri = rest.generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); +function JsonParser() { } - req.httpRequest.path = uri; - req.httpRequest.body = ''; +JsonParser.prototype.parse = function(value, shape) { + return translate(JSON.parse(value), shape); +}; - // don't need these headers on a GET request - delete req.httpRequest.headers['Content-Length']; - delete req.httpRequest.headers['Content-Type']; - }, +function translate(value, shape) { + if (!shape || value === undefined) return undefined; - /** - * @overload getSynthesizeSpeechUrl(params = {}, [expires = 3600], [callback]) - * Generate a presigned url for {AWS.Polly.synthesizeSpeech}. - * @note You must ensure that you have static or previously resolved - * credentials if you call this method synchronously (with no callback), - * otherwise it may not properly sign the request. If you cannot guarantee - * this (you are using an asynchronous credential provider, i.e., EC2 - * IAM roles), you should always call this method with an asynchronous - * callback. - * @param params [map] parameters to pass to the operation. See the {AWS.Polly.synthesizeSpeech} - * operation for the expected operation parameters. - * @param expires [Integer] (3600) the number of seconds to expire the pre-signed URL operation in. - * Defaults to 1 hour. - * @return [string] if called synchronously (with no callback), returns the signed URL. - * @return [null] nothing is returned if a callback is provided. - * @callback callback function (err, url) - * If a callback is supplied, it is called when a signed URL has been generated. - * @param err [Error] the error object returned from the presigner. - * @param url [String] the signed URL. - * @see AWS.Polly.synthesizeSpeech - */ - getSynthesizeSpeechUrl: function getSynthesizeSpeechUrl(params, expires, callback) { - var self = this; - var request = this.service.makeRequest('synthesizeSpeech', params); - // remove existing build listeners - request.removeAllListeners('build'); - request.on('build', function(req) { - self.convertPostToGet(req); - }); - return request.presign(expires, callback); - } -}); + switch (shape.type) { + case 'structure': return translateStructure(value, shape); + case 'map': return translateMap(value, shape); + case 'list': return translateList(value, shape); + default: return translateScalar(value, shape); + } +} +function translateStructure(structure, shape) { + if (structure == null) return undefined; + if (shape.isDocument) return structure; -/***/ }), + var struct = {}; + var shapeMembers = shape.members; + var isAwsQueryCompatible = shape.api && shape.api.awsQueryCompatible; + util.each(shapeMembers, function(name, memberShape) { + var locationName = memberShape.isLocationName ? memberShape.name : name; + if (Object.prototype.hasOwnProperty.call(structure, locationName)) { + var value = structure[locationName]; + var result = translate(value, memberShape); + if (result !== undefined) struct[name] = result; + } else if (isAwsQueryCompatible && memberShape.defaultValue) { + if (memberShape.type === 'list') { + struct[name] = typeof memberShape.defaultValue === 'function' ? memberShape.defaultValue() : memberShape.defaultValue; + } + } + }); + return struct; +} -/***/ 97969: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function translateList(list, shape) { + if (list == null) return undefined; -var util = __nccwpck_require__(77985); -var AWS = __nccwpck_require__(28437); + var out = []; + util.arrayEach(list, function(value) { + var result = translate(value, shape.member); + if (result === undefined) out.push(null); + else out.push(result); + }); + return out; +} -/** - * Prepend prefix defined by API model to endpoint that's already - * constructed. This feature does not apply to operations using - * endpoint discovery and can be disabled. - * @api private - */ -function populateHostPrefix(request) { - var enabled = request.service.config.hostPrefixEnabled; - if (!enabled) return request; - var operationModel = request.service.api.operations[request.operation]; - //don't marshal host prefix when operation has endpoint discovery traits - if (hasEndpointDiscover(request)) return request; - if (operationModel.endpoint && operationModel.endpoint.hostPrefix) { - var hostPrefixNotation = operationModel.endpoint.hostPrefix; - var hostPrefix = expandHostPrefix(hostPrefixNotation, request.params, operationModel.input); - prependEndpointPrefix(request.httpRequest.endpoint, hostPrefix); - validateHostname(request.httpRequest.endpoint.hostname); - } - return request; +function translateMap(map, shape) { + if (map == null) return undefined; + + var out = {}; + util.each(map, function(key, value) { + var result = translate(value, shape.value); + if (result === undefined) out[key] = null; + else out[key] = result; + }); + return out; } -/** - * @api private - */ -function hasEndpointDiscover(request) { - var api = request.service.api; - var operationModel = api.operations[request.operation]; - var isEndpointOperation = api.endpointOperation && (api.endpointOperation === util.string.lowerFirst(operationModel.name)); - return (operationModel.endpointDiscoveryRequired !== 'NULL' || isEndpointOperation === true); +function translateScalar(value, shape) { + return shape.toType(value); } /** * @api private */ -function expandHostPrefix(hostPrefixNotation, params, shape) { - util.each(shape.members, function(name, member) { - if (member.hostLabel === true) { - if (typeof params[name] !== 'string' || params[name] === '') { - throw util.error(new Error(), { - message: 'Parameter ' + name + ' should be a non-empty string.', - code: 'InvalidParameter' - }); - } - var regex = new RegExp('\\{' + name + '\\}', 'g'); - hostPrefixNotation = hostPrefixNotation.replace(regex, params[name]); - } - }); - return hostPrefixNotation; -} +module.exports = JsonParser; + + +/***/ }), + +/***/ 93985: +/***/ ((module) => { + +var warning = [ + 'The AWS SDK for JavaScript (v2) will enter maintenance mode', + 'on September 8, 2024 and reach end-of-support on September 8, 2025.\n', + 'Please migrate your code to use AWS SDK for JavaScript (v3).', + 'For more information, check blog post at https://a.co/cUPnyil' +].join('\n'); + +module.exports = { + suppress: false +}; /** - * @api private + * To suppress this message: + * @example + * require('aws-sdk/lib/maintenance_mode_message').suppress = true; */ -function prependEndpointPrefix(endpoint, prefix) { - if (endpoint.host) { - endpoint.host = prefix + endpoint.host; +function emitWarning() { + if (typeof process === 'undefined') + return; + + // Skip maintenance mode message in Lambda environments + if ( + typeof process.env === 'object' && + typeof process.env.AWS_EXECUTION_ENV !== 'undefined' && + process.env.AWS_EXECUTION_ENV.indexOf('AWS_Lambda_') === 0 + ) { + return; } - if (endpoint.hostname) { - endpoint.hostname = prefix + endpoint.hostname; + + if ( + typeof process.env === 'object' && + typeof process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE !== 'undefined' + ) { + return; } -} -/** - * @api private - */ -function validateHostname(hostname) { - var labels = hostname.split('.'); - //Reference: https://tools.ietf.org/html/rfc1123#section-2 - var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; - util.arrayEach(labels, function(label) { - if (!label.length || label.length < 1 || label.length > 63) { - throw util.error(new Error(), { - code: 'ValidationError', - message: 'Hostname label length should be between 1 to 63 characters, inclusive.' - }); - } - if (!hostPattern.test(label)) { - throw AWS.util.error(new Error(), - {code: 'ValidationError', message: label + ' is not hostname compatible.'}); - } - }); + if (typeof process.emitWarning === 'function') { + process.emitWarning(warning, { + type: 'NOTE' + }); + } } -module.exports = { - populateHostPrefix: populateHostPrefix -}; +setTimeout(function () { + if (!module.exports.suppress) { + emitWarning(); + } +}, 0); /***/ }), -/***/ 30083: +/***/ 25768: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __nccwpck_require__(77985); -var JsonBuilder = __nccwpck_require__(47495); -var JsonParser = __nccwpck_require__(5474); -var populateHostPrefix = (__nccwpck_require__(97969).populateHostPrefix); +var AWS = __nccwpck_require__(28437); +__nccwpck_require__(1556); +var inherit = AWS.util.inherit; +var getMetadataServiceEndpoint = __nccwpck_require__(608); +var URL = (__nccwpck_require__(57310).URL); -function buildRequest(req) { - var httpRequest = req.httpRequest; - var api = req.service.api; - var target = api.targetPrefix + '.' + api.operations[req.operation].name; - var version = api.jsonVersion || '1.0'; - var input = api.operations[req.operation].input; - var builder = new JsonBuilder(); +/** + * Represents a metadata service available on EC2 instances. Using the + * {request} method, you can receieve metadata about any available resource + * on the metadata service. + * + * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED + * environment variable to a truthy value. + * + * @!attribute [r] httpOptions + * @return [map] a map of options to pass to the underlying HTTP request: + * + * * **timeout** (Number) — a timeout value in milliseconds to wait + * before aborting the connection. Set to 0 for no timeout. + * + * @!macro nobrowser + */ +AWS.MetadataService = inherit({ + /** + * @return [String] the endpoint of the instance metadata service + */ + endpoint: getMetadataServiceEndpoint(), - if (version === 1) version = '1.0'; + /** + * @!ignore + */ - if (api.awsQueryCompatible) { - if (!httpRequest.params) { - httpRequest.params = {}; + /** + * Default HTTP options. By default, the metadata service is set to not + * timeout on long requests. This means that on non-EC2 machines, this + * request will never return. If you are calling this operation from an + * environment that may not always run on EC2, set a `timeout` value so + * the SDK will abort the request after a given number of milliseconds. + */ + httpOptions: { timeout: 0 }, + + /** + * when enabled, metadata service will not fetch token + */ + disableFetchToken: false, + + /** + * Creates a new MetadataService object with a given set of options. + * + * @option options host [String] the hostname of the instance metadata + * service + * @option options httpOptions [map] a map of options to pass to the + * underlying HTTP request: + * + * * **timeout** (Number) — a timeout value in milliseconds to wait + * before aborting the connection. Set to 0 for no timeout. + * @option options maxRetries [Integer] the maximum number of retries to + * perform for timeout errors + * @option options retryDelayOptions [map] A set of options to configure the + * retry delay on retryable errors. See AWS.Config for details. + * @option options ec2MetadataV1Disabled [boolean] Whether to block IMDS v1 fallback. + * @option options profile [string] A profile to check for IMDSv1 fallback settings. + * @option options filename [string] Optional filename for the config file. + */ + constructor: function MetadataService(options) { + if (options && options.host) { + options.endpoint = 'http://' + options.host; + delete options.host; } - // because Query protocol does this. - Object.assign(httpRequest.params, req.params); - } + this.profile = options && options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.ec2MetadataV1Disabled = !!(options && options.ec2MetadataV1Disabled); + this.filename = options && options.filename; + AWS.util.update(this, options); + }, - httpRequest.body = builder.build(req.params || {}, input); - httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version; - httpRequest.headers['X-Amz-Target'] = target; + /** + * Sends a request to the instance metadata service for a given resource. + * + * @param path [String] the path of the resource to get + * + * @param options [map] an optional map used to make request + * + * * **method** (String) — HTTP request method + * + * * **headers** (map) — a map of response header keys and their respective values + * + * @callback callback function(err, data) + * Called when a response is available from the service. + * @param err [Error, null] if an error occurred, this value will be set + * @param data [String, null] if the request was successful, the body of + * the response + */ + request: function request(path, options, callback) { + if (arguments.length === 2) { + callback = options; + options = {}; + } - populateHostPrefix(req); -} + if (process.env[AWS.util.imdsDisabledEnv]) { + callback(new Error('EC2 Instance Metadata Service access disabled')); + return; + } -function extractError(resp) { - var error = {}; - var httpResponse = resp.httpResponse; + path = path || '/'; - error.code = httpResponse.headers['x-amzn-errortype'] || 'UnknownError'; - if (typeof error.code === 'string') { - error.code = error.code.split(':')[0]; - } + // Verify that host is a valid URL + if (URL) { new URL(this.endpoint); } - if (httpResponse.body.length > 0) { - try { - var e = JSON.parse(httpResponse.body.toString()); + var httpRequest = new AWS.HttpRequest(this.endpoint + path); + httpRequest.method = options.method || 'GET'; + if (options.headers) { + httpRequest.headers = options.headers; + } + AWS.util.handleRequestWithRetries(httpRequest, this, callback); + }, + + /** + * @api private + */ + loadCredentialsCallbacks: [], + + /** + * Fetches metadata token used for authenticating against the instance metadata service. + * + * @callback callback function(err, token) + * Called when token is loaded from the resource + */ + fetchMetadataToken: function fetchMetadataToken(callback) { + var self = this; + var tokenFetchPath = '/latest/api/token'; + self.request( + tokenFetchPath, + { + 'method': 'PUT', + 'headers': { + 'x-aws-ec2-metadata-token-ttl-seconds': '21600' + } + }, + callback + ); + }, + + /** + * Fetches credentials + * + * @api private + * @callback cb function(err, creds) + * Called when credentials are loaded from the resource + */ + fetchCredentials: function fetchCredentials(options, cb) { + var self = this; + var basePath = '/latest/meta-data/iam/security-credentials/'; + + var isImdsV1Fallback = self.disableFetchToken + || !(options && options.headers && options.headers['x-aws-ec2-metadata-token']); + + if (isImdsV1Fallback && !(process.env.AWS_EC2_METADATA_DISABLED)) { + try { + var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader, this.filename); + var profileSettings = profiles[this.profile] || {}; + } catch (e) { + profileSettings = {}; + } - var code = e.__type || e.code || e.Code; - if (code) { - error.code = code.split('#').pop(); + if (profileSettings.ec2_metadata_v1_disabled && profileSettings.ec2_metadata_v1_disabled !== 'false') { + return cb(AWS.util.error( + new Error('AWS EC2 Metadata v1 fallback has been blocked by AWS config file profile.') + )); } - if (error.code === 'RequestEntityTooLarge') { - error.message = 'Request body must be less than 1 MB'; - } else { - error.message = (e.message || e.Message || null); + + if (self.ec2MetadataV1Disabled) { + return cb(AWS.util.error( + new Error('AWS EC2 Metadata v1 fallback has been blocked by AWS.MetadataService::options.ec2MetadataV1Disabled=true.') + )); } - // The minimized models do not have error shapes, so - // without expanding the model size, it's not possible - // to validate the response shape (members) or - // check if any are sensitive to logging. + if (process.env.AWS_EC2_METADATA_V1_DISABLED && process.env.AWS_EC2_METADATA_V1_DISABLED !== 'false') { + return cb(AWS.util.error( + new Error('AWS EC2 Metadata v1 fallback has been blocked by process.env.AWS_EC2_METADATA_V1_DISABLED.') + )); + } + } - // Assign the fields as non-enumerable, allowing specific access only. - for (var key in e || {}) { - if (key === 'code' || key === 'message') { - continue; + self.request(basePath, options, function (err, roleName) { + if (err) { + self.disableFetchToken = !(err.statusCode === 401); + cb(AWS.util.error( + err, + { + message: 'EC2 Metadata roleName request returned error' + } + )); + return; + } + roleName = roleName.split('\n')[0]; // grab first (and only) role + self.request(basePath + roleName, options, function (credErr, credData) { + if (credErr) { + self.disableFetchToken = !(credErr.statusCode === 401); + cb(AWS.util.error( + credErr, + { + message: 'EC2 Metadata creds request returned error' + } + )); + return; } - error['[' + key + ']'] = 'See error.' + key + ' for details.'; - Object.defineProperty(error, key, { - value: e[key], - enumerable: false, - writable: true - }); + try { + var credentials = JSON.parse(credData); + cb(null, credentials); + } catch (parseError) { + cb(parseError); + } + }); + }); + }, + + /** + * Loads a set of credentials stored in the instance metadata service + * + * @api private + * @callback callback function(err, credentials) + * Called when credentials are loaded from the resource + * @param err [Error] if an error occurred, this value will be set + * @param credentials [Object] the raw JSON object containing all + * metadata from the credentials resource + */ + loadCredentials: function loadCredentials(callback) { + var self = this; + self.loadCredentialsCallbacks.push(callback); + if (self.loadCredentialsCallbacks.length > 1) { return; } + + function callbacks(err, creds) { + var cb; + while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) { + cb(err, creds); } - } catch (e) { - error.statusCode = httpResponse.statusCode; - error.message = httpResponse.statusMessage; } - } else { - error.statusCode = httpResponse.statusCode; - error.message = httpResponse.statusCode.toString(); - } - resp.error = util.error(new Error(), error); -} + if (self.disableFetchToken) { + self.fetchCredentials({}, callbacks); + } else { + self.fetchMetadataToken(function(tokenError, token) { + if (tokenError) { + if (tokenError.code === 'TimeoutError') { + self.disableFetchToken = true; + } else if (tokenError.retryable === true) { + callbacks(AWS.util.error( + tokenError, + { + message: 'EC2 Metadata token request returned error' + } + )); + return; + } else if (tokenError.statusCode === 400) { + callbacks(AWS.util.error( + tokenError, + { + message: 'EC2 Metadata token request returned 400' + } + )); + return; + } + } + var options = {}; + if (token) { + options.headers = { + 'x-aws-ec2-metadata-token': token + }; + } + self.fetchCredentials(options, callbacks); + }); -function extractData(resp) { - var body = resp.httpResponse.body.toString() || '{}'; - if (resp.request.service.config.convertResponseTypes === false) { - resp.data = JSON.parse(body); - } else { - var operation = resp.request.service.api.operations[resp.request.operation]; - var shape = operation.output || {}; - var parser = new JsonParser(); - resp.data = parser.parse(body, shape); + } } -} +}); /** * @api private */ -module.exports = { - buildRequest: buildRequest, - extractError: extractError, - extractData: extractData -}; +module.exports = AWS.MetadataService; /***/ }), -/***/ 90761: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var util = __nccwpck_require__(77985); -var QueryParamSerializer = __nccwpck_require__(45175); -var Shape = __nccwpck_require__(71349); -var populateHostPrefix = (__nccwpck_require__(97969).populateHostPrefix); +/***/ 83205: +/***/ ((module) => { -function buildRequest(req) { - var operation = req.service.api.operations[req.operation]; - var httpRequest = req.httpRequest; - httpRequest.headers['Content-Type'] = - 'application/x-www-form-urlencoded; charset=utf-8'; - httpRequest.params = { - Version: req.service.api.apiVersion, - Action: operation.name +var getEndpoint = function() { + return { + IPv4: 'http://169.254.169.254', + IPv6: 'http://[fd00:ec2::254]', }; +}; - // convert the request parameters into a list of query params, - // e.g. Deeply.NestedParam.0.Name=value - var builder = new QueryParamSerializer(); - builder.serialize(req.params, operation.input, function(name, value) { - httpRequest.params[name] = value; - }); - httpRequest.body = util.queryParamsToString(httpRequest.params); - - populateHostPrefix(req); -} - -function extractError(resp) { - var data, body = resp.httpResponse.body.toString(); - if (body.match(' { - var parser = new AWS.XML.Parser(); +var ENV_ENDPOINT_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT'; +var CONFIG_ENDPOINT_NAME = 'ec2_metadata_service_endpoint'; - // TODO: Refactor XML Parser to parse RequestId from response. - if (shape && shape.members && !shape.members._XAMZRequestId) { - var requestIdShape = Shape.create( - { type: 'string' }, - { api: { protocol: 'query' } }, - 'requestId' - ); - shape.members._XAMZRequestId = requestIdShape; - } +var getEndpointConfigOptions = function() { + return { + environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_NAME]; }, + configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_NAME]; }, + default: undefined, + }; +}; - var data = parser.parse(resp.httpResponse.body.toString(), shape); - resp.requestId = data._XAMZRequestId || data.requestId; +module.exports = getEndpointConfigOptions; - if (data._XAMZRequestId) delete data._XAMZRequestId; - if (origRules.resultWrapper) { - if (data[origRules.resultWrapper]) { - util.update(data, data[origRules.resultWrapper]); - delete data[origRules.resultWrapper]; - } - } +/***/ }), - resp.data = data; -} +/***/ 37997: +/***/ ((module) => { -/** - * @api private - */ -module.exports = { - buildRequest: buildRequest, - extractError: extractError, - extractData: extractData +var getEndpointMode = function() { + return { + IPv4: 'IPv4', + IPv6: 'IPv6', + }; }; +module.exports = getEndpointMode; + /***/ }), -/***/ 98200: +/***/ 45509: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __nccwpck_require__(77985); -var populateHostPrefix = (__nccwpck_require__(97969).populateHostPrefix); - -function populateMethod(req) { - req.httpRequest.method = req.service.api.operations[req.operation].httpMethod; -} - -function generateURI(endpointPath, operationPath, input, params) { - var uri = [endpointPath, operationPath].join('/'); - uri = uri.replace(/\/+/g, '/'); - - var queryString = {}, queryStringSet = false; - util.each(input.members, function (name, member) { - var paramValue = params[name]; - if (paramValue === null || paramValue === undefined) return; - if (member.location === 'uri') { - var regex = new RegExp('\\{' + member.name + '(\\+)?\\}'); - uri = uri.replace(regex, function(_, plus) { - var fn = plus ? util.uriEscapePath : util.uriEscape; - return fn(String(paramValue)); - }); - } else if (member.location === 'querystring') { - queryStringSet = true; - - if (member.type === 'list') { - queryString[member.name] = paramValue.map(function(val) { - return util.uriEscape(member.member.toWireFormat(val).toString()); - }); - } else if (member.type === 'map') { - util.each(paramValue, function(key, value) { - if (Array.isArray(value)) { - queryString[key] = value.map(function(val) { - return util.uriEscape(String(val)); - }); - } else { - queryString[key] = util.uriEscape(String(value)); - } - }); - } else { - queryString[member.name] = util.uriEscape(member.toWireFormat(paramValue).toString()); - } - } - }); - - if (queryStringSet) { - uri += (uri.indexOf('?') >= 0 ? '&' : '?'); - var parts = []; - util.arrayEach(Object.keys(queryString).sort(), function(key) { - if (!Array.isArray(queryString[key])) { - queryString[key] = [queryString[key]]; - } - for (var i = 0; i < queryString[key].length; i++) { - parts.push(util.uriEscape(String(key)) + '=' + queryString[key][i]); - } - }); - uri += parts.join('&'); - } - - return uri; -} +var EndpointMode = __nccwpck_require__(37997)(); -function populateURI(req) { - var operation = req.service.api.operations[req.operation]; - var input = operation.input; +var ENV_ENDPOINT_MODE_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE'; +var CONFIG_ENDPOINT_MODE_NAME = 'ec2_metadata_service_endpoint_mode'; - var uri = generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); - req.httpRequest.path = uri; -} +var getEndpointModeConfigOptions = function() { + return { + environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_MODE_NAME]; }, + configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_MODE_NAME]; }, + default: EndpointMode.IPv4, + }; +}; -function populateHeaders(req) { - var operation = req.service.api.operations[req.operation]; - util.each(operation.input.members, function (name, member) { - var value = req.params[name]; - if (value === null || value === undefined) return; +module.exports = getEndpointModeConfigOptions; - if (member.location === 'headers' && member.type === 'map') { - util.each(value, function(key, memberValue) { - req.httpRequest.headers[member.name + key] = memberValue; - }); - } else if (member.location === 'header') { - value = member.toWireFormat(value).toString(); - if (member.isJsonValue) { - value = util.base64.encode(value); - } - req.httpRequest.headers[member.name] = value; - } - }); -} -function buildRequest(req) { - populateMethod(req); - populateURI(req); - populateHeaders(req); - populateHostPrefix(req); -} +/***/ }), -function extractError() { -} +/***/ 608: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function extractData(resp) { - var req = resp.request; - var data = {}; - var r = resp.httpResponse; - var operation = req.service.api.operations[req.operation]; - var output = operation.output; +var AWS = __nccwpck_require__(28437); - // normalize headers names to lower-cased keys for matching - var headers = {}; - util.each(r.headers, function (k, v) { - headers[k.toLowerCase()] = v; - }); +var Endpoint = __nccwpck_require__(83205)(); +var EndpointMode = __nccwpck_require__(37997)(); - util.each(output.members, function(name, member) { - var header = (member.name || name).toLowerCase(); - if (member.location === 'headers' && member.type === 'map') { - data[name] = {}; - var location = member.isLocationName ? member.name : ''; - var pattern = new RegExp('^' + location + '(.+)', 'i'); - util.each(r.headers, function (k, v) { - var result = k.match(pattern); - if (result !== null) { - data[name][result[1]] = v; - } - }); - } else if (member.location === 'header') { - if (headers[header] !== undefined) { - var value = member.isJsonValue ? - util.base64.decode(headers[header]) : - headers[header]; - data[name] = member.toType(value); - } - } else if (member.location === 'statusCode') { - data[name] = parseInt(r.statusCode, 10); - } - }); +var ENDPOINT_CONFIG_OPTIONS = __nccwpck_require__(95578)(); +var ENDPOINT_MODE_CONFIG_OPTIONS = __nccwpck_require__(45509)(); - resp.data = data; -} +var getMetadataServiceEndpoint = function() { + var endpoint = AWS.util.loadConfig(ENDPOINT_CONFIG_OPTIONS); + if (endpoint !== undefined) return endpoint; -/** - * @api private - */ -module.exports = { - buildRequest: buildRequest, - extractError: extractError, - extractData: extractData, - generateURI: generateURI + var endpointMode = AWS.util.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS); + switch (endpointMode) { + case EndpointMode.IPv4: + return Endpoint.IPv4; + case EndpointMode.IPv6: + return Endpoint.IPv6; + default: + throw new Error('Unsupported endpoint mode: ' + endpointMode); + } }; +module.exports = getMetadataServiceEndpoint; + /***/ }), -/***/ 5883: +/***/ 17657: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __nccwpck_require__(77985); -var Rest = __nccwpck_require__(98200); -var Json = __nccwpck_require__(30083); -var JsonBuilder = __nccwpck_require__(47495); -var JsonParser = __nccwpck_require__(5474); +var Collection = __nccwpck_require__(71965); +var Operation = __nccwpck_require__(28083); +var Shape = __nccwpck_require__(71349); +var Paginator = __nccwpck_require__(45938); +var ResourceWaiter = __nccwpck_require__(41368); +var metadata = __nccwpck_require__(17752); -var METHODS_WITHOUT_BODY = ['GET', 'HEAD', 'DELETE']; +var util = __nccwpck_require__(77985); +var property = util.property; +var memoizedProperty = util.memoizedProperty; -function unsetContentLength(req) { - var payloadMember = util.getRequestPayloadShape(req); - if ( - payloadMember === undefined && - METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) >= 0 - ) { - delete req.httpRequest.headers['Content-Length']; - } -} +function Api(api, options) { + var self = this; + api = api || {}; + options = options || {}; + options.api = this; -function populateBody(req) { - var builder = new JsonBuilder(); - var input = req.service.api.operations[req.operation].input; + api.metadata = api.metadata || {}; - if (input.payload) { - var params = {}; - var payloadShape = input.members[input.payload]; - params = req.params[input.payload]; + var serviceIdentifier = options.serviceIdentifier; + delete options.serviceIdentifier; - if (payloadShape.type === 'structure') { - req.httpRequest.body = builder.build(params || {}, payloadShape); - applyContentTypeHeader(req); - } else if (params !== undefined) { - // non-JSON payload - req.httpRequest.body = params; - if (payloadShape.type === 'binary' || payloadShape.isStreaming) { - applyContentTypeHeader(req, true); - } - } - } else { - req.httpRequest.body = builder.build(req.params, input); - applyContentTypeHeader(req); + property(this, 'isApi', true, false); + property(this, 'apiVersion', api.metadata.apiVersion); + property(this, 'endpointPrefix', api.metadata.endpointPrefix); + property(this, 'signingName', api.metadata.signingName); + property(this, 'globalEndpoint', api.metadata.globalEndpoint); + property(this, 'signatureVersion', api.metadata.signatureVersion); + property(this, 'jsonVersion', api.metadata.jsonVersion); + property(this, 'targetPrefix', api.metadata.targetPrefix); + property(this, 'protocol', api.metadata.protocol); + property(this, 'timestampFormat', api.metadata.timestampFormat); + property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace); + property(this, 'abbreviation', api.metadata.serviceAbbreviation); + property(this, 'fullName', api.metadata.serviceFullName); + property(this, 'serviceId', api.metadata.serviceId); + if (serviceIdentifier && metadata[serviceIdentifier]) { + property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false); } -} -function applyContentTypeHeader(req, isBinary) { - if (!req.httpRequest.headers['Content-Type']) { - var type = isBinary ? 'binary/octet-stream' : 'application/json'; - req.httpRequest.headers['Content-Type'] = type; - } -} + memoizedProperty(this, 'className', function() { + var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName; + if (!name) return null; -function buildRequest(req) { - Rest.buildRequest(req); + name = name.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g, ''); + if (name === 'ElasticLoadBalancing') name = 'ELB'; + return name; + }); - // never send body payload on GET/HEAD/DELETE - if (METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) < 0) { - populateBody(req); + function addEndpointOperation(name, operation) { + if (operation.endpointoperation === true) { + property(self, 'endpointOperation', util.string.lowerFirst(name)); + } + if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) { + property( + self, + 'hasRequiredEndpointDiscovery', + operation.endpointdiscovery.required === true + ); + } } -} -function extractError(resp) { - Json.extractError(resp); -} + property(this, 'operations', new Collection(api.operations, options, function(name, operation) { + return new Operation(name, operation, options); + }, util.string.lowerFirst, addEndpointOperation)); -function extractData(resp) { - Rest.extractData(resp); + property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) { + return Shape.create(shape, options); + })); - var req = resp.request; - var operation = req.service.api.operations[req.operation]; - var rules = req.service.api.operations[req.operation].output || {}; - var parser; - var hasEventOutput = operation.hasEventOutput; + property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) { + return new Paginator(name, paginator, options); + })); - if (rules.payload) { - var payloadMember = rules.members[rules.payload]; - var body = resp.httpResponse.body; - if (payloadMember.isEventStream) { - parser = new JsonParser(); - resp.data[payload] = util.createEventStream( - AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : body, - parser, - payloadMember - ); - } else if (payloadMember.type === 'structure' || payloadMember.type === 'list') { - var parser = new JsonParser(); - resp.data[rules.payload] = parser.parse(body, payloadMember); - } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { - resp.data[rules.payload] = body; - } else { - resp.data[rules.payload] = payloadMember.toType(body); - } - } else { - var data = resp.data; - Json.extractData(resp); - resp.data = util.merge(data, resp.data); + property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) { + return new ResourceWaiter(name, waiter, options); + }, util.string.lowerFirst)); + + if (options.documentation) { + property(this, 'documentation', api.documentation); + property(this, 'documentationUrl', api.documentationUrl); } + property(this, 'awsQueryCompatible', api.metadata.awsQueryCompatible); } /** * @api private */ -module.exports = { - buildRequest: buildRequest, - extractError: extractError, - extractData: extractData, - unsetContentLength: unsetContentLength -}; +module.exports = Api; /***/ }), -/***/ 15143: +/***/ 71965: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var AWS = __nccwpck_require__(28437); -var util = __nccwpck_require__(77985); -var Rest = __nccwpck_require__(98200); +var memoizedProperty = (__nccwpck_require__(77985).memoizedProperty); -function populateBody(req) { - var input = req.service.api.operations[req.operation].input; - var builder = new AWS.XML.Builder(); - var params = req.params; +function memoize(name, value, factory, nameTr) { + memoizedProperty(this, nameTr(name), function() { + return factory(name, value); + }); +} - var payload = input.payload; - if (payload) { - var payloadMember = input.members[payload]; - params = params[payload]; - if (params === undefined) return; +function Collection(iterable, options, factory, nameTr, callback) { + nameTr = nameTr || String; + var self = this; - if (payloadMember.type === 'structure') { - var rootElement = payloadMember.name; - req.httpRequest.body = builder.toXML(params, payloadMember, rootElement, true); - } else { // non-xml payload - req.httpRequest.body = params; + for (var id in iterable) { + if (Object.prototype.hasOwnProperty.call(iterable, id)) { + memoize.call(self, id, iterable[id], factory, nameTr); + if (callback) callback(id, iterable[id]); } - } else { - req.httpRequest.body = builder.toXML(params, input, input.name || - input.shape || util.string.upperFirst(req.operation) + 'Request'); } } -function buildRequest(req) { - Rest.buildRequest(req); +/** + * @api private + */ +module.exports = Collection; - // never send body payload on GET/HEAD - if (['GET', 'HEAD'].indexOf(req.httpRequest.method) < 0) { - populateBody(req); - } -} -function extractError(resp) { - Rest.extractError(resp); +/***/ }), - var data; - try { - data = new AWS.XML.Parser().parse(resp.httpResponse.body.toString()); - } catch (e) { - data = { - Code: resp.httpResponse.statusCode, - Message: resp.httpResponse.statusMessage - }; - } +/***/ 28083: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (data.Errors) data = data.Errors; - if (data.Error) data = data.Error; - if (data.Code) { - resp.error = util.error(new Error(), { - code: data.Code, - message: data.Message - }); - } else { - resp.error = util.error(new Error(), { - code: resp.httpResponse.statusCode, - message: null - }); - } -} +var Shape = __nccwpck_require__(71349); -function extractData(resp) { - Rest.extractData(resp); +var util = __nccwpck_require__(77985); +var property = util.property; +var memoizedProperty = util.memoizedProperty; - var parser; - var req = resp.request; - var body = resp.httpResponse.body; - var operation = req.service.api.operations[req.operation]; - var output = operation.output; +function Operation(name, operation, options) { + var self = this; + options = options || {}; - var hasEventOutput = operation.hasEventOutput; + property(this, 'name', operation.name || name); + property(this, 'api', options.api, false); - var payload = output.payload; - if (payload) { - var payloadMember = output.members[payload]; - if (payloadMember.isEventStream) { - parser = new AWS.XML.Parser(); - resp.data[payload] = util.createEventStream( - AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : resp.httpResponse.body, - parser, - payloadMember - ); - } else if (payloadMember.type === 'structure') { - parser = new AWS.XML.Parser(); - resp.data[payload] = parser.parse(body.toString(), payloadMember); - } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { - resp.data[payload] = body; - } else { - resp.data[payload] = payloadMember.toType(body); + operation.http = operation.http || {}; + property(this, 'endpoint', operation.endpoint); + property(this, 'httpMethod', operation.http.method || 'POST'); + property(this, 'httpPath', operation.http.requestUri || '/'); + property(this, 'authtype', operation.authtype || ''); + property( + this, + 'endpointDiscoveryRequired', + operation.endpointdiscovery ? + (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') : + 'NULL' + ); + + // httpChecksum replaces usage of httpChecksumRequired, but some APIs + // (s3control) still uses old trait. + var httpChecksumRequired = operation.httpChecksumRequired + || (operation.httpChecksum && operation.httpChecksum.requestChecksumRequired); + property(this, 'httpChecksumRequired', httpChecksumRequired, false); + + memoizedProperty(this, 'input', function() { + if (!operation.input) { + return new Shape.create({type: 'structure'}, options); } - } else if (body.length > 0) { - parser = new AWS.XML.Parser(); - var data = parser.parse(body.toString(), output); - util.update(resp.data, data); - } -} + return Shape.create(operation.input, options); + }); -/** - * @api private - */ -module.exports = { - buildRequest: buildRequest, - extractError: extractError, - extractData: extractData -}; + memoizedProperty(this, 'output', function() { + if (!operation.output) { + return new Shape.create({type: 'structure'}, options); + } + return Shape.create(operation.output, options); + }); + memoizedProperty(this, 'errors', function() { + var list = []; + if (!operation.errors) return null; -/***/ }), + for (var i = 0; i < operation.errors.length; i++) { + list.push(Shape.create(operation.errors[i], options)); + } -/***/ 91822: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return list; + }); -var AWS = __nccwpck_require__(28437); + memoizedProperty(this, 'paginator', function() { + return options.api.paginators[name]; + }); -/** - * Resolve client-side monitoring configuration from either environmental variables - * or shared config file. Configurations from environmental variables have higher priority - * than those from shared config file. The resolver will try to read the shared config file - * no matter whether the AWS_SDK_LOAD_CONFIG variable is set. - * @api private - */ -function resolveMonitoringConfig() { - var config = { - port: undefined, - clientId: undefined, - enabled: undefined, - host: undefined - }; - if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config); - return toJSType(config); -} + if (options.documentation) { + property(this, 'documentation', operation.documentation); + property(this, 'documentationUrl', operation.documentationUrl); + } -/** - * Resolve configurations from environmental variables. - * @param {object} client side monitoring config object needs to be resolved - * @returns {boolean} whether resolving configurations is done - * @api private - */ -function fromEnvironment(config) { - config.port = config.port || process.env.AWS_CSM_PORT; - config.enabled = config.enabled || process.env.AWS_CSM_ENABLED; - config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID; - config.host = config.host || process.env.AWS_CSM_HOST; - return config.port && config.enabled && config.clientId && config.host || - ['false', '0'].indexOf(config.enabled) >= 0; //no need to read shared config file if explicitely disabled + // idempotentMembers only tracks top-level input shapes + memoizedProperty(this, 'idempotentMembers', function() { + var idempotentMembers = []; + var input = self.input; + var members = input.members; + if (!input.members) { + return idempotentMembers; + } + for (var name in members) { + if (!members.hasOwnProperty(name)) { + continue; + } + if (members[name].isIdempotent === true) { + idempotentMembers.push(name); + } + } + return idempotentMembers; + }); + + memoizedProperty(this, 'hasEventOutput', function() { + var output = self.output; + return hasEventStream(output); + }); } -/** - * Resolve cofigurations from shared config file with specified role name - * @param {object} client side monitoring config object needs to be resolved - * @returns {boolean} whether resolving configurations is done - * @api private - */ -function fromConfigFile(config) { - var sharedFileConfig; - try { - var configFile = AWS.util.iniLoader.loadFrom({ - isConfig: true, - filename: process.env[AWS.util.sharedConfigFileEnv] - }); - var sharedFileConfig = configFile[ - process.env.AWS_PROFILE || AWS.util.defaultProfile - ]; - } catch (err) { +function hasEventStream(topLevelShape) { + var members = topLevelShape.members; + var payload = topLevelShape.payload; + + if (!topLevelShape.members) { return false; } - if (!sharedFileConfig) return config; - config.port = config.port || sharedFileConfig.csm_port; - config.enabled = config.enabled || sharedFileConfig.csm_enabled; - config.clientId = config.clientId || sharedFileConfig.csm_client_id; - config.host = config.host || sharedFileConfig.csm_host; - return config.port && config.enabled && config.clientId && config.host; + + if (payload) { + var payloadMember = members[payload]; + return payloadMember.isEventStream; + } + + // check if any member is an event stream + for (var name in members) { + if (!members.hasOwnProperty(name)) { + if (members[name].isEventStream === true) { + return true; + } + } + } + return false; } /** - * Transfer the resolved configuration value to proper types: port as number, enabled - * as boolean and clientId as string. The 'enabled' flag is valued to false when set - * to 'false' or '0'. - * @param {object} resolved client side monitoring config * @api private */ -function toJSType(config) { - //config.XXX is either undefined or string - var falsyNotations = ['false', '0', undefined]; - if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) { - config.enabled = false; - } else { - config.enabled = true; - } - config.port = config.port ? parseInt(config.port, 10) : undefined; - return config; -} - -module.exports = resolveMonitoringConfig; +module.exports = Operation; /***/ }), -/***/ 66807: +/***/ 45938: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = (__nccwpck_require__(28437).util); -var dgram = __nccwpck_require__(71891); -var stringToBuffer = util.buffer.toBuffer; - -var MAX_MESSAGE_SIZE = 1024 * 8; // 8 KB +var property = (__nccwpck_require__(77985).property); -/** - * Publishes metrics via udp. - * @param {object} options Paramters for Publisher constructor - * @param {number} [options.port = 31000] Port number - * @param {string} [options.clientId = ''] Client Identifier - * @param {boolean} [options.enabled = false] enable sending metrics datagram - * @api private - */ -function Publisher(options) { - // handle configuration - options = options || {}; - this.enabled = options.enabled || false; - this.port = options.port || 31000; - this.clientId = options.clientId || ''; - this.address = options.host || '127.0.0.1'; - if (this.clientId.length > 255) { - // ClientId has a max length of 255 - this.clientId = this.clientId.substr(0, 255); - } - this.messagesInFlight = 0; +function Paginator(name, paginator) { + property(this, 'inputToken', paginator.input_token); + property(this, 'limitKey', paginator.limit_key); + property(this, 'moreResults', paginator.more_results); + property(this, 'outputToken', paginator.output_token); + property(this, 'resultKey', paginator.result_key); } -Publisher.prototype.fieldsToTrim = { - UserAgent: 256, - SdkException: 128, - SdkExceptionMessage: 512, - AwsException: 128, - AwsExceptionMessage: 512, - FinalSdkException: 128, - FinalSdkExceptionMessage: 512, - FinalAwsException: 128, - FinalAwsExceptionMessage: 512 - -}; - /** - * Trims fields that have a specified max length. - * @param {object} event ApiCall or ApiCallAttempt event. - * @returns {object} * @api private */ -Publisher.prototype.trimFields = function(event) { - var trimmableFields = Object.keys(this.fieldsToTrim); - for (var i = 0, iLen = trimmableFields.length; i < iLen; i++) { - var field = trimmableFields[i]; - if (event.hasOwnProperty(field)) { - var maxLength = this.fieldsToTrim[field]; - var value = event[field]; - if (value && value.length > maxLength) { - event[field] = value.substr(0, maxLength); - } - } - } - return event; -}; +module.exports = Paginator; -/** - * Handles ApiCall and ApiCallAttempt events. - * @param {Object} event apiCall or apiCallAttempt event. - * @api private - */ -Publisher.prototype.eventHandler = function(event) { - // set the clientId - event.ClientId = this.clientId; - this.trimFields(event); +/***/ }), - var message = stringToBuffer(JSON.stringify(event)); - if (!this.enabled || message.length > MAX_MESSAGE_SIZE) { - // drop the message if publisher not enabled or it is too large - return; - } +/***/ 41368: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.publishDatagram(message); -}; +var util = __nccwpck_require__(77985); +var property = util.property; -/** - * Publishes message to an agent. - * @param {Buffer} message JSON message to send to agent. - * @api private - */ -Publisher.prototype.publishDatagram = function(message) { - var self = this; - var client = this.getClient(); +function ResourceWaiter(name, waiter, options) { + options = options || {}; + property(this, 'name', name); + property(this, 'api', options.api, false); - this.messagesInFlight++; - this.client.send(message, 0, message.length, this.port, this.address, function(err, bytes) { - if (--self.messagesInFlight <= 0) { - // destroy existing client so the event loop isn't kept open - self.destroyClient(); - } - }); -}; + if (waiter.operation) { + property(this, 'operation', util.string.lowerFirst(waiter.operation)); + } -/** - * Returns an existing udp socket, or creates one if it doesn't already exist. - * @api private - */ -Publisher.prototype.getClient = function() { - if (!this.client) { - this.client = dgram.createSocket('udp4'); + var self = this; + var keys = [ + 'type', + 'description', + 'delay', + 'maxAttempts', + 'acceptors' + ]; + + keys.forEach(function(key) { + var value = waiter[key]; + if (value) { + property(self, key, value); } - return this.client; -}; + }); +} /** - * Destroys the udp socket. * @api private */ -Publisher.prototype.destroyClient = function() { - if (this.client) { - this.client.close(); - this.client = void 0; - } -}; - -module.exports = { - Publisher: Publisher -}; +module.exports = ResourceWaiter; /***/ }), -/***/ 45175: +/***/ 71349: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __nccwpck_require__(77985); - -function QueryParamSerializer() { -} +var Collection = __nccwpck_require__(71965); -QueryParamSerializer.prototype.serialize = function(params, shape, fn) { - serializeStructure('', params, shape, fn); -}; +var util = __nccwpck_require__(77985); -function ucfirst(shape) { - if (shape.isQueryName || shape.api.protocol !== 'ec2') { - return shape.name; - } else { - return shape.name[0].toUpperCase() + shape.name.substr(1); +function property(obj, name, value) { + if (value !== null && value !== undefined) { + util.property.apply(this, arguments); } } -function serializeStructure(prefix, struct, rules, fn) { - util.each(rules.members, function(name, member) { - var value = struct[name]; - if (value === null || value === undefined) return; - - var memberName = ucfirst(member); - memberName = prefix ? prefix + '.' + memberName : memberName; - serializeMember(memberName, value, member, fn); - }); +function memoizedProperty(obj, name) { + if (!obj.constructor.prototype[name]) { + util.memoizedProperty.apply(this, arguments); + } } -function serializeMap(name, map, rules, fn) { - var i = 1; - util.each(map, function (key, value) { - var prefix = rules.flattened ? '.' : '.entry.'; - var position = prefix + (i++) + '.'; - var keyName = position + (rules.key.name || 'key'); - var valueName = position + (rules.value.name || 'value'); - serializeMember(name + keyName, key, rules.key, fn); - serializeMember(name + valueName, value, rules.value, fn); - }); -} +function Shape(shape, options, memberName) { + options = options || {}; -function serializeList(name, list, rules, fn) { - var memberRules = rules.member || {}; + property(this, 'shape', shape.shape); + property(this, 'api', options.api, false); + property(this, 'type', shape.type); + property(this, 'enum', shape.enum); + property(this, 'min', shape.min); + property(this, 'max', shape.max); + property(this, 'pattern', shape.pattern); + property(this, 'location', shape.location || this.location || 'body'); + property(this, 'name', this.name || shape.xmlName || shape.queryName || + shape.locationName || memberName); + property(this, 'isStreaming', shape.streaming || this.isStreaming || false); + property(this, 'requiresLength', shape.requiresLength, false); + property(this, 'isComposite', shape.isComposite || false); + property(this, 'isShape', true, false); + property(this, 'isQueryName', Boolean(shape.queryName), false); + property(this, 'isLocationName', Boolean(shape.locationName), false); + property(this, 'isIdempotent', shape.idempotencyToken === true); + property(this, 'isJsonValue', shape.jsonvalue === true); + property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true); + property(this, 'isEventStream', Boolean(shape.eventstream), false); + property(this, 'isEvent', Boolean(shape.event), false); + property(this, 'isEventPayload', Boolean(shape.eventpayload), false); + property(this, 'isEventHeader', Boolean(shape.eventheader), false); + property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false); + property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false); + property(this, 'hostLabel', Boolean(shape.hostLabel), false); - if (list.length === 0) { - fn.call(this, name, null); - return; + if (options.documentation) { + property(this, 'documentation', shape.documentation); + property(this, 'documentationUrl', shape.documentationUrl); } - util.arrayEach(list, function (v, n) { - var suffix = '.' + (n + 1); - if (rules.api.protocol === 'ec2') { - // Do nothing for EC2 - suffix = suffix + ''; // make linter happy - } else if (rules.flattened) { - if (memberRules.name) { - var parts = name.split('.'); - parts.pop(); - parts.push(ucfirst(memberRules)); - name = parts.join('.'); - } - } else { - suffix = '.' + (memberRules.name ? memberRules.name : 'member') + suffix; - } - serializeMember(name + suffix, v, memberRules, fn); - }); -} - -function serializeMember(name, value, rules, fn) { - if (value === null || value === undefined) return; - if (rules.type === 'structure') { - serializeStructure(name, value, rules, fn); - } else if (rules.type === 'list') { - serializeList(name, value, rules, fn); - } else if (rules.type === 'map') { - serializeMap(name, value, rules, fn); - } else { - fn(name, rules.toWireFormat(value).toString()); + if (shape.xmlAttribute) { + property(this, 'isXmlAttribute', shape.xmlAttribute || false); } -} - -/** - * @api private - */ -module.exports = QueryParamSerializer; - -/***/ }), - -/***/ 16612: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); - -/** - * @api private - */ -var service = null; + // type conversion and parsing + property(this, 'defaultValue', null); + this.toWireFormat = function(value) { + if (value === null || value === undefined) return ''; + return value; + }; + this.toType = function(value) { return value; }; +} /** * @api private */ -var api = { - signatureVersion: 'v4', - signingName: 'rds-db', - operations: {} +Shape.normalizedTypes = { + character: 'string', + double: 'float', + long: 'integer', + short: 'integer', + biginteger: 'integer', + bigdecimal: 'float', + blob: 'binary' }; /** * @api private */ -var requiredAuthTokenOptions = { - region: 'string', - hostname: 'string', - port: 'number', - username: 'string' +Shape.types = { + 'structure': StructureShape, + 'list': ListShape, + 'map': MapShape, + 'boolean': BooleanShape, + 'timestamp': TimestampShape, + 'float': FloatShape, + 'integer': IntegerShape, + 'string': StringShape, + 'base64': Base64Shape, + 'binary': BinaryShape }; -/** - * A signer object can be used to generate an auth token to a database. - */ -AWS.RDS.Signer = AWS.util.inherit({ - /** - * Creates a signer object can be used to generate an auth token. - * - * @option options credentials [AWS.Credentials] the AWS credentials - * to sign requests with. Uses the default credential provider chain - * if not specified. - * @option options hostname [String] the hostname of the database to connect to. - * @option options port [Number] the port number the database is listening on. - * @option options region [String] the region the database is located in. - * @option options username [String] the username to login as. - * @example Passing in options to constructor - * var signer = new AWS.RDS.Signer({ - * credentials: new AWS.SharedIniFileCredentials({profile: 'default'}), - * region: 'us-east-1', - * hostname: 'db.us-east-1.rds.amazonaws.com', - * port: 8000, - * username: 'name' - * }); - */ - constructor: function Signer(options) { - this.options = options || {}; - }, - - /** - * @api private - * Strips the protocol from a url. - */ - convertUrlToAuthToken: function convertUrlToAuthToken(url) { - // we are always using https as the protocol - var protocol = 'https://'; - if (url.indexOf(protocol) === 0) { - return url.substring(protocol.length); - } - }, - - /** - * @overload getAuthToken(options = {}, [callback]) - * Generate an auth token to a database. - * @note You must ensure that you have static or previously resolved - * credentials if you call this method synchronously (with no callback), - * otherwise it may not properly sign the request. If you cannot guarantee - * this (you are using an asynchronous credential provider, i.e., EC2 - * IAM roles), you should always call this method with an asynchronous - * callback. - * - * @param options [map] The fields to use when generating an auth token. - * Any options specified here will be merged on top of any options passed - * to AWS.RDS.Signer: - * - * * **credentials** (AWS.Credentials) — the AWS credentials - * to sign requests with. Uses the default credential provider chain - * if not specified. - * * **hostname** (String) — the hostname of the database to connect to. - * * **port** (Number) — the port number the database is listening on. - * * **region** (String) — the region the database is located in. - * * **username** (String) — the username to login as. - * @return [String] if called synchronously (with no callback), returns the - * auth token. - * @return [null] nothing is returned if a callback is provided. - * @callback callback function (err, token) - * If a callback is supplied, it is called when an auth token has been generated. - * @param err [Error] the error object returned from the signer. - * @param token [String] the auth token. - * - * @example Generating an auth token synchronously - * var signer = new AWS.RDS.Signer({ - * // configure options - * region: 'us-east-1', - * username: 'default', - * hostname: 'db.us-east-1.amazonaws.com', - * port: 8000 - * }); - * var token = signer.getAuthToken({ - * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option - * // credentials are not specified here or when creating the signer, so default credential provider will be used - * username: 'test' // overriding username - * }); - * @example Generating an auth token asynchronously - * var signer = new AWS.RDS.Signer({ - * // configure options - * region: 'us-east-1', - * username: 'default', - * hostname: 'db.us-east-1.amazonaws.com', - * port: 8000 - * }); - * signer.getAuthToken({ - * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option - * // credentials are not specified here or when creating the signer, so default credential provider will be used - * username: 'test' // overriding username - * }, function(err, token) { - * if (err) { - * // handle error - * } else { - * // use token - * } - * }); - * - */ - getAuthToken: function getAuthToken(options, callback) { - if (typeof options === 'function' && callback === undefined) { - callback = options; - options = {}; - } - var self = this; - var hasCallback = typeof callback === 'function'; - // merge options with existing options - options = AWS.util.merge(this.options, options); - // validate options - var optionsValidation = this.validateAuthTokenOptions(options); - if (optionsValidation !== true) { - if (hasCallback) { - return callback(optionsValidation, null); - } - throw optionsValidation; - } - - // 15 minutes - var expires = 900; - // create service to generate a request from - var serviceOptions = { - region: options.region, - endpoint: new AWS.Endpoint(options.hostname + ':' + options.port), - paramValidation: false, - signatureVersion: 'v4' - }; - if (options.credentials) { - serviceOptions.credentials = options.credentials; - } - service = new AWS.Service(serviceOptions); - // ensure the SDK is using sigv4 signing (config is not enough) - service.api = api; - - var request = service.makeRequest(); - // add listeners to request to properly build auth token - this.modifyRequestForAuthToken(request, options); +Shape.resolve = function resolve(shape, options) { + if (shape.shape) { + var refShape = options.api.shapes[shape.shape]; + if (!refShape) { + throw new Error('Cannot find shape reference: ' + shape.shape); + } - if (hasCallback) { - request.presign(expires, function(err, url) { - if (url) { - url = self.convertUrlToAuthToken(url); - } - callback(err, url); - }); - } else { - var url = request.presign(expires); - return this.convertUrlToAuthToken(url); - } - }, + return refShape; + } else { + return null; + } +}; - /** - * @api private - * Modifies a request to allow the presigner to generate an auth token. - */ - modifyRequestForAuthToken: function modifyRequestForAuthToken(request, options) { - request.on('build', request.buildAsGet); - var httpRequest = request.httpRequest; - httpRequest.body = AWS.util.queryParamsToString({ - Action: 'connect', - DBUser: options.username - }); - }, +Shape.create = function create(shape, options, memberName) { + if (shape.isShape) return shape; - /** - * @api private - * Validates that the options passed in contain all the keys with values of the correct type that - * are needed to generate an auth token. - */ - validateAuthTokenOptions: function validateAuthTokenOptions(options) { - // iterate over all keys in options - var message = ''; - options = options || {}; - for (var key in requiredAuthTokenOptions) { - if (!Object.prototype.hasOwnProperty.call(requiredAuthTokenOptions, key)) { - continue; - } - if (typeof options[key] !== requiredAuthTokenOptions[key]) { - message += 'option \'' + key + '\' should have been type \'' + requiredAuthTokenOptions[key] + '\', was \'' + typeof options[key] + '\'.\n'; - } - } - if (message.length) { - return AWS.util.error(new Error(), { - code: 'InvalidParameter', - message: message - }); - } - return true; + var refShape = Shape.resolve(shape, options); + if (refShape) { + var filteredKeys = Object.keys(shape); + if (!options.documentation) { + filteredKeys = filteredKeys.filter(function(name) { + return !name.match(/documentation/); + }); } -}); + // create an inline shape with extra members + var InlineShape = function() { + refShape.constructor.call(this, shape, options, memberName); + }; + InlineShape.prototype = refShape; + return new InlineShape(); + } else { + // set type if not set + if (!shape.type) { + if (shape.members) shape.type = 'structure'; + else if (shape.member) shape.type = 'list'; + else if (shape.key) shape.type = 'map'; + else shape.type = 'string'; + } -/***/ }), - -/***/ 81370: -/***/ ((module) => { + // normalize types + var origType = shape.type; + if (Shape.normalizedTypes[shape.type]) { + shape.type = Shape.normalizedTypes[shape.type]; + } -module.exports = { - //provide realtime clock for performance measurement - now: function now() { - var second = process.hrtime(); - return second[0] * 1000 + (second[1] / 1000000); + if (Shape.types[shape.type]) { + return new Shape.types[shape.type](shape, options, memberName); + } else { + throw new Error('Unrecognized shape type: ' + origType); + } } }; +function CompositeShape(shape) { + Shape.apply(this, arguments); + property(this, 'isComposite', true); -/***/ }), - -/***/ 99517: -/***/ ((module) => { - -function isFipsRegion(region) { - return typeof region === 'string' && (region.startsWith('fips-') || region.endsWith('-fips')); + if (shape.flattened) { + property(this, 'flattened', shape.flattened || false); + } } -function isGlobalRegion(region) { - return typeof region === 'string' && ['aws-global', 'aws-us-gov-global'].includes(region); -} +function StructureShape(shape, options) { + var self = this; + var requiredMap = null, firstInit = !this.isShape; -function getRealRegion(region) { - return ['fips-aws-global', 'aws-fips', 'aws-global'].includes(region) - ? 'us-east-1' - : ['fips-aws-us-gov-global', 'aws-us-gov-global'].includes(region) - ? 'us-gov-west-1' - : region.replace(/fips-(dkr-|prod-)?|-fips/, ''); -} + CompositeShape.apply(this, arguments); -module.exports = { - isFipsRegion: isFipsRegion, - isGlobalRegion: isGlobalRegion, - getRealRegion: getRealRegion -}; + if (firstInit) { + property(this, 'defaultValue', function() { return {}; }); + property(this, 'members', {}); + property(this, 'memberNames', []); + property(this, 'required', []); + property(this, 'isRequired', function() { return false; }); + property(this, 'isDocument', Boolean(shape.document)); + } + if (shape.members) { + property(this, 'members', new Collection(shape.members, options, function(name, member) { + return Shape.create(member, options, name); + })); + memoizedProperty(this, 'memberNames', function() { + return shape.xmlOrder || Object.keys(shape.members); + }); -/***/ }), + if (shape.event) { + memoizedProperty(this, 'eventPayloadMemberName', function() { + var members = self.members; + var memberNames = self.memberNames; + // iterate over members to find ones that are event payloads + for (var i = 0, iLen = memberNames.length; i < iLen; i++) { + if (members[memberNames[i]].isEventPayload) { + return memberNames[i]; + } + } + }); -/***/ 18262: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + memoizedProperty(this, 'eventHeaderMemberNames', function() { + var members = self.members; + var memberNames = self.memberNames; + var eventHeaderMemberNames = []; + // iterate over members to find ones that are event headers + for (var i = 0, iLen = memberNames.length; i < iLen; i++) { + if (members[memberNames[i]].isEventHeader) { + eventHeaderMemberNames.push(memberNames[i]); + } + } + return eventHeaderMemberNames; + }); + } + } -var util = __nccwpck_require__(77985); -var regionConfig = __nccwpck_require__(80738); + if (shape.required) { + property(this, 'required', shape.required); + property(this, 'isRequired', function(name) { + if (!requiredMap) { + requiredMap = {}; + for (var i = 0; i < shape.required.length; i++) { + requiredMap[shape.required[i]] = true; + } + } -function generateRegionPrefix(region) { - if (!region) return null; - var parts = region.split('-'); - if (parts.length < 3) return null; - return parts.slice(0, parts.length - 2).join('-') + '-*'; -} + return requiredMap[name]; + }, false, true); + } -function derivedKeys(service) { - var region = service.config.region; - var regionPrefix = generateRegionPrefix(region); - var endpointPrefix = service.api.endpointPrefix; + property(this, 'resultWrapper', shape.resultWrapper || null); - return [ - [region, endpointPrefix], - [regionPrefix, endpointPrefix], - [region, '*'], - [regionPrefix, '*'], - ['*', endpointPrefix], - [region, 'internal-*'], - ['*', '*'] - ].map(function(item) { - return item[0] && item[1] ? item.join('/') : null; - }); -} + if (shape.payload) { + property(this, 'payload', shape.payload); + } -function applyConfig(service, config) { - util.each(config, function(key, value) { - if (key === 'globalEndpoint') return; - if (service.config[key] === undefined || service.config[key] === null) { - service.config[key] = value; - } - }); + if (typeof shape.xmlNamespace === 'string') { + property(this, 'xmlNamespaceUri', shape.xmlNamespace); + } else if (typeof shape.xmlNamespace === 'object') { + property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix); + property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri); + } } -function configureEndpoint(service) { - var keys = derivedKeys(service); - var useFipsEndpoint = service.config.useFipsEndpoint; - var useDualstackEndpoint = service.config.useDualstackEndpoint; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!key) continue; +function ListShape(shape, options) { + var self = this, firstInit = !this.isShape; + CompositeShape.apply(this, arguments); - var rules = useFipsEndpoint - ? useDualstackEndpoint - ? regionConfig.dualstackFipsRules - : regionConfig.fipsRules - : useDualstackEndpoint - ? regionConfig.dualstackRules - : regionConfig.rules; + if (firstInit) { + property(this, 'defaultValue', function() { return []; }); + } - if (Object.prototype.hasOwnProperty.call(rules, key)) { - var config = rules[key]; - if (typeof config === 'string') { - config = regionConfig.patterns[config]; - } + if (shape.member) { + memoizedProperty(this, 'member', function() { + return Shape.create(shape.member, options); + }); + } - // set global endpoint - service.isGlobalEndpoint = !!config.globalEndpoint; - if (config.signingRegion) { - service.signingRegion = config.signingRegion; - } + if (this.flattened) { + var oldName = this.name; + memoizedProperty(this, 'name', function() { + return self.member.name || oldName; + }); + } +} - // signature version - if (!config.signatureVersion) { - // Note: config is a global object and should not be mutated here. - // However, we are retaining this line for backwards compatibility. - // The non-v4 signatureVersion will be set in a copied object below. - config.signatureVersion = 'v4'; - } +function MapShape(shape, options) { + var firstInit = !this.isShape; + CompositeShape.apply(this, arguments); - var useBearer = (service.api && service.api.signatureVersion) === 'bearer'; + if (firstInit) { + property(this, 'defaultValue', function() { return {}; }); + property(this, 'key', Shape.create({type: 'string'}, options)); + property(this, 'value', Shape.create({type: 'string'}, options)); + } - // merge config - applyConfig(service, Object.assign( - {}, - config, - { signatureVersion: useBearer ? 'bearer' : config.signatureVersion } - )); - return; - } + if (shape.key) { + memoizedProperty(this, 'key', function() { + return Shape.create(shape.key, options); + }); + } + if (shape.value) { + memoizedProperty(this, 'value', function() { + return Shape.create(shape.value, options); + }); } } -function getEndpointSuffix(region) { - var regionRegexes = { - '^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$': 'amazonaws.com', - '^cn\\-\\w+\\-\\d+$': 'amazonaws.com.cn', - '^us\\-gov\\-\\w+\\-\\d+$': 'amazonaws.com', - '^us\\-iso\\-\\w+\\-\\d+$': 'c2s.ic.gov', - '^us\\-isob\\-\\w+\\-\\d+$': 'sc2s.sgov.gov' - }; - var defaultSuffix = 'amazonaws.com'; - var regexes = Object.keys(regionRegexes); - for (var i = 0; i < regexes.length; i++) { - var regionPattern = RegExp(regexes[i]); - var dnsSuffix = regionRegexes[regexes[i]]; - if (regionPattern.test(region)) return dnsSuffix; +function TimestampShape(shape) { + var self = this; + Shape.apply(this, arguments); + + if (shape.timestampFormat) { + property(this, 'timestampFormat', shape.timestampFormat); + } else if (self.isTimestampFormatSet && this.timestampFormat) { + property(this, 'timestampFormat', this.timestampFormat); + } else if (this.location === 'header') { + property(this, 'timestampFormat', 'rfc822'); + } else if (this.location === 'querystring') { + property(this, 'timestampFormat', 'iso8601'); + } else if (this.api) { + switch (this.api.protocol) { + case 'json': + case 'rest-json': + property(this, 'timestampFormat', 'unixTimestamp'); + break; + case 'rest-xml': + case 'query': + case 'ec2': + property(this, 'timestampFormat', 'iso8601'); + break; + } } - return defaultSuffix; -} -/** - * @api private - */ -module.exports = { - configureEndpoint: configureEndpoint, - getEndpointSuffix: getEndpointSuffix, -}; + this.toType = function(value) { + if (value === null || value === undefined) return null; + if (typeof value.toUTCString === 'function') return value; + return typeof value === 'string' || typeof value === 'number' ? + util.date.parseTimestamp(value) : null; + }; + this.toWireFormat = function(value) { + return util.date.format(value, self.timestampFormat); + }; +} -/***/ }), +function StringShape() { + Shape.apply(this, arguments); -/***/ 78652: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + var nullLessProtocols = ['rest-xml', 'query', 'ec2']; + this.toType = function(value) { + value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ? + value || '' : value; + if (this.isJsonValue) { + return JSON.parse(value); + } -var AWS = __nccwpck_require__(28437); -var AcceptorStateMachine = __nccwpck_require__(68118); -var inherit = AWS.util.inherit; -var domain = AWS.util.domain; -var jmespath = __nccwpck_require__(87783); + return value && typeof value.toString === 'function' ? + value.toString() : value; + }; -/** - * @api private - */ -var hardErrorStates = {success: 1, error: 1, complete: 1}; + this.toWireFormat = function(value) { + return this.isJsonValue ? JSON.stringify(value) : value; + }; +} -function isTerminalState(machine) { - return Object.prototype.hasOwnProperty.call(hardErrorStates, machine._asm.currentState); +function FloatShape() { + Shape.apply(this, arguments); + + this.toType = function(value) { + if (value === null || value === undefined) return null; + return parseFloat(value); + }; + this.toWireFormat = this.toType; } -var fsm = new AcceptorStateMachine(); -fsm.setupStates = function() { - var transition = function(_, done) { - var self = this; - self._haltHandlersOnError = false; +function IntegerShape() { + Shape.apply(this, arguments); - self.emit(self._asm.currentState, function(err) { - if (err) { - if (isTerminalState(self)) { - if (domain && self.domain instanceof domain.Domain) { - err.domainEmitter = self; - err.domain = self.domain; - err.domainThrown = false; - self.domain.emit('error', err); - } else { - throw err; - } - } else { - self.response.error = err; - done(err); - } - } else { - done(self.response.error); - } - }); + this.toType = function(value) { + if (value === null || value === undefined) return null; + return parseInt(value, 10); + }; + this.toWireFormat = this.toType; +} +function BinaryShape() { + Shape.apply(this, arguments); + this.toType = function(value) { + var buf = util.base64.decode(value); + if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') { + /* Node.js can create a Buffer that is not isolated. + * i.e. buf.byteLength !== buf.buffer.byteLength + * This means that the sensitive data is accessible to anyone with access to buf.buffer. + * If this is the node shared Buffer, then other code within this process _could_ find this secret. + * Copy sensitive data to an isolated Buffer and zero the sensitive data. + * While this is safe to do here, copying this code somewhere else may produce unexpected results. + */ + var secureBuf = util.Buffer.alloc(buf.length, buf); + buf.fill(0); + buf = secureBuf; + } + return buf; }; + this.toWireFormat = util.base64.encode; +} - this.addState('validate', 'build', 'error', transition); - this.addState('build', 'afterBuild', 'restart', transition); - this.addState('afterBuild', 'sign', 'restart', transition); - this.addState('sign', 'send', 'retry', transition); - this.addState('retry', 'afterRetry', 'afterRetry', transition); - this.addState('afterRetry', 'sign', 'error', transition); - this.addState('send', 'validateResponse', 'retry', transition); - this.addState('validateResponse', 'extractData', 'extractError', transition); - this.addState('extractError', 'extractData', 'retry', transition); - this.addState('extractData', 'success', 'retry', transition); - this.addState('restart', 'build', 'error', transition); - this.addState('success', 'complete', 'complete', transition); - this.addState('error', 'complete', 'complete', transition); - this.addState('complete', null, null, transition); -}; -fsm.setupStates(); +function Base64Shape() { + BinaryShape.apply(this, arguments); +} -/** - * ## Asynchronous Requests - * - * All requests made through the SDK are asynchronous and use a - * callback interface. Each service method that kicks off a request - * returns an `AWS.Request` object that you can use to register - * callbacks. - * - * For example, the following service method returns the request - * object as "request", which can be used to register callbacks: - * - * ```javascript - * // request is an AWS.Request object - * var request = ec2.describeInstances(); - * - * // register callbacks on request to retrieve response data - * request.on('success', function(response) { - * console.log(response.data); - * }); - * ``` - * - * When a request is ready to be sent, the {send} method should - * be called: - * - * ```javascript - * request.send(); - * ``` - * - * Since registered callbacks may or may not be idempotent, requests should only - * be sent once. To perform the same operation multiple times, you will need to - * create multiple request objects, each with its own registered callbacks. - * - * ## Removing Default Listeners for Events - * - * Request objects are built with default listeners for the various events, - * depending on the service type. In some cases, you may want to remove - * some built-in listeners to customize behaviour. Doing this requires - * access to the built-in listener functions, which are exposed through - * the {AWS.EventListeners.Core} namespace. For instance, you may - * want to customize the HTTP handler used when sending a request. In this - * case, you can remove the built-in listener associated with the 'send' - * event, the {AWS.EventListeners.Core.SEND} listener and add your own. - * - * ## Multiple Callbacks and Chaining - * - * You can register multiple callbacks on any request object. The - * callbacks can be registered for different events, or all for the - * same event. In addition, you can chain callback registration, for - * example: - * - * ```javascript - * request. - * on('success', function(response) { - * console.log("Success!"); - * }). - * on('error', function(error, response) { - * console.log("Error!"); - * }). - * on('complete', function(response) { - * console.log("Always!"); - * }). - * send(); - * ``` - * - * The above example will print either "Success! Always!", or "Error! Always!", - * depending on whether the request succeeded or not. - * - * @!attribute httpRequest - * @readonly - * @!group HTTP Properties - * @return [AWS.HttpRequest] the raw HTTP request object - * containing request headers and body information - * sent by the service. - * - * @!attribute startTime - * @readonly - * @!group Operation Properties - * @return [Date] the time that the request started - * - * @!group Request Building Events - * - * @!event validate(request) - * Triggered when a request is being validated. Listeners - * should throw an error if the request should not be sent. - * @param request [Request] the request object being sent - * @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS - * @see AWS.EventListeners.Core.VALIDATE_REGION - * @example Ensuring that a certain parameter is set before sending a request - * var req = s3.putObject(params); - * req.on('validate', function() { - * if (!req.params.Body.match(/^Hello\s/)) { - * throw new Error('Body must start with "Hello "'); - * } - * }); - * req.send(function(err, data) { ... }); - * - * @!event build(request) - * Triggered when the request payload is being built. Listeners - * should fill the necessary information to send the request - * over HTTP. - * @param (see AWS.Request~validate) - * @example Add a custom HTTP header to a request - * var req = s3.putObject(params); - * req.on('build', function() { - * req.httpRequest.headers['Custom-Header'] = 'value'; - * }); - * req.send(function(err, data) { ... }); - * - * @!event sign(request) - * Triggered when the request is being signed. Listeners should - * add the correct authentication headers and/or adjust the body, - * depending on the authentication mechanism being used. - * @param (see AWS.Request~validate) - * - * @!group Request Sending Events - * - * @!event send(response) - * Triggered when the request is ready to be sent. Listeners - * should call the underlying transport layer to initiate - * the sending of the request. - * @param response [Response] the response object - * @context [Request] the request object that was sent - * @see AWS.EventListeners.Core.SEND - * - * @!event retry(response) - * Triggered when a request failed and might need to be retried or redirected. - * If the response is retryable, the listener should set the - * `response.error.retryable` property to `true`, and optionally set - * `response.error.retryDelay` to the millisecond delay for the next attempt. - * In the case of a redirect, `response.error.redirect` should be set to - * `true` with `retryDelay` set to an optional delay on the next request. - * - * If a listener decides that a request should not be retried, - * it should set both `retryable` and `redirect` to false. - * - * Note that a retryable error will be retried at most - * {AWS.Config.maxRetries} times (based on the service object's config). - * Similarly, a request that is redirected will only redirect at most - * {AWS.Config.maxRedirects} times. - * - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * @example Adding a custom retry for a 404 response - * request.on('retry', function(response) { - * // this resource is not yet available, wait 10 seconds to get it again - * if (response.httpResponse.statusCode === 404 && response.error) { - * response.error.retryable = true; // retry this error - * response.error.retryDelay = 10000; // wait 10 seconds - * } - * }); - * - * @!group Data Parsing Events - * - * @!event extractError(response) - * Triggered on all non-2xx requests so that listeners can extract - * error details from the response body. Listeners to this event - * should set the `response.error` property. - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * - * @!event extractData(response) - * Triggered in successful requests to allow listeners to - * de-serialize the response body into `response.data`. - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * - * @!group Completion Events - * - * @!event success(response) - * Triggered when the request completed successfully. - * `response.data` will contain the response data and - * `response.error` will be null. - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * - * @!event error(error, response) - * Triggered when an error occurs at any point during the - * request. `response.error` will contain details about the error - * that occurred. `response.data` will be null. - * @param error [Error] the error object containing details about - * the error that occurred. - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * - * @!event complete(response) - * Triggered whenever a request cycle completes. `response.error` - * should be checked, since the request may have failed. - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * - * @!group HTTP Events - * - * @!event httpHeaders(statusCode, headers, response, statusMessage) - * Triggered when headers are sent by the remote server - * @param statusCode [Integer] the HTTP response code - * @param headers [map] the response headers - * @param (see AWS.Request~send) - * @param statusMessage [String] A status message corresponding to the HTTP - * response code - * @context (see AWS.Request~send) - * - * @!event httpData(chunk, response) - * Triggered when data is sent by the remote server - * @param chunk [Buffer] the buffer data containing the next data chunk - * from the server - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * @see AWS.EventListeners.Core.HTTP_DATA - * - * @!event httpUploadProgress(progress, response) - * Triggered when the HTTP request has uploaded more data - * @param progress [map] An object containing the `loaded` and `total` bytes - * of the request. - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * @note This event will not be emitted in Node.js 0.8.x. - * - * @!event httpDownloadProgress(progress, response) - * Triggered when the HTTP request has downloaded more data - * @param progress [map] An object containing the `loaded` and `total` bytes - * of the request. - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * @note This event will not be emitted in Node.js 0.8.x. - * - * @!event httpError(error, response) - * Triggered when the HTTP request failed - * @param error [Error] the error object that was thrown - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * - * @!event httpDone(response) - * Triggered when the server is finished sending data - * @param (see AWS.Request~send) - * @context (see AWS.Request~send) - * - * @see AWS.Response +function BooleanShape() { + Shape.apply(this, arguments); + + this.toType = function(value) { + if (typeof value === 'boolean') return value; + if (value === null || value === undefined) return null; + return value === 'true'; + }; +} + +/** + * @api private */ -AWS.Request = inherit({ +Shape.shapes = { + StructureShape: StructureShape, + ListShape: ListShape, + MapShape: MapShape, + StringShape: StringShape, + BooleanShape: BooleanShape, + Base64Shape: Base64Shape +}; - /** - * Creates a request for an operation on a given service with - * a set of input parameters. - * - * @param service [AWS.Service] the service to perform the operation on - * @param operation [String] the operation to perform on the service - * @param params [Object] parameters to send to the operation. - * See the operation's documentation for the format of the - * parameters. - */ - constructor: function Request(service, operation, params) { - var endpoint = service.endpoint; - var region = service.config.region; - var customUserAgent = service.config.customUserAgent; +/** + * @api private + */ +module.exports = Shape; - if (service.signingRegion) { - region = service.signingRegion; - } else if (service.isGlobalEndpoint) { - region = 'us-east-1'; - } - this.domain = domain && domain.active; - this.service = service; - this.operation = operation; - this.params = params || {}; - this.httpRequest = new AWS.HttpRequest(endpoint, region); - this.httpRequest.appendToUserAgent(customUserAgent); - this.startTime = service.getSkewCorrectedDate(); +/***/ }), - this.response = new AWS.Response(this); - this._asm = new AcceptorStateMachine(fsm.states, 'validate'); - this._haltHandlersOnError = false; +/***/ 73639: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - AWS.SequentialExecutor.call(this); - this.emit = this.emitEvent; - }, +var util = __nccwpck_require__(77985); - /** - * @!group Sending a Request - */ +var region_utils = __nccwpck_require__(99517); +var isFipsRegion = region_utils.isFipsRegion; +var getRealRegion = region_utils.getRealRegion; - /** - * @overload send(callback = null) - * Sends the request object. - * - * @callback callback function(err, data) - * If a callback is supplied, it is called when a response is returned - * from the service. - * @context [AWS.Request] the request object being sent. - * @param err [Error] the error object returned from the request. - * Set to `null` if the request is successful. - * @param data [Object] the de-serialized data returned from - * the request. Set to `null` if a request error occurs. - * @example Sending a request with a callback - * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); - * request.send(function(err, data) { console.log(err, data); }); - * @example Sending a request with no callback (using event handlers) - * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); - * request.on('complete', function(response) { ... }); // register a callback - * request.send(); - */ - send: function send(callback) { - if (callback) { - // append to user agent - this.httpRequest.appendToUserAgent('callback'); - this.on('complete', function (resp) { - callback.call(resp, resp.error, resp.data); - }); - } - this.runTo(); +util.isBrowser = function() { return false; }; +util.isNode = function() { return true; }; - return this.response; - }, +// node.js specific modules +util.crypto.lib = __nccwpck_require__(6113); +util.Buffer = (__nccwpck_require__(14300).Buffer); +util.domain = __nccwpck_require__(13639); +util.stream = __nccwpck_require__(12781); +util.url = __nccwpck_require__(57310); +util.querystring = __nccwpck_require__(63477); +util.environment = 'nodejs'; +util.createEventStream = util.stream.Readable ? + (__nccwpck_require__(69643).createEventStream) : (__nccwpck_require__(63727).createEventStream); +util.realClock = __nccwpck_require__(81370); +util.clientSideMonitoring = { + Publisher: (__nccwpck_require__(66807).Publisher), + configProvider: __nccwpck_require__(91822), +}; +util.iniLoader = (__nccwpck_require__(29697)/* .iniLoader */ .b); +util.getSystemErrorName = (__nccwpck_require__(73837).getSystemErrorName); - /** - * @!method promise() - * Sends the request and returns a 'thenable' promise. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function(data) - * Called if the promise is fulfilled. - * @param data [Object] the de-serialized data returned from the request. - * @callback rejectedCallback function(error) - * Called if the promise is rejected. - * @param error [Error] the error object returned from the request. - * @return [Promise] A promise that represents the state of the request. - * @example Sending a request using promises. - * var request = s3.putObject({Bucket: 'bucket', Key: 'key'}); - * var result = request.promise(); - * result.then(function(data) { ... }, function(error) { ... }); - */ +util.loadConfig = function(options) { + var envValue = options.environmentVariableSelector(process.env); + if (envValue !== undefined) { + return envValue; + } - /** - * @api private - */ - build: function build(callback) { - return this.runTo('send', callback); - }, + var configFile = {}; + try { + configFile = util.iniLoader ? util.iniLoader.loadFrom({ + isConfig: true, + filename: process.env[util.sharedConfigFileEnv] + }) : {}; + } catch (e) {} + var sharedFileConfig = configFile[ + process.env.AWS_PROFILE || util.defaultProfile + ] || {}; + var configValue = options.configFileSelector(sharedFileConfig); + if (configValue !== undefined) { + return configValue; + } - /** - * @api private - */ - runTo: function runTo(state, done) { - this._asm.runTo(state, done, this); - return this; - }, + if (typeof options.default === 'function') { + return options.default(); + } + return options.default; +}; - /** - * Aborts a request, emitting the error and complete events. - * - * @!macro nobrowser - * @example Aborting a request after sending - * var params = { - * Bucket: 'bucket', Key: 'key', - * Body: Buffer.alloc(1024 * 1024 * 5) // 5MB payload - * }; - * var request = s3.putObject(params); - * request.send(function (err, data) { - * if (err) console.log("Error:", err.code, err.message); - * else console.log(data); - * }); - * - * // abort request in 1 second - * setTimeout(request.abort.bind(request), 1000); - * - * // prints "Error: RequestAbortedError Request aborted by user" - * @return [AWS.Request] the same request object, for chaining. - * @since v1.4.0 - */ - abort: function abort() { - this.removeAllListeners('validateResponse'); - this.removeAllListeners('extractError'); - this.on('validateResponse', function addAbortedError(resp) { - resp.error = AWS.util.error(new Error('Request aborted by user'), { - code: 'RequestAbortedError', retryable: false - }); - }); +var AWS; - if (this.httpRequest.stream && !this.httpRequest.stream.didCallback) { // abort HTTP stream - this.httpRequest.stream.abort(); - if (this.httpRequest._abortCallback) { - this.httpRequest._abortCallback(); - } else { - this.removeAllListeners('send'); // haven't sent yet, so let's not - } - } +/** + * @api private + */ +module.exports = AWS = __nccwpck_require__(28437); - return this; - }, +__nccwpck_require__(53819); +__nccwpck_require__(36965); +__nccwpck_require__(77360); +__nccwpck_require__(57083); +__nccwpck_require__(74998); +__nccwpck_require__(3498); +__nccwpck_require__(15037); +__nccwpck_require__(80371); - /** - * Iterates over each page of results given a pageable request, calling - * the provided callback with each page of data. After all pages have been - * retrieved, the callback is called with `null` data. - * - * @note This operation can generate multiple requests to a service. - * @example Iterating over multiple pages of objects in an S3 bucket - * var pages = 1; - * s3.listObjects().eachPage(function(err, data) { - * if (err) return; - * console.log("Page", pages++); - * console.log(data); - * }); - * @example Iterating over multiple pages with an asynchronous callback - * s3.listObjects(params).eachPage(function(err, data, done) { - * doSomethingAsyncAndOrExpensive(function() { - * // The next page of results isn't fetched until done is called - * done(); - * }); - * }); - * @callback callback function(err, data, [doneCallback]) - * Called with each page of resulting data from the request. If the - * optional `doneCallback` is provided in the function, it must be called - * when the callback is complete. - * - * @param err [Error] an error object, if an error occurred. - * @param data [Object] a single page of response data. If there is no - * more data, this object will be `null`. - * @param doneCallback [Function] an optional done callback. If this - * argument is defined in the function declaration, it should be called - * when the next page is ready to be retrieved. This is useful for - * controlling serial pagination across asynchronous operations. - * @return [Boolean] if the callback returns `false`, pagination will - * stop. - * - * @see AWS.Request.eachItem - * @see AWS.Response.nextPage - * @since v1.4.0 - */ - eachPage: function eachPage(callback) { - // Make all callbacks async-ish - callback = AWS.util.fn.makeAsync(callback, 3); +// Load the xml2js XML parser +AWS.XML.Parser = __nccwpck_require__(96752); - function wrappedCallback(response) { - callback.call(response, response.error, response.data, function (result) { - if (result === false) return; +// Load Node HTTP client +__nccwpck_require__(2310); - if (response.hasNextPage()) { - response.nextPage().on('complete', wrappedCallback).send(); - } else { - callback.call(response, null, null, AWS.util.fn.noop); - } - }); - } +__nccwpck_require__(95417); - this.on('complete', wrappedCallback).send(); - }, +// Load custom credential providers +__nccwpck_require__(11017); +__nccwpck_require__(73379); +__nccwpck_require__(88764); +__nccwpck_require__(10645); +__nccwpck_require__(57714); +__nccwpck_require__(27454); +__nccwpck_require__(13754); +__nccwpck_require__(80371); +__nccwpck_require__(68335); - /** - * Enumerates over individual items of a request, paging the responses if - * necessary. - * - * @api experimental - * @since v1.4.0 - */ - eachItem: function eachItem(callback) { - var self = this; - function wrappedCallback(err, data) { - if (err) return callback(err, null); - if (data === null) return callback(null, null); +// Setup default providers for credentials chain +// If this changes, please update documentation for +// AWS.CredentialProviderChain.defaultProviders in +// credentials/credential_provider_chain.js +AWS.CredentialProviderChain.defaultProviders = [ + function () { return new AWS.EnvironmentCredentials('AWS'); }, + function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + function () { return new AWS.SsoCredentials(); }, + function () { return new AWS.SharedIniFileCredentials(); }, + function () { return new AWS.ECSCredentials(); }, + function () { return new AWS.ProcessCredentials(); }, + function () { return new AWS.TokenFileWebIdentityCredentials(); }, + function () { return new AWS.EC2MetadataCredentials(); } +]; - var config = self.service.paginationConfig(self.operation); - var resultKey = config.resultKey; - if (Array.isArray(resultKey)) resultKey = resultKey[0]; - var items = jmespath.search(data, resultKey); - var continueIteration = true; - AWS.util.arrayEach(items, function(item) { - continueIteration = callback(null, item); - if (continueIteration === false) { - return AWS.util.abort; - } - }); - return continueIteration; +// Load custom token providers +__nccwpck_require__(82647); +__nccwpck_require__(50126); +__nccwpck_require__(90327); + +// Setup default providers for token chain +// If this changes, please update documentation for +// AWS.TokenProviderChain.defaultProviders in +// token/token_provider_chain.js +AWS.TokenProviderChain.defaultProviders = [ + function () { return new AWS.SSOTokenProvider(); }, +]; + +var getRegion = function() { + var env = process.env; + var region = env.AWS_REGION || env.AMAZON_REGION; + if (env[AWS.util.configOptInEnv]) { + var toCheck = [ + {filename: env[AWS.util.sharedCredentialsFileEnv]}, + {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]} + ]; + var iniLoader = AWS.util.iniLoader; + while (!region && toCheck.length) { + var configFile = {}; + var fileInfo = toCheck.shift(); + try { + configFile = iniLoader.loadFrom(fileInfo); + } catch (err) { + if (fileInfo.isConfig) throw err; + } + var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile]; + region = profile && profile.region; } + } + return region; +}; - this.eachPage(wrappedCallback); +var getBooleanValue = function(value) { + return value === 'true' ? true: value === 'false' ? false: undefined; +}; + +var USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: function(env) { + return getBooleanValue(env['AWS_USE_FIPS_ENDPOINT']); + }, + configFileSelector: function(profile) { + return getBooleanValue(profile['use_fips_endpoint']); }, + default: false, +}; - /** - * @return [Boolean] whether the operation can return multiple pages of - * response data. - * @see AWS.Response.eachPage - * @since v1.4.0 - */ - isPageable: function isPageable() { - return this.service.paginationConfig(this.operation) ? true : false; +var USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: function(env) { + return getBooleanValue(env['AWS_USE_DUALSTACK_ENDPOINT']); + }, + configFileSelector: function(profile) { + return getBooleanValue(profile['use_dualstack_endpoint']); + }, + default: false, +}; + +// Update configuration keys +AWS.util.update(AWS.Config.prototype.keys, { + credentials: function () { + var credentials = null; + new AWS.CredentialProviderChain([ + function () { return new AWS.EnvironmentCredentials('AWS'); }, + function () { return new AWS.EnvironmentCredentials('AMAZON'); }, + function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); } + ]).resolve(function(err, creds) { + if (!err) credentials = creds; + }); + return credentials; + }, + credentialProvider: function() { + return new AWS.CredentialProviderChain(); + }, + logger: function () { + return process.env.AWSJS_DEBUG ? console : null; + }, + region: function() { + var region = getRegion(); + return region ? getRealRegion(region): undefined; + }, + tokenProvider: function() { + return new AWS.TokenProviderChain(); + }, + useFipsEndpoint: function() { + var region = getRegion(); + return isFipsRegion(region) + ? true + : util.loadConfig(USE_FIPS_ENDPOINT_CONFIG_OPTIONS); }, + useDualstackEndpoint: function() { + return util.loadConfig(USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS); + } +}); + +// Reset configuration +AWS.config = new AWS.Config(); + + +/***/ }), + +/***/ 99127: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +var AWS = __nccwpck_require__(28437); + +/** + * @api private + */ +AWS.ParamValidator = AWS.util.inherit({ /** - * Sends the request and converts the request object into a readable stream - * that can be read from or piped into a writable stream. + * Create a new validator object. * - * @note The data read from a readable stream contains only - * the raw HTTP body contents. - * @example Manually reading from a stream - * request.createReadStream().on('data', function(data) { - * console.log("Got data:", data.toString()); - * }); - * @example Piping a request body into a file - * var out = fs.createWriteStream('/path/to/outfile.jpg'); - * s3.service.getObject(params).createReadStream().pipe(out); - * @return [Stream] the readable stream object that can be piped - * or read from (by registering 'data' event listeners). - * @!macro nobrowser + * @param validation [Boolean|map] whether input parameters should be + * validated against the operation description before sending the + * request. Pass a map to enable any of the following specific + * validation features: + * + * * **min** [Boolean] — Validates that a value meets the min + * constraint. This is enabled by default when paramValidation is set + * to `true`. + * * **max** [Boolean] — Validates that a value meets the max + * constraint. + * * **pattern** [Boolean] — Validates that a string value matches a + * regular expression. + * * **enum** [Boolean] — Validates that a string value matches one + * of the allowable enum values. */ - createReadStream: function createReadStream() { - var streams = AWS.util.stream; - var req = this; - var stream = null; + constructor: function ParamValidator(validation) { + if (validation === true || validation === undefined) { + validation = {'min': true}; + } + this.validation = validation; + }, - if (AWS.HttpClient.streamsApiVersion === 2) { - stream = new streams.PassThrough(); - process.nextTick(function() { req.send(); }); - } else { - stream = new streams.Stream(); - stream.readable = true; + validate: function validate(shape, params, context) { + this.errors = []; + this.validateMember(shape, params || {}, context || 'params'); - stream.sent = false; - stream.on('newListener', function(event) { - if (!stream.sent && event === 'data') { - stream.sent = true; - process.nextTick(function() { req.send(); }); - } - }); + if (this.errors.length > 1) { + var msg = this.errors.join('\n* '); + msg = 'There were ' + this.errors.length + + ' validation errors:\n* ' + msg; + throw AWS.util.error(new Error(msg), + {code: 'MultipleValidationErrors', errors: this.errors}); + } else if (this.errors.length === 1) { + throw this.errors[0]; + } else { + return true; } + }, - this.on('error', function(err) { - stream.emit('error', err); - }); + fail: function fail(code, message) { + this.errors.push(AWS.util.error(new Error(message), {code: code})); + }, - this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) { - if (statusCode < 300) { - req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA); - req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR); - req.on('httpError', function streamHttpError(error) { - resp.error = error; - resp.error.retryable = false; - }); + validateStructure: function validateStructure(shape, params, context) { + if (shape.isDocument) return true; - var shouldCheckContentLength = false; - var expectedLen; - if (req.httpRequest.method !== 'HEAD') { - expectedLen = parseInt(headers['content-length'], 10); - } - if (expectedLen !== undefined && !isNaN(expectedLen) && expectedLen >= 0) { - shouldCheckContentLength = true; - var receivedLen = 0; - } + this.validateType(params, context, ['object'], 'structure'); + var paramName; + for (var i = 0; shape.required && i < shape.required.length; i++) { + paramName = shape.required[i]; + var value = params[paramName]; + if (value === undefined || value === null) { + this.fail('MissingRequiredParameter', + 'Missing required key \'' + paramName + '\' in ' + context); + } + } - var checkContentLengthAndEmit = function checkContentLengthAndEmit() { - if (shouldCheckContentLength && receivedLen !== expectedLen) { - stream.emit('error', AWS.util.error( - new Error('Stream content length mismatch. Received ' + - receivedLen + ' of ' + expectedLen + ' bytes.'), - { code: 'StreamContentLengthMismatch' } - )); - } else if (AWS.HttpClient.streamsApiVersion === 2) { - stream.end(); - } else { - stream.emit('end'); - } - }; + // validate hash members + for (paramName in params) { + if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue; - var httpStream = resp.httpResponse.createUnbufferedStream(); + var paramValue = params[paramName], + memberShape = shape.members[paramName]; - if (AWS.HttpClient.streamsApiVersion === 2) { - if (shouldCheckContentLength) { - var lengthAccumulator = new streams.PassThrough(); - lengthAccumulator._write = function(chunk) { - if (chunk && chunk.length) { - receivedLen += chunk.length; - } - return streams.PassThrough.prototype._write.apply(this, arguments); - }; + if (memberShape !== undefined) { + var memberContext = [context, paramName].join('.'); + this.validateMember(memberShape, paramValue, memberContext); + } else if (paramValue !== undefined && paramValue !== null) { + this.fail('UnexpectedParameter', + 'Unexpected key \'' + paramName + '\' found in ' + context); + } + } - lengthAccumulator.on('end', checkContentLengthAndEmit); - stream.on('error', function(err) { - shouldCheckContentLength = false; - httpStream.unpipe(lengthAccumulator); - lengthAccumulator.emit('end'); - lengthAccumulator.end(); - }); - httpStream.pipe(lengthAccumulator).pipe(stream, { end: false }); - } else { - httpStream.pipe(stream); - } - } else { + return true; + }, - if (shouldCheckContentLength) { - httpStream.on('data', function(arg) { - if (arg && arg.length) { - receivedLen += arg.length; - } - }); - } + validateMember: function validateMember(shape, param, context) { + switch (shape.type) { + case 'structure': + return this.validateStructure(shape, param, context); + case 'list': + return this.validateList(shape, param, context); + case 'map': + return this.validateMap(shape, param, context); + default: + return this.validateScalar(shape, param, context); + } + }, - httpStream.on('data', function(arg) { - stream.emit('data', arg); - }); - httpStream.on('end', checkContentLengthAndEmit); - } + validateList: function validateList(shape, params, context) { + if (this.validateType(params, context, [Array])) { + this.validateRange(shape, params.length, context, 'list member count'); + // validate array members + for (var i = 0; i < params.length; i++) { + this.validateMember(shape.member, params[i], context + '[' + i + ']'); + } + } + }, - httpStream.on('error', function(err) { - shouldCheckContentLength = false; - stream.emit('error', err); - }); + validateMap: function validateMap(shape, params, context) { + if (this.validateType(params, context, ['object'], 'map')) { + // Build up a count of map members to validate range traits. + var mapCount = 0; + for (var param in params) { + if (!Object.prototype.hasOwnProperty.call(params, param)) continue; + // Validate any map key trait constraints + this.validateMember(shape.key, param, + context + '[key=\'' + param + '\']'); + this.validateMember(shape.value, params[param], + context + '[\'' + param + '\']'); + mapCount++; } - }); + this.validateRange(shape, mapCount, context, 'map member count'); + } + }, - return stream; + validateScalar: function validateScalar(shape, value, context) { + switch (shape.type) { + case null: + case undefined: + case 'string': + return this.validateString(shape, value, context); + case 'base64': + case 'binary': + return this.validatePayload(value, context); + case 'integer': + case 'float': + return this.validateNumber(shape, value, context); + case 'boolean': + return this.validateType(value, context, ['boolean']); + case 'timestamp': + return this.validateType(value, context, [Date, + /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'number'], + 'Date object, ISO-8601 string, or a UNIX timestamp'); + default: + return this.fail('UnkownType', 'Unhandled type ' + + shape.type + ' for ' + context); + } }, - /** - * @param [Array,Response] args This should be the response object, - * or an array of args to send to the event. - * @api private - */ - emitEvent: function emit(eventName, args, done) { - if (typeof args === 'function') { done = args; args = null; } - if (!done) done = function() { }; - if (!args) args = this.eventParameters(eventName, this.response); + validateString: function validateString(shape, value, context) { + var validTypes = ['string']; + if (shape.isJsonValue) { + validTypes = validTypes.concat(['number', 'object', 'boolean']); + } + if (value !== null && this.validateType(value, context, validTypes)) { + this.validateEnum(shape, value, context); + this.validateRange(shape, value.length, context, 'string length'); + this.validatePattern(shape, value, context); + this.validateUri(shape, value, context); + } + }, - var origEmit = AWS.SequentialExecutor.prototype.emit; - origEmit.call(this, eventName, args, function (err) { - if (err) this.response.error = err; - done.call(this, err); - }); + validateUri: function validateUri(shape, value, context) { + if (shape['location'] === 'uri') { + if (value.length === 0) { + this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,' + + ' but found "' + value +'" for ' + context); + } + } }, - /** - * @api private - */ - eventParameters: function eventParameters(eventName) { - switch (eventName) { - case 'restart': - case 'validate': - case 'sign': - case 'build': - case 'afterValidate': - case 'afterBuild': - return [this]; - case 'error': - return [this.response.error, this.response]; - default: - return [this.response]; + validatePattern: function validatePattern(shape, value, context) { + if (this.validation['pattern'] && shape['pattern'] !== undefined) { + if (!(new RegExp(shape['pattern'])).test(value)) { + this.fail('PatternMatchError', 'Provided value "' + value + '" ' + + 'does not match regex pattern /' + shape['pattern'] + '/ for ' + + context); + } } }, - /** - * @api private - */ - presign: function presign(expires, callback) { - if (!callback && typeof expires === 'function') { - callback = expires; - expires = null; + validateRange: function validateRange(shape, value, context, descriptor) { + if (this.validation['min']) { + if (shape['min'] !== undefined && value < shape['min']) { + this.fail('MinRangeError', 'Expected ' + descriptor + ' >= ' + + shape['min'] + ', but found ' + value + ' for ' + context); + } + } + if (this.validation['max']) { + if (shape['max'] !== undefined && value > shape['max']) { + this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= ' + + shape['max'] + ', but found ' + value + ' for ' + context); + } } - return new AWS.Signers.Presign().sign(this.toGet(), expires, callback); }, - /** - * @api private - */ - isPresigned: function isPresigned() { - return Object.prototype.hasOwnProperty.call(this.httpRequest.headers, 'presigned-expires'); + validateEnum: function validateRange(shape, value, context) { + if (this.validation['enum'] && shape['enum'] !== undefined) { + // Fail if the string value is not present in the enum list + if (shape['enum'].indexOf(value) === -1) { + this.fail('EnumError', 'Found string value of ' + value + ', but ' + + 'expected ' + shape['enum'].join('|') + ' for ' + context); + } + } }, - /** - * @api private - */ - toUnauthenticated: function toUnauthenticated() { - this._unAuthenticated = true; - this.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS); - this.removeListener('sign', AWS.EventListeners.Core.SIGN); - return this; + validateType: function validateType(value, context, acceptedTypes, type) { + // We will not log an error for null or undefined, but we will return + // false so that callers know that the expected type was not strictly met. + if (value === null || value === undefined) return false; + + var foundInvalidType = false; + for (var i = 0; i < acceptedTypes.length; i++) { + if (typeof acceptedTypes[i] === 'string') { + if (typeof value === acceptedTypes[i]) return true; + } else if (acceptedTypes[i] instanceof RegExp) { + if ((value || '').toString().match(acceptedTypes[i])) return true; + } else { + if (value instanceof acceptedTypes[i]) return true; + if (AWS.util.isType(value, acceptedTypes[i])) return true; + if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice(); + acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]); + } + foundInvalidType = true; + } + + var acceptedType = type; + if (!acceptedType) { + acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1'); + } + + var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : ''; + this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' + + vowel + ' ' + acceptedType); + return false; }, - /** - * @api private - */ - toGet: function toGet() { - if (this.service.api.protocol === 'query' || - this.service.api.protocol === 'ec2') { - this.removeListener('build', this.buildAsGet); - this.addListener('build', this.buildAsGet); + validateNumber: function validateNumber(shape, value, context) { + if (value === null || value === undefined) return; + if (typeof value === 'string') { + var castedValue = parseFloat(value); + if (castedValue.toString() === value) value = castedValue; + } + if (this.validateType(value, context, ['number'])) { + this.validateRange(shape, value, context, 'numeric value'); } - return this; }, - /** - * @api private - */ - buildAsGet: function buildAsGet(request) { - request.httpRequest.method = 'GET'; - request.httpRequest.path = request.service.endpoint.path + - '?' + request.httpRequest.body; - request.httpRequest.body = ''; + validatePayload: function validatePayload(value, context) { + if (value === null || value === undefined) return; + if (typeof value === 'string') return; + if (value && typeof value.byteLength === 'number') return; // typed arrays + if (AWS.util.isNode()) { // special check for buffer/stream in Node.js + var Stream = AWS.util.stream.Stream; + if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return; + } else { + if (typeof Blob !== void 0 && value instanceof Blob) return; + } - // don't need these headers on a GET request - delete request.httpRequest.headers['Content-Length']; - delete request.httpRequest.headers['Content-Type']; - }, + var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView']; + if (value) { + for (var i = 0; i < types.length; i++) { + if (AWS.util.isType(value, types[i])) return; + if (AWS.util.typeName(value.constructor) === types[i]) return; + } + } - /** - * @api private - */ - haltHandlersOnError: function haltHandlersOnError() { - this._haltHandlersOnError = true; + this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' + + 'string, Buffer, Stream, Blob, or typed array object'); } }); + +/***/ }), + +/***/ 44086: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var rest = AWS.Protocol.Rest; + /** - * @api private + * A presigner object can be used to generate presigned urls for the Polly service. */ -AWS.Request.addPromisesToClass = function addPromisesToClass(PromiseDependency) { - this.prototype.promise = function promise() { - var self = this; - // append to user agent - this.httpRequest.appendToUserAgent('promise'); - return new PromiseDependency(function(resolve, reject) { - self.on('complete', function(resp) { - if (resp.error) { - reject(resp.error); +AWS.Polly.Presigner = AWS.util.inherit({ + /** + * Creates a presigner object with a set of configuration options. + * + * @option options params [map] An optional map of parameters to bind to every + * request sent by this service object. + * @option options service [AWS.Polly] An optional pre-configured instance + * of the AWS.Polly service object to use for requests. The object may + * bound parameters used by the presigner. + * @see AWS.Polly.constructor + */ + constructor: function Signer(options) { + options = options || {}; + this.options = options; + this.service = options.service; + this.bindServiceObject(options); + this._operations = {}; + }, + + /** + * @api private + */ + bindServiceObject: function bindServiceObject(options) { + options = options || {}; + if (!this.service) { + this.service = new AWS.Polly(options); } else { - // define $response property so that it is not enumerable - // this prevents circular reference errors when stringifying the JSON object - resolve(Object.defineProperty( - resp.data || {}, - '$response', - {value: resp} - )); + var config = AWS.util.copy(this.service.config); + this.service = new this.service.constructor.__super__(config); + this.service.config.params = AWS.util.merge(this.service.config.params || {}, options.params); } - }); - self.runTo(); - }); - }; -}; + }, -/** - * @api private - */ -AWS.Request.deletePromisesFromClass = function deletePromisesFromClass() { - delete this.prototype.promise; -}; + /** + * @api private + */ + modifyInputMembers: function modifyInputMembers(input) { + // make copies of the input so we don't overwrite the api + // need to be careful to copy anything we access/modify + var modifiedInput = AWS.util.copy(input); + modifiedInput.members = AWS.util.copy(input.members); + AWS.util.each(input.members, function(name, member) { + modifiedInput.members[name] = AWS.util.copy(member); + // update location and locationName + if (!member.location || member.location === 'body') { + modifiedInput.members[name].location = 'querystring'; + modifiedInput.members[name].locationName = name; + } + }); + return modifiedInput; + }, -AWS.util.addPromises(AWS.Request); + /** + * @api private + */ + convertPostToGet: function convertPostToGet(req) { + // convert method + req.httpRequest.method = 'GET'; -AWS.util.mixin(AWS.Request, AWS.SequentialExecutor); + var operation = req.service.api.operations[req.operation]; + // get cached operation input first + var input = this._operations[req.operation]; + if (!input) { + // modify the original input + this._operations[req.operation] = input = this.modifyInputMembers(operation.input); + } + + var uri = rest.generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); + + req.httpRequest.path = uri; + req.httpRequest.body = ''; + + // don't need these headers on a GET request + delete req.httpRequest.headers['Content-Length']; + delete req.httpRequest.headers['Content-Type']; + }, + + /** + * @overload getSynthesizeSpeechUrl(params = {}, [expires = 3600], [callback]) + * Generate a presigned url for {AWS.Polly.synthesizeSpeech}. + * @note You must ensure that you have static or previously resolved + * credentials if you call this method synchronously (with no callback), + * otherwise it may not properly sign the request. If you cannot guarantee + * this (you are using an asynchronous credential provider, i.e., EC2 + * IAM roles), you should always call this method with an asynchronous + * callback. + * @param params [map] parameters to pass to the operation. See the {AWS.Polly.synthesizeSpeech} + * operation for the expected operation parameters. + * @param expires [Integer] (3600) the number of seconds to expire the pre-signed URL operation in. + * Defaults to 1 hour. + * @return [string] if called synchronously (with no callback), returns the signed URL. + * @return [null] nothing is returned if a callback is provided. + * @callback callback function (err, url) + * If a callback is supplied, it is called when a signed URL has been generated. + * @param err [Error] the error object returned from the presigner. + * @param url [String] the signed URL. + * @see AWS.Polly.synthesizeSpeech + */ + getSynthesizeSpeechUrl: function getSynthesizeSpeechUrl(params, expires, callback) { + var self = this; + var request = this.service.makeRequest('synthesizeSpeech', params); + // remove existing build listeners + request.removeAllListeners('build'); + request.on('build', function(req) { + self.convertPostToGet(req); + }); + return request.presign(expires, callback); + } +}); /***/ }), -/***/ 39925: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 97969: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var util = __nccwpck_require__(77985); +var AWS = __nccwpck_require__(28437); + +/** + * Prepend prefix defined by API model to endpoint that's already + * constructed. This feature does not apply to operations using + * endpoint discovery and can be disabled. + * @api private + */ +function populateHostPrefix(request) { + var enabled = request.service.config.hostPrefixEnabled; + if (!enabled) return request; + var operationModel = request.service.api.operations[request.operation]; + //don't marshal host prefix when operation has endpoint discovery traits + if (hasEndpointDiscover(request)) return request; + if (operationModel.endpoint && operationModel.endpoint.hostPrefix) { + var hostPrefixNotation = operationModel.endpoint.hostPrefix; + var hostPrefix = expandHostPrefix(hostPrefixNotation, request.params, operationModel.input); + prependEndpointPrefix(request.httpRequest.endpoint, hostPrefix); + validateHostname(request.httpRequest.endpoint.hostname); + } + return request; +} /** - * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You - * may not use this file except in compliance with the License. A copy of - * the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF - * ANY KIND, either express or implied. See the License for the specific - * language governing permissions and limitations under the License. + * @api private */ - -var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; -var jmespath = __nccwpck_require__(87783); +function hasEndpointDiscover(request) { + var api = request.service.api; + var operationModel = api.operations[request.operation]; + var isEndpointOperation = api.endpointOperation && (api.endpointOperation === util.string.lowerFirst(operationModel.name)); + return (operationModel.endpointDiscoveryRequired !== 'NULL' || isEndpointOperation === true); +} /** * @api private */ -function CHECK_ACCEPTORS(resp) { - var waiter = resp.request._waiter; - var acceptors = waiter.config.acceptors; - var acceptorMatched = false; - var state = 'retry'; - - acceptors.forEach(function(acceptor) { - if (!acceptorMatched) { - var matcher = waiter.matchers[acceptor.matcher]; - if (matcher && matcher(resp, acceptor.expected, acceptor.argument)) { - acceptorMatched = true; - state = acceptor.state; +function expandHostPrefix(hostPrefixNotation, params, shape) { + util.each(shape.members, function(name, member) { + if (member.hostLabel === true) { + if (typeof params[name] !== 'string' || params[name] === '') { + throw util.error(new Error(), { + message: 'Parameter ' + name + ' should be a non-empty string.', + code: 'InvalidParameter' + }); } + var regex = new RegExp('\\{' + name + '\\}', 'g'); + hostPrefixNotation = hostPrefixNotation.replace(regex, params[name]); } }); + return hostPrefixNotation; +} - if (!acceptorMatched && resp.error) state = 'failure'; - - if (state === 'success') { - waiter.setSuccess(resp); - } else { - waiter.setError(resp, state === 'retry'); +/** + * @api private + */ +function prependEndpointPrefix(endpoint, prefix) { + if (endpoint.host) { + endpoint.host = prefix + endpoint.host; + } + if (endpoint.hostname) { + endpoint.hostname = prefix + endpoint.hostname; } } /** * @api private */ -AWS.ResourceWaiter = inherit({ - /** - * Waits for a given state on a service object - * @param service [Service] the service object to wait on - * @param state [String] the state (defined in waiter configuration) to wait - * for. - * @example Create a waiter for running EC2 instances - * var ec2 = new AWS.EC2; - * var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning'); - */ - constructor: function constructor(service, state) { - this.service = service; - this.state = state; - this.loadWaiterConfig(this.state); - }, - - service: null, - - state: null, - - config: null, +function validateHostname(hostname) { + var labels = hostname.split('.'); + //Reference: https://tools.ietf.org/html/rfc1123#section-2 + var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; + util.arrayEach(labels, function(label) { + if (!label.length || label.length < 1 || label.length > 63) { + throw util.error(new Error(), { + code: 'ValidationError', + message: 'Hostname label length should be between 1 to 63 characters, inclusive.' + }); + } + if (!hostPattern.test(label)) { + throw AWS.util.error(new Error(), + {code: 'ValidationError', message: label + ' is not hostname compatible.'}); + } + }); +} - matchers: { - path: function(resp, expected, argument) { - try { - var result = jmespath.search(resp.data, argument); - } catch (err) { - return false; - } +module.exports = { + populateHostPrefix: populateHostPrefix +}; - return jmespath.strictDeepEqual(result,expected); - }, - pathAll: function(resp, expected, argument) { - try { - var results = jmespath.search(resp.data, argument); - } catch (err) { - return false; - } +/***/ }), - if (!Array.isArray(results)) results = [results]; - var numResults = results.length; - if (!numResults) return false; - for (var ind = 0 ; ind < numResults; ind++) { - if (!jmespath.strictDeepEqual(results[ind], expected)) { - return false; - } - } - return true; - }, +/***/ 30083: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - pathAny: function(resp, expected, argument) { - try { - var results = jmespath.search(resp.data, argument); - } catch (err) { - return false; - } +var util = __nccwpck_require__(77985); +var JsonBuilder = __nccwpck_require__(47495); +var JsonParser = __nccwpck_require__(5474); +var populateHostPrefix = (__nccwpck_require__(97969).populateHostPrefix); - if (!Array.isArray(results)) results = [results]; - var numResults = results.length; - for (var ind = 0 ; ind < numResults; ind++) { - if (jmespath.strictDeepEqual(results[ind], expected)) { - return true; - } - } - return false; - }, +function buildRequest(req) { + var httpRequest = req.httpRequest; + var api = req.service.api; + var target = api.targetPrefix + '.' + api.operations[req.operation].name; + var version = api.jsonVersion || '1.0'; + var input = api.operations[req.operation].input; + var builder = new JsonBuilder(); - status: function(resp, expected) { - var statusCode = resp.httpResponse.statusCode; - return (typeof statusCode === 'number') && (statusCode === expected); - }, + if (version === 1) version = '1.0'; - error: function(resp, expected) { - if (typeof expected === 'string' && resp.error) { - return expected === resp.error.code; - } - // if expected is not string, can be boolean indicating presence of error - return expected === !!resp.error; + if (api.awsQueryCompatible) { + if (!httpRequest.params) { + httpRequest.params = {}; } - }, + // because Query protocol does this. + Object.assign(httpRequest.params, req.params); + } - listeners: new AWS.SequentialExecutor().addNamedListeners(function(add) { - add('RETRY_CHECK', 'retry', function(resp) { - var waiter = resp.request._waiter; - if (resp.error && resp.error.code === 'ResourceNotReady') { - resp.error.retryDelay = (waiter.config.delay || 0) * 1000; - } - }); + httpRequest.body = builder.build(req.params || {}, input); + httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version; + httpRequest.headers['X-Amz-Target'] = target; - add('CHECK_OUTPUT', 'extractData', CHECK_ACCEPTORS); + populateHostPrefix(req); +} - add('CHECK_ERROR', 'extractError', CHECK_ACCEPTORS); - }), +function extractError(resp) { + var error = {}; + var httpResponse = resp.httpResponse; - /** - * @return [AWS.Request] - */ - wait: function wait(params, callback) { - if (typeof params === 'function') { - callback = params; params = undefined; - } + error.code = httpResponse.headers['x-amzn-errortype'] || 'UnknownError'; + if (typeof error.code === 'string') { + error.code = error.code.split(':')[0]; + } - if (params && params.$waiter) { - params = AWS.util.copy(params); - if (typeof params.$waiter.delay === 'number') { - this.config.delay = params.$waiter.delay; + if (httpResponse.body.length > 0) { + try { + var e = JSON.parse(httpResponse.body.toString()); + + var code = e.__type || e.code || e.Code; + if (code) { + error.code = code.split('#').pop(); } - if (typeof params.$waiter.maxAttempts === 'number') { - this.config.maxAttempts = params.$waiter.maxAttempts; + if (error.code === 'RequestEntityTooLarge') { + error.message = 'Request body must be less than 1 MB'; + } else { + error.message = (e.message || e.Message || null); } - delete params.$waiter; - } - - var request = this.service.makeRequest(this.config.operation, params); - request._waiter = this; - request.response.maxRetries = this.config.maxAttempts; - request.addListeners(this.listeners); - - if (callback) request.send(callback); - return request; - }, - setSuccess: function setSuccess(resp) { - resp.error = null; - resp.data = resp.data || {}; - resp.request.removeAllListeners('extractData'); - }, - - setError: function setError(resp, retryable) { - resp.data = null; - resp.error = AWS.util.error(resp.error || new Error(), { - code: 'ResourceNotReady', - message: 'Resource is not in the state ' + this.state, - retryable: retryable - }); - }, + // The minimized models do not have error shapes, so + // without expanding the model size, it's not possible + // to validate the response shape (members) or + // check if any are sensitive to logging. - /** - * Loads waiter configuration from API configuration - * - * @api private - */ - loadWaiterConfig: function loadWaiterConfig(state) { - if (!this.service.api.waiters[state]) { - throw new AWS.util.error(new Error(), { - code: 'StateNotFoundError', - message: 'State ' + state + ' not found.' - }); + // Assign the fields as non-enumerable, allowing specific access only. + for (var key in e || {}) { + if (key === 'code' || key === 'message') { + continue; + } + error['[' + key + ']'] = 'See error.' + key + ' for details.'; + Object.defineProperty(error, key, { + value: e[key], + enumerable: false, + writable: true + }); + } + } catch (e) { + error.statusCode = httpResponse.statusCode; + error.message = httpResponse.statusMessage; } - - this.config = AWS.util.copy(this.service.api.waiters[state]); + } else { + error.statusCode = httpResponse.statusCode; + error.message = httpResponse.statusCode.toString(); } -}); - - -/***/ }), -/***/ 58743: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + resp.error = util.error(new Error(), error); +} -var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; -var jmespath = __nccwpck_require__(87783); +function extractData(resp) { + var body = resp.httpResponse.body.toString() || '{}'; + if (resp.request.service.config.convertResponseTypes === false) { + resp.data = JSON.parse(body); + } else { + var operation = resp.request.service.api.operations[resp.request.operation]; + var shape = operation.output || {}; + var parser = new JsonParser(); + resp.data = parser.parse(body, shape); + } +} /** - * This class encapsulates the response information - * from a service request operation sent through {AWS.Request}. - * The response object has two main properties for getting information - * back from a request: - * - * ## The `data` property - * - * The `response.data` property contains the serialized object data - * retrieved from the service request. For instance, for an - * Amazon DynamoDB `listTables` method call, the response data might - * look like: - * - * ``` - * > resp.data - * { TableNames: - * [ 'table1', 'table2', ... ] } - * ``` - * - * The `data` property can be null if an error occurs (see below). - * - * ## The `error` property - * - * In the event of a service error (or transfer error), the - * `response.error` property will be filled with the given - * error data in the form: - * - * ``` - * { code: 'SHORT_UNIQUE_ERROR_CODE', - * message: 'Some human readable error message' } - * ``` - * - * In the case of an error, the `data` property will be `null`. - * Note that if you handle events that can be in a failure state, - * you should always check whether `response.error` is set - * before attempting to access the `response.data` property. - * - * @!attribute data - * @readonly - * @!group Data Properties - * @note Inside of a {AWS.Request~httpData} event, this - * property contains a single raw packet instead of the - * full de-serialized service response. - * @return [Object] the de-serialized response data - * from the service. - * - * @!attribute error - * An structure containing information about a service - * or networking error. - * @readonly - * @!group Data Properties - * @note This attribute is only filled if a service or - * networking error occurs. - * @return [Error] - * * code [String] a unique short code representing the - * error that was emitted. - * * message [String] a longer human readable error message - * * retryable [Boolean] whether the error message is - * retryable. - * * statusCode [Numeric] in the case of a request that reached the service, - * this value contains the response status code. - * * time [Date] the date time object when the error occurred. - * * hostname [String] set when a networking error occurs to easily - * identify the endpoint of the request. - * * region [String] set when a networking error occurs to easily - * identify the region of the request. - * - * @!attribute requestId - * @readonly - * @!group Data Properties - * @return [String] the unique request ID associated with the response. - * Log this value when debugging requests for AWS support. - * - * @!attribute retryCount - * @readonly - * @!group Operation Properties - * @return [Integer] the number of retries that were - * attempted before the request was completed. - * - * @!attribute redirectCount - * @readonly - * @!group Operation Properties - * @return [Integer] the number of redirects that were - * followed before the request was completed. - * - * @!attribute httpResponse - * @readonly - * @!group HTTP Properties - * @return [AWS.HttpResponse] the raw HTTP response object - * containing the response headers and body information - * from the server. - * - * @see AWS.Request + * @api private */ -AWS.Response = inherit({ +module.exports = { + buildRequest: buildRequest, + extractError: extractError, + extractData: extractData +}; - /** - * @api private - */ - constructor: function Response(request) { - this.request = request; - this.data = null; - this.error = null; - this.retryCount = 0; - this.redirectCount = 0; - this.httpResponse = new AWS.HttpResponse(); - if (request) { - this.maxRetries = request.service.numRetries(); - this.maxRedirects = request.service.config.maxRedirects; - } - }, - /** - * Creates a new request for the next page of response data, calling the - * callback with the page data if a callback is provided. - * - * @callback callback function(err, data) - * Called when a page of data is returned from the next request. - * - * @param err [Error] an error object, if an error occurred in the request - * @param data [Object] the next page of data, or null, if there are no - * more pages left. - * @return [AWS.Request] the request object for the next page of data - * @return [null] if no callback is provided and there are no pages left - * to retrieve. - * @since v1.4.0 - */ - nextPage: function nextPage(callback) { - var config; - var service = this.request.service; - var operation = this.request.operation; - try { - config = service.paginationConfig(operation, true); - } catch (e) { this.error = e; } +/***/ }), - if (!this.hasNextPage()) { - if (callback) callback(this.error, null); - else if (this.error) throw this.error; - return null; - } +/***/ 90761: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var params = AWS.util.copy(this.request.params); - if (!this.nextPageTokens) { - return callback ? callback(null, null) : null; - } else { - var inputTokens = config.inputToken; - if (typeof inputTokens === 'string') inputTokens = [inputTokens]; - for (var i = 0; i < inputTokens.length; i++) { - params[inputTokens[i]] = this.nextPageTokens[i]; - } - return service.makeRequest(this.request.operation, params, callback); - } - }, +var AWS = __nccwpck_require__(28437); +var util = __nccwpck_require__(77985); +var QueryParamSerializer = __nccwpck_require__(45175); +var Shape = __nccwpck_require__(71349); +var populateHostPrefix = (__nccwpck_require__(97969).populateHostPrefix); - /** - * @return [Boolean] whether more pages of data can be returned by further - * requests - * @since v1.4.0 - */ - hasNextPage: function hasNextPage() { - this.cacheNextPageTokens(); - if (this.nextPageTokens) return true; - if (this.nextPageTokens === undefined) return undefined; - else return false; - }, +function buildRequest(req) { + var operation = req.service.api.operations[req.operation]; + var httpRequest = req.httpRequest; + httpRequest.headers['Content-Type'] = + 'application/x-www-form-urlencoded; charset=utf-8'; + httpRequest.params = { + Version: req.service.api.apiVersion, + Action: operation.name + }; - /** - * @api private - */ - cacheNextPageTokens: function cacheNextPageTokens() { - if (Object.prototype.hasOwnProperty.call(this, 'nextPageTokens')) return this.nextPageTokens; - this.nextPageTokens = undefined; + // convert the request parameters into a list of query params, + // e.g. Deeply.NestedParam.0.Name=value + var builder = new QueryParamSerializer(); + builder.serialize(req.params, operation.input, function(name, value) { + httpRequest.params[name] = value; + }); + httpRequest.body = util.queryParamsToString(httpRequest.params); - var config = this.request.service.paginationConfig(this.request.operation); - if (!config) return this.nextPageTokens; + populateHostPrefix(req); +} - this.nextPageTokens = null; - if (config.moreResults) { - if (!jmespath.search(this.data, config.moreResults)) { - return this.nextPageTokens; - } +function extractError(resp) { + var data, body = resp.httpResponse.body.toString(); + if (body.match(' { + if (data._XAMZRequestId) delete data._XAMZRequestId; -var AWS = __nccwpck_require__(28437); -var byteLength = AWS.util.string.byteLength; -var Buffer = AWS.util.Buffer; + if (origRules.resultWrapper) { + if (data[origRules.resultWrapper]) { + util.update(data, data[origRules.resultWrapper]); + delete data[origRules.resultWrapper]; + } + } + + resp.data = data; +} /** - * The managed uploader allows for easy and efficient uploading of buffers, - * blobs, or streams, using a configurable amount of concurrency to perform - * multipart uploads where possible. This abstraction also enables uploading - * streams of unknown size due to the use of multipart uploads. - * - * To construct a managed upload object, see the {constructor} function. - * - * ## Tracking upload progress - * - * The managed upload object can also track progress by attaching an - * 'httpUploadProgress' listener to the upload manager. This event is similar - * to {AWS.Request~httpUploadProgress} but groups all concurrent upload progress - * into a single event. See {AWS.S3.ManagedUpload~httpUploadProgress} for more - * information. - * - * ## Handling Multipart Cleanup - * - * By default, this class will automatically clean up any multipart uploads - * when an individual part upload fails. This behavior can be disabled in order - * to manually handle failures by setting the `leavePartsOnError` configuration - * option to `true` when initializing the upload object. - * - * @!event httpUploadProgress(progress) - * Triggered when the uploader has uploaded more data. - * @note The `total` property may not be set if the stream being uploaded has - * not yet finished chunking. In this case the `total` will be undefined - * until the total stream size is known. - * @note This event will not be emitted in Node.js 0.8.x. - * @param progress [map] An object containing the `loaded` and `total` bytes - * of the request and the `key` of the S3 object. Note that `total` may be undefined until the payload - * size is known. - * @context (see AWS.Request~send) + * @api private */ -AWS.S3.ManagedUpload = AWS.util.inherit({ - /** - * Creates a managed upload object with a set of configuration options. - * - * @note A "Body" parameter is required to be set prior to calling {send}. - * @note In Node.js, sending "Body" as {https://nodejs.org/dist/latest/docs/api/stream.html#stream_object_mode object-mode stream} - * may result in upload hangs. Using buffer stream is preferable. - * @option options params [map] a map of parameters to pass to the upload - * requests. The "Body" parameter is required to be specified either on - * the service or in the params option. - * @note ContentMD5 should not be provided when using the managed upload object. - * Instead, setting "computeChecksums" to true will enable automatic ContentMD5 generation - * by the managed upload object. - * @option options queueSize [Number] (4) the size of the concurrent queue - * manager to upload parts in parallel. Set to 1 for synchronous uploading - * of parts. Note that the uploader will buffer at most queueSize * partSize - * bytes into memory at any given time. - * @option options partSize [Number] (5mb) the size in bytes for each - * individual part to be uploaded. Adjust the part size to ensure the number - * of parts does not exceed {maxTotalParts}. See {minPartSize} for the - * minimum allowed part size. - * @option options leavePartsOnError [Boolean] (false) whether to abort the - * multipart upload if an error occurs. Set to true if you want to handle - * failures manually. - * @option options service [AWS.S3] an optional S3 service object to use for - * requests. This object might have bound parameters used by the uploader. - * @option options tags [Array] The tags to apply to the uploaded object. - * Each tag should have a `Key` and `Value` keys. - * @example Creating a default uploader for a stream object - * var upload = new AWS.S3.ManagedUpload({ - * params: {Bucket: 'bucket', Key: 'key', Body: stream} - * }); - * @example Creating an uploader with concurrency of 1 and partSize of 10mb - * var upload = new AWS.S3.ManagedUpload({ - * partSize: 10 * 1024 * 1024, queueSize: 1, - * params: {Bucket: 'bucket', Key: 'key', Body: stream} - * }); - * @example Creating an uploader with tags - * var upload = new AWS.S3.ManagedUpload({ - * params: {Bucket: 'bucket', Key: 'key', Body: stream}, - * tags: [{Key: 'tag1', Value: 'value1'}, {Key: 'tag2', Value: 'value2'}] - * }); - * @see send - */ - constructor: function ManagedUpload(options) { - var self = this; - AWS.SequentialExecutor.call(self); - self.body = null; - self.sliceFn = null; - self.callback = null; - self.parts = {}; - self.completeInfo = []; - self.fillQueue = function() { - self.callback(new Error('Unsupported body payload ' + typeof self.body)); - }; +module.exports = { + buildRequest: buildRequest, + extractError: extractError, + extractData: extractData +}; - self.configure(options); - }, - /** - * @api private - */ - configure: function configure(options) { - options = options || {}; - this.partSize = this.minPartSize; +/***/ }), - if (options.queueSize) this.queueSize = options.queueSize; - if (options.partSize) this.partSize = options.partSize; - if (options.leavePartsOnError) this.leavePartsOnError = true; - if (options.tags) { - if (!Array.isArray(options.tags)) { - throw new Error('Tags must be specified as an array; ' + - typeof options.tags + ' provided.'); - } - this.tags = options.tags; - } +/***/ 98200: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (this.partSize < this.minPartSize) { - throw new Error('partSize must be greater than ' + - this.minPartSize); - } +var util = __nccwpck_require__(77985); +var populateHostPrefix = (__nccwpck_require__(97969).populateHostPrefix); - this.service = options.service; - this.bindServiceObject(options.params); - this.validateBody(); - this.adjustTotalBytes(); - }, +function populateMethod(req) { + req.httpRequest.method = req.service.api.operations[req.operation].httpMethod; +} - /** - * @api private - */ - leavePartsOnError: false, +function generateURI(endpointPath, operationPath, input, params) { + var uri = [endpointPath, operationPath].join('/'); + uri = uri.replace(/\/+/g, '/'); - /** - * @api private - */ - queueSize: 4, + var queryString = {}, queryStringSet = false; + util.each(input.members, function (name, member) { + var paramValue = params[name]; + if (paramValue === null || paramValue === undefined) return; + if (member.location === 'uri') { + var regex = new RegExp('\\{' + member.name + '(\\+)?\\}'); + uri = uri.replace(regex, function(_, plus) { + var fn = plus ? util.uriEscapePath : util.uriEscape; + return fn(String(paramValue)); + }); + } else if (member.location === 'querystring') { + queryStringSet = true; - /** - * @api private - */ - partSize: null, + if (member.type === 'list') { + queryString[member.name] = paramValue.map(function(val) { + return util.uriEscape(member.member.toWireFormat(val).toString()); + }); + } else if (member.type === 'map') { + util.each(paramValue, function(key, value) { + if (Array.isArray(value)) { + queryString[key] = value.map(function(val) { + return util.uriEscape(String(val)); + }); + } else { + queryString[key] = util.uriEscape(String(value)); + } + }); + } else { + queryString[member.name] = util.uriEscape(member.toWireFormat(paramValue).toString()); + } + } + }); - /** - * @readonly - * @return [Number] the minimum number of bytes for an individual part - * upload. - */ - minPartSize: 1024 * 1024 * 5, + if (queryStringSet) { + uri += (uri.indexOf('?') >= 0 ? '&' : '?'); + var parts = []; + util.arrayEach(Object.keys(queryString).sort(), function(key) { + if (!Array.isArray(queryString[key])) { + queryString[key] = [queryString[key]]; + } + for (var i = 0; i < queryString[key].length; i++) { + parts.push(util.uriEscape(String(key)) + '=' + queryString[key][i]); + } + }); + uri += parts.join('&'); + } - /** - * @readonly - * @return [Number] the maximum allowed number of parts in a multipart upload. - */ - maxTotalParts: 10000, + return uri; +} - /** - * Initiates the managed upload for the payload. - * - * @callback callback function(err, data) - * @param err [Error] an error or null if no error occurred. - * @param data [map] The response data from the successful upload: - * * `Location` (String) the URL of the uploaded object - * * `ETag` (String) the ETag of the uploaded object - * * `Bucket` (String) the bucket to which the object was uploaded - * * `Key` (String) the key to which the object was uploaded - * @example Sending a managed upload object - * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; - * var upload = new AWS.S3.ManagedUpload({params: params}); - * upload.send(function(err, data) { - * console.log(err, data); - * }); - */ - send: function(callback) { - var self = this; - self.failed = false; - self.callback = callback || function(err) { if (err) throw err; }; +function populateURI(req) { + var operation = req.service.api.operations[req.operation]; + var input = operation.input; - var runFill = true; - if (self.sliceFn) { - self.fillQueue = self.fillBuffer; - } else if (AWS.util.isNode()) { - var Stream = AWS.util.stream.Stream; - if (self.body instanceof Stream) { - runFill = false; - self.fillQueue = self.fillStream; - self.partBuffers = []; - self.body. - on('error', function(err) { self.cleanup(err); }). - on('readable', function() { self.fillQueue(); }). - on('end', function() { - self.isDoneChunking = true; - self.numParts = self.totalPartNumbers; - self.fillQueue.call(self); + var uri = generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); + req.httpRequest.path = uri; +} - if (self.isDoneChunking && self.totalPartNumbers >= 1 && self.doneParts === self.numParts) { - self.finishMultiPart(); - } - }); +function populateHeaders(req) { + var operation = req.service.api.operations[req.operation]; + util.each(operation.input.members, function (name, member) { + var value = req.params[name]; + if (value === null || value === undefined) return; + + if (member.location === 'headers' && member.type === 'map') { + util.each(value, function(key, memberValue) { + req.httpRequest.headers[member.name + key] = memberValue; + }); + } else if (member.location === 'header') { + value = member.toWireFormat(value).toString(); + if (member.isJsonValue) { + value = util.base64.encode(value); } + req.httpRequest.headers[member.name] = value; } + }); +} - if (runFill) self.fillQueue.call(self); - }, +function buildRequest(req) { + populateMethod(req); + populateURI(req); + populateHeaders(req); + populateHostPrefix(req); +} - /** - * @!method promise() - * Returns a 'thenable' promise. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function(data) - * Called if the promise is fulfilled. - * @param data [map] The response data from the successful upload: - * `Location` (String) the URL of the uploaded object - * `ETag` (String) the ETag of the uploaded object - * `Bucket` (String) the bucket to which the object was uploaded - * `Key` (String) the key to which the object was uploaded - * @callback rejectedCallback function(err) - * Called if the promise is rejected. - * @param err [Error] an error or null if no error occurred. - * @return [Promise] A promise that represents the state of the upload request. - * @example Sending an upload request using promises. - * var upload = s3.upload({Bucket: 'bucket', Key: 'key', Body: stream}); - * var promise = upload.promise(); - * promise.then(function(data) { ... }, function(err) { ... }); - */ +function extractError() { +} - /** - * Aborts a managed upload, including all concurrent upload requests. - * @note By default, calling this function will cleanup a multipart upload - * if one was created. To leave the multipart upload around after aborting - * a request, configure `leavePartsOnError` to `true` in the {constructor}. - * @note Calling {abort} in the browser environment will not abort any requests - * that are already in flight. If a multipart upload was created, any parts - * not yet uploaded will not be sent, and the multipart upload will be cleaned up. - * @example Aborting an upload - * var params = { - * Bucket: 'bucket', Key: 'key', - * Body: Buffer.alloc(1024 * 1024 * 25) // 25MB payload - * }; - * var upload = s3.upload(params); - * upload.send(function (err, data) { - * if (err) console.log("Error:", err.code, err.message); - * else console.log(data); - * }); - * - * // abort request in 1 second - * setTimeout(upload.abort.bind(upload), 1000); - */ - abort: function() { - var self = this; - //abort putObject request - if (self.isDoneChunking === true && self.totalPartNumbers === 1 && self.singlePart) { - self.singlePart.abort(); - } else { - self.cleanup(AWS.util.error(new Error('Request aborted by user'), { - code: 'RequestAbortedError', retryable: false - })); - } - }, +function extractData(resp) { + var req = resp.request; + var data = {}; + var r = resp.httpResponse; + var operation = req.service.api.operations[req.operation]; + var output = operation.output; - /** - * @api private - */ - validateBody: function validateBody() { - var self = this; - self.body = self.service.config.params.Body; - if (typeof self.body === 'string') { - self.body = AWS.util.buffer.toBuffer(self.body); - } else if (!self.body) { - throw new Error('params.Body is required'); - } - self.sliceFn = AWS.util.arraySliceFn(self.body); - }, + // normalize headers names to lower-cased keys for matching + var headers = {}; + util.each(r.headers, function (k, v) { + headers[k.toLowerCase()] = v; + }); - /** - * @api private - */ - bindServiceObject: function bindServiceObject(params) { - params = params || {}; - var self = this; - // bind parameters to new service object - if (!self.service) { - self.service = new AWS.S3({params: params}); - } else { - // Create a new S3 client from the supplied client's constructor. - var service = self.service; - var config = AWS.util.copy(service.config); - config.signatureVersion = service.getSignatureVersion(); - self.service = new service.constructor.__super__(config); - self.service.config.params = - AWS.util.merge(self.service.config.params || {}, params); - Object.defineProperty(self.service, '_originalConfig', { - get: function() { return service._originalConfig; }, - enumerable: false, - configurable: true + util.each(output.members, function(name, member) { + var header = (member.name || name).toLowerCase(); + if (member.location === 'headers' && member.type === 'map') { + data[name] = {}; + var location = member.isLocationName ? member.name : ''; + var pattern = new RegExp('^' + location + '(.+)', 'i'); + util.each(r.headers, function (k, v) { + var result = k.match(pattern); + if (result !== null) { + data[name][result[1]] = v; + } }); + } else if (member.location === 'header') { + if (headers[header] !== undefined) { + var value = member.isJsonValue ? + util.base64.decode(headers[header]) : + headers[header]; + data[name] = member.toType(value); + } + } else if (member.location === 'statusCode') { + data[name] = parseInt(r.statusCode, 10); } - }, - - /** - * @api private - */ - adjustTotalBytes: function adjustTotalBytes() { - var self = this; - try { // try to get totalBytes - self.totalBytes = byteLength(self.body); - } catch (e) { } - - // try to adjust partSize if we know payload length - if (self.totalBytes) { - var newPartSize = Math.ceil(self.totalBytes / self.maxTotalParts); - if (newPartSize > self.partSize) self.partSize = newPartSize; - } else { - self.totalBytes = undefined; - } - }, - - /** - * @api private - */ - isDoneChunking: false, + }); - /** - * @api private - */ - partPos: 0, + resp.data = data; +} - /** - * @api private - */ - totalChunkedBytes: 0, +/** + * @api private + */ +module.exports = { + buildRequest: buildRequest, + extractError: extractError, + extractData: extractData, + generateURI: generateURI +}; - /** - * @api private - */ - totalUploadedBytes: 0, - /** - * @api private - */ - totalBytes: undefined, +/***/ }), - /** - * @api private - */ - numParts: 0, +/***/ 5883: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - */ - totalPartNumbers: 0, +var AWS = __nccwpck_require__(28437); +var util = __nccwpck_require__(77985); +var Rest = __nccwpck_require__(98200); +var Json = __nccwpck_require__(30083); +var JsonBuilder = __nccwpck_require__(47495); +var JsonParser = __nccwpck_require__(5474); - /** - * @api private - */ - activeParts: 0, +var METHODS_WITHOUT_BODY = ['GET', 'HEAD', 'DELETE']; - /** - * @api private - */ - doneParts: 0, +function unsetContentLength(req) { + var payloadMember = util.getRequestPayloadShape(req); + if ( + payloadMember === undefined && + METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) >= 0 + ) { + delete req.httpRequest.headers['Content-Length']; + } +} - /** - * @api private - */ - parts: null, +function populateBody(req) { + var builder = new JsonBuilder(); + var input = req.service.api.operations[req.operation].input; - /** - * @api private - */ - completeInfo: null, + if (input.payload) { + var params = {}; + var payloadShape = input.members[input.payload]; + params = req.params[input.payload]; - /** - * @api private - */ - failed: false, + if (payloadShape.type === 'structure') { + req.httpRequest.body = builder.build(params || {}, payloadShape); + applyContentTypeHeader(req); + } else if (params !== undefined) { + // non-JSON payload + req.httpRequest.body = params; + if (payloadShape.type === 'binary' || payloadShape.isStreaming) { + applyContentTypeHeader(req, true); + } + } + } else { + req.httpRequest.body = builder.build(req.params, input); + applyContentTypeHeader(req); + } +} - /** - * @api private - */ - multipartReq: null, +function applyContentTypeHeader(req, isBinary) { + if (!req.httpRequest.headers['Content-Type']) { + var type = isBinary ? 'binary/octet-stream' : 'application/json'; + req.httpRequest.headers['Content-Type'] = type; + } +} - /** - * @api private - */ - partBuffers: null, +function buildRequest(req) { + Rest.buildRequest(req); - /** - * @api private - */ - partBufferLength: 0, + // never send body payload on GET/HEAD/DELETE + if (METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) < 0) { + populateBody(req); + } +} - /** - * @api private - */ - fillBuffer: function fillBuffer() { - var self = this; - var bodyLen = byteLength(self.body); +function extractError(resp) { + Json.extractError(resp); +} - if (bodyLen === 0) { - self.isDoneChunking = true; - self.numParts = 1; - self.nextChunk(self.body); - return; - } +function extractData(resp) { + Rest.extractData(resp); - while (self.activeParts < self.queueSize && self.partPos < bodyLen) { - var endPos = Math.min(self.partPos + self.partSize, bodyLen); - var buf = self.sliceFn.call(self.body, self.partPos, endPos); - self.partPos += self.partSize; + var req = resp.request; + var operation = req.service.api.operations[req.operation]; + var rules = req.service.api.operations[req.operation].output || {}; + var parser; + var hasEventOutput = operation.hasEventOutput; - if (byteLength(buf) < self.partSize || self.partPos === bodyLen) { - self.isDoneChunking = true; - self.numParts = self.totalPartNumbers + 1; - } - self.nextChunk(buf); + if (rules.payload) { + var payloadMember = rules.members[rules.payload]; + var body = resp.httpResponse.body; + if (payloadMember.isEventStream) { + parser = new JsonParser(); + resp.data[rules.payload] = util.createEventStream( + AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : body, + parser, + payloadMember + ); + } else if (payloadMember.type === 'structure' || payloadMember.type === 'list') { + var parser = new JsonParser(); + resp.data[rules.payload] = parser.parse(body, payloadMember); + } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { + resp.data[rules.payload] = body; + } else { + resp.data[rules.payload] = payloadMember.toType(body); } - }, + } else { + var data = resp.data; + Json.extractData(resp); + resp.data = util.merge(data, resp.data); + } +} - /** - * @api private - */ - fillStream: function fillStream() { - var self = this; - if (self.activeParts >= self.queueSize) return; +/** + * @api private + */ +module.exports = { + buildRequest: buildRequest, + extractError: extractError, + extractData: extractData, + unsetContentLength: unsetContentLength +}; - var buf = self.body.read(self.partSize - self.partBufferLength) || - self.body.read(); - if (buf) { - self.partBuffers.push(buf); - self.partBufferLength += buf.length; - self.totalChunkedBytes += buf.length; - } - if (self.partBufferLength >= self.partSize) { - // if we have single buffer we avoid copyfull concat - var pbuf = self.partBuffers.length === 1 ? - self.partBuffers[0] : Buffer.concat(self.partBuffers); - self.partBuffers = []; - self.partBufferLength = 0; +/***/ }), - // if we have more than partSize, push the rest back on the queue - if (pbuf.length > self.partSize) { - var rest = pbuf.slice(self.partSize); - self.partBuffers.push(rest); - self.partBufferLength += rest.length; - pbuf = pbuf.slice(0, self.partSize); - } +/***/ 15143: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - self.nextChunk(pbuf); - } +var AWS = __nccwpck_require__(28437); +var util = __nccwpck_require__(77985); +var Rest = __nccwpck_require__(98200); - if (self.isDoneChunking && !self.isDoneSending) { - // if we have single buffer we avoid copyfull concat - pbuf = self.partBuffers.length === 1 ? - self.partBuffers[0] : Buffer.concat(self.partBuffers); - self.partBuffers = []; - self.partBufferLength = 0; - self.totalBytes = self.totalChunkedBytes; - self.isDoneSending = true; +function populateBody(req) { + var input = req.service.api.operations[req.operation].input; + var builder = new AWS.XML.Builder(); + var params = req.params; - if (self.numParts === 0 || pbuf.length > 0) { - self.numParts++; - self.nextChunk(pbuf); - } + var payload = input.payload; + if (payload) { + var payloadMember = input.members[payload]; + params = params[payload]; + if (params === undefined) return; + + if (payloadMember.type === 'structure') { + var rootElement = payloadMember.name; + req.httpRequest.body = builder.toXML(params, payloadMember, rootElement, true); + } else { // non-xml payload + req.httpRequest.body = params; } + } else { + req.httpRequest.body = builder.toXML(params, input, input.name || + input.shape || util.string.upperFirst(req.operation) + 'Request'); + } +} - self.body.read(0); - }, +function buildRequest(req) { + Rest.buildRequest(req); - /** - * @api private - */ - nextChunk: function nextChunk(chunk) { - var self = this; - if (self.failed) return null; + // never send body payload on GET/HEAD + if (['GET', 'HEAD'].indexOf(req.httpRequest.method) < 0) { + populateBody(req); + } +} - var partNumber = ++self.totalPartNumbers; - if (self.isDoneChunking && partNumber === 1) { - var params = {Body: chunk}; - if (this.tags) { - params.Tagging = this.getTaggingHeader(); - } - var req = self.service.putObject(params); - req._managedUpload = self; - req.on('httpUploadProgress', self.progress).send(self.finishSinglePart); - self.singlePart = req; //save the single part request - return null; - } else if (self.service.config.params.ContentMD5) { - var err = AWS.util.error(new Error('The Content-MD5 you specified is invalid for multi-part uploads.'), { - code: 'InvalidDigest', retryable: false - }); +function extractError(resp) { + Rest.extractError(resp); - self.cleanup(err); - return null; - } + var data; + try { + data = new AWS.XML.Parser().parse(resp.httpResponse.body.toString()); + } catch (e) { + data = { + Code: resp.httpResponse.statusCode, + Message: resp.httpResponse.statusMessage + }; + } - if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) { - return null; // Already uploaded this part. - } + if (data.Errors) data = data.Errors; + if (data.Error) data = data.Error; + if (data.Code) { + resp.error = util.error(new Error(), { + code: data.Code, + message: data.Message + }); + } else { + resp.error = util.error(new Error(), { + code: resp.httpResponse.statusCode, + message: null + }); + } +} - self.activeParts++; - if (!self.service.config.params.UploadId) { +function extractData(resp) { + Rest.extractData(resp); - if (!self.multipartReq) { // create multipart - self.multipartReq = self.service.createMultipartUpload(); - self.multipartReq.on('success', function(resp) { - self.service.config.params.UploadId = resp.data.UploadId; - self.multipartReq = null; - }); - self.queueChunks(chunk, partNumber); - self.multipartReq.on('error', function(err) { - self.cleanup(err); - }); - self.multipartReq.send(); - } else { - self.queueChunks(chunk, partNumber); - } - } else { // multipart is created, just send - self.uploadPart(chunk, partNumber); - } - }, + var parser; + var req = resp.request; + var body = resp.httpResponse.body; + var operation = req.service.api.operations[req.operation]; + var output = operation.output; - /** - * @api private - */ - getTaggingHeader: function getTaggingHeader() { - var kvPairStrings = []; - for (var i = 0; i < this.tags.length; i++) { - kvPairStrings.push(AWS.util.uriEscape(this.tags[i].Key) + '=' + - AWS.util.uriEscape(this.tags[i].Value)); + var hasEventOutput = operation.hasEventOutput; + + var payload = output.payload; + if (payload) { + var payloadMember = output.members[payload]; + if (payloadMember.isEventStream) { + parser = new AWS.XML.Parser(); + resp.data[payload] = util.createEventStream( + AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : resp.httpResponse.body, + parser, + payloadMember + ); + } else if (payloadMember.type === 'structure') { + parser = new AWS.XML.Parser(); + resp.data[payload] = parser.parse(body.toString(), payloadMember); + } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { + resp.data[payload] = body; + } else { + resp.data[payload] = payloadMember.toType(body); } + } else if (body.length > 0) { + parser = new AWS.XML.Parser(); + var data = parser.parse(body.toString(), output); + util.update(resp.data, data); + } +} - return kvPairStrings.join('&'); - }, +/** + * @api private + */ +module.exports = { + buildRequest: buildRequest, + extractError: extractError, + extractData: extractData +}; - /** - * @api private - */ - uploadPart: function uploadPart(chunk, partNumber) { - var self = this; - var partParams = { - Body: chunk, - ContentLength: AWS.util.string.byteLength(chunk), - PartNumber: partNumber - }; +/***/ }), - var partInfo = {ETag: null, PartNumber: partNumber}; - self.completeInfo[partNumber] = partInfo; +/***/ 91822: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var req = self.service.uploadPart(partParams); - self.parts[partNumber] = req; - req._lastUploadedBytes = 0; - req._managedUpload = self; - req.on('httpUploadProgress', self.progress); - req.send(function(err, data) { - delete self.parts[partParams.PartNumber]; - self.activeParts--; +var AWS = __nccwpck_require__(28437); - if (!err && (!data || !data.ETag)) { - var message = 'No access to ETag property on response.'; - if (AWS.util.isBrowser()) { - message += ' Check CORS configuration to expose ETag header.'; - } +/** + * Resolve client-side monitoring configuration from either environmental variables + * or shared config file. Configurations from environmental variables have higher priority + * than those from shared config file. The resolver will try to read the shared config file + * no matter whether the AWS_SDK_LOAD_CONFIG variable is set. + * @api private + */ +function resolveMonitoringConfig() { + var config = { + port: undefined, + clientId: undefined, + enabled: undefined, + host: undefined + }; + if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config); + return toJSType(config); +} - err = AWS.util.error(new Error(message), { - code: 'ETagMissing', retryable: false - }); - } - if (err) return self.cleanup(err); - //prevent sending part being returned twice (https://github.com/aws/aws-sdk-js/issues/2304) - if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null; - partInfo.ETag = data.ETag; - self.doneParts++; - if (self.isDoneChunking && self.doneParts === self.totalPartNumbers) { - self.finishMultiPart(); - } else { - self.fillQueue.call(self); - } - }); - }, +/** + * Resolve configurations from environmental variables. + * @param {object} client side monitoring config object needs to be resolved + * @returns {boolean} whether resolving configurations is done + * @api private + */ +function fromEnvironment(config) { + config.port = config.port || process.env.AWS_CSM_PORT; + config.enabled = config.enabled || process.env.AWS_CSM_ENABLED; + config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID; + config.host = config.host || process.env.AWS_CSM_HOST; + return config.port && config.enabled && config.clientId && config.host || + ['false', '0'].indexOf(config.enabled) >= 0; //no need to read shared config file if explicitely disabled +} - /** - * @api private - */ - queueChunks: function queueChunks(chunk, partNumber) { - var self = this; - self.multipartReq.on('success', function() { - self.uploadPart(chunk, partNumber); +/** + * Resolve cofigurations from shared config file with specified role name + * @param {object} client side monitoring config object needs to be resolved + * @returns {boolean} whether resolving configurations is done + * @api private + */ +function fromConfigFile(config) { + var sharedFileConfig; + try { + var configFile = AWS.util.iniLoader.loadFrom({ + isConfig: true, + filename: process.env[AWS.util.sharedConfigFileEnv] }); - }, - - /** - * @api private - */ - cleanup: function cleanup(err) { - var self = this; - if (self.failed) return; + var sharedFileConfig = configFile[ + process.env.AWS_PROFILE || AWS.util.defaultProfile + ]; + } catch (err) { + return false; + } + if (!sharedFileConfig) return config; + config.port = config.port || sharedFileConfig.csm_port; + config.enabled = config.enabled || sharedFileConfig.csm_enabled; + config.clientId = config.clientId || sharedFileConfig.csm_client_id; + config.host = config.host || sharedFileConfig.csm_host; + return config.port && config.enabled && config.clientId && config.host; +} - // clean up stream - if (typeof self.body.removeAllListeners === 'function' && - typeof self.body.resume === 'function') { - self.body.removeAllListeners('readable'); - self.body.removeAllListeners('end'); - self.body.resume(); - } +/** + * Transfer the resolved configuration value to proper types: port as number, enabled + * as boolean and clientId as string. The 'enabled' flag is valued to false when set + * to 'false' or '0'. + * @param {object} resolved client side monitoring config + * @api private + */ +function toJSType(config) { + //config.XXX is either undefined or string + var falsyNotations = ['false', '0', undefined]; + if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) { + config.enabled = false; + } else { + config.enabled = true; + } + config.port = config.port ? parseInt(config.port, 10) : undefined; + return config; +} - // cleanup multipartReq listeners - if (self.multipartReq) { - self.multipartReq.removeAllListeners('success'); - self.multipartReq.removeAllListeners('error'); - self.multipartReq.removeAllListeners('complete'); - delete self.multipartReq; - } +module.exports = resolveMonitoringConfig; - if (self.service.config.params.UploadId && !self.leavePartsOnError) { - self.service.abortMultipartUpload().send(); - } else if (self.leavePartsOnError) { - self.isDoneChunking = false; - } - AWS.util.each(self.parts, function(partNumber, part) { - part.removeAllListeners('complete'); - part.abort(); - }); +/***/ }), - self.activeParts = 0; - self.partPos = 0; - self.numParts = 0; - self.totalPartNumbers = 0; - self.parts = {}; - self.failed = true; - self.callback(err); - }, +/***/ 66807: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - */ - finishMultiPart: function finishMultiPart() { - var self = this; - var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } }; - self.service.completeMultipartUpload(completeParams, function(err, data) { - if (err) { - return self.cleanup(err); - } +var util = (__nccwpck_require__(28437).util); +var dgram = __nccwpck_require__(71891); +var stringToBuffer = util.buffer.toBuffer; - if (data && typeof data.Location === 'string') { - data.Location = data.Location.replace(/%2F/g, '/'); - } +var MAX_MESSAGE_SIZE = 1024 * 8; // 8 KB - if (Array.isArray(self.tags)) { - for (var i = 0; i < self.tags.length; i++) { - self.tags[i].Value = String(self.tags[i].Value); - } - self.service.putObjectTagging( - {Tagging: {TagSet: self.tags}}, - function(e, d) { - if (e) { - self.callback(e); - } else { - self.callback(e, data); +/** + * Publishes metrics via udp. + * @param {object} options Paramters for Publisher constructor + * @param {number} [options.port = 31000] Port number + * @param {string} [options.clientId = ''] Client Identifier + * @param {boolean} [options.enabled = false] enable sending metrics datagram + * @api private + */ +function Publisher(options) { + // handle configuration + options = options || {}; + this.enabled = options.enabled || false; + this.port = options.port || 31000; + this.clientId = options.clientId || ''; + this.address = options.host || '127.0.0.1'; + if (this.clientId.length > 255) { + // ClientId has a max length of 255 + this.clientId = this.clientId.substr(0, 255); + } + this.messagesInFlight = 0; +} + +Publisher.prototype.fieldsToTrim = { + UserAgent: 256, + SdkException: 128, + SdkExceptionMessage: 512, + AwsException: 128, + AwsExceptionMessage: 512, + FinalSdkException: 128, + FinalSdkExceptionMessage: 512, + FinalAwsException: 128, + FinalAwsExceptionMessage: 512 + +}; + +/** + * Trims fields that have a specified max length. + * @param {object} event ApiCall or ApiCallAttempt event. + * @returns {object} + * @api private + */ +Publisher.prototype.trimFields = function(event) { + var trimmableFields = Object.keys(this.fieldsToTrim); + for (var i = 0, iLen = trimmableFields.length; i < iLen; i++) { + var field = trimmableFields[i]; + if (event.hasOwnProperty(field)) { + var maxLength = this.fieldsToTrim[field]; + var value = event[field]; + if (value && value.length > maxLength) { + event[field] = value.substr(0, maxLength); } - } - ); - } else { - self.callback(err, data); - } - }); - }, + } + } + return event; +}; - /** - * @api private - */ - finishSinglePart: function finishSinglePart(err, data) { - var upload = this.request._managedUpload; - var httpReq = this.request.httpRequest; - var endpoint = httpReq.endpoint; - if (err) return upload.callback(err); - data.Location = - [endpoint.protocol, '//', endpoint.host, httpReq.path].join(''); - data.key = this.request.params.Key; // will stay undocumented - data.Key = this.request.params.Key; - data.Bucket = this.request.params.Bucket; - upload.callback(err, data); - }, +/** + * Handles ApiCall and ApiCallAttempt events. + * @param {Object} event apiCall or apiCallAttempt event. + * @api private + */ +Publisher.prototype.eventHandler = function(event) { + // set the clientId + event.ClientId = this.clientId; - /** - * @api private - */ - progress: function progress(info) { - var upload = this._managedUpload; - if (this.operation === 'putObject') { - info.part = 1; - info.key = this.params.Key; - } else { - upload.totalUploadedBytes += info.loaded - this._lastUploadedBytes; - this._lastUploadedBytes = info.loaded; - info = { - loaded: upload.totalUploadedBytes, - total: upload.totalBytes, - part: this.params.PartNumber, - key: this.params.Key - }; + this.trimFields(event); + + var message = stringToBuffer(JSON.stringify(event)); + if (!this.enabled || message.length > MAX_MESSAGE_SIZE) { + // drop the message if publisher not enabled or it is too large + return; } - upload.emit('httpUploadProgress', [info]); - } -}); -AWS.util.mixin(AWS.S3.ManagedUpload, AWS.SequentialExecutor); + this.publishDatagram(message); +}; /** + * Publishes message to an agent. + * @param {Buffer} message JSON message to send to agent. * @api private */ -AWS.S3.ManagedUpload.addPromisesToClass = function addPromisesToClass(PromiseDependency) { - this.prototype.promise = AWS.util.promisifyMethod('send', PromiseDependency); +Publisher.prototype.publishDatagram = function(message) { + var self = this; + var client = this.getClient(); + + this.messagesInFlight++; + this.client.send(message, 0, message.length, this.port, this.address, function(err, bytes) { + if (--self.messagesInFlight <= 0) { + // destroy existing client so the event loop isn't kept open + self.destroyClient(); + } + }); }; /** + * Returns an existing udp socket, or creates one if it doesn't already exist. * @api private */ -AWS.S3.ManagedUpload.deletePromisesFromClass = function deletePromisesFromClass() { - delete this.prototype.promise; +Publisher.prototype.getClient = function() { + if (!this.client) { + this.client = dgram.createSocket('udp4'); + } + return this.client; }; -AWS.util.addPromises(AWS.S3.ManagedUpload); - /** + * Destroys the udp socket. * @api private */ -module.exports = AWS.S3.ManagedUpload; +Publisher.prototype.destroyClient = function() { + if (this.client) { + this.client.close(); + this.client = void 0; + } +}; + +module.exports = { + Publisher: Publisher +}; /***/ }), -/***/ 55948: +/***/ 45175: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var AWS = __nccwpck_require__(28437); - -/** - * @api private - * @!method on(eventName, callback) - * Registers an event listener callback for the event given by `eventName`. - * Parameters passed to the callback function depend on the individual event - * being triggered. See the event documentation for those parameters. - * - * @param eventName [String] the event name to register the listener for - * @param callback [Function] the listener callback function - * @param toHead [Boolean] attach the listener callback to the head of callback array if set to true. - * Default to be false. - * @return [AWS.SequentialExecutor] the same object for chaining - */ -AWS.SequentialExecutor = AWS.util.inherit({ - - constructor: function SequentialExecutor() { - this._events = {}; - }, +var util = __nccwpck_require__(77985); - /** - * @api private - */ - listeners: function listeners(eventName) { - return this._events[eventName] ? this._events[eventName].slice(0) : []; - }, +function QueryParamSerializer() { +} - on: function on(eventName, listener, toHead) { - if (this._events[eventName]) { - toHead ? - this._events[eventName].unshift(listener) : - this._events[eventName].push(listener); - } else { - this._events[eventName] = [listener]; - } - return this; - }, +QueryParamSerializer.prototype.serialize = function(params, shape, fn) { + serializeStructure('', params, shape, fn); +}; - onAsync: function onAsync(eventName, listener, toHead) { - listener._isAsync = true; - return this.on(eventName, listener, toHead); - }, +function ucfirst(shape) { + if (shape.isQueryName || shape.api.protocol !== 'ec2') { + return shape.name; + } else { + return shape.name[0].toUpperCase() + shape.name.substr(1); + } +} - removeListener: function removeListener(eventName, listener) { - var listeners = this._events[eventName]; - if (listeners) { - var length = listeners.length; - var position = -1; - for (var i = 0; i < length; ++i) { - if (listeners[i] === listener) { - position = i; - } - } - if (position > -1) { - listeners.splice(position, 1); - } - } - return this; - }, +function serializeStructure(prefix, struct, rules, fn) { + util.each(rules.members, function(name, member) { + var value = struct[name]; + if (value === null || value === undefined) return; - removeAllListeners: function removeAllListeners(eventName) { - if (eventName) { - delete this._events[eventName]; - } else { - this._events = {}; - } - return this; - }, + var memberName = ucfirst(member); + memberName = prefix ? prefix + '.' + memberName : memberName; + serializeMember(memberName, value, member, fn); + }); +} - /** - * @api private - */ - emit: function emit(eventName, eventArgs, doneCallback) { - if (!doneCallback) doneCallback = function() { }; - var listeners = this.listeners(eventName); - var count = listeners.length; - this.callListeners(listeners, eventArgs, doneCallback); - return count > 0; - }, +function serializeMap(name, map, rules, fn) { + var i = 1; + util.each(map, function (key, value) { + var prefix = rules.flattened ? '.' : '.entry.'; + var position = prefix + (i++) + '.'; + var keyName = position + (rules.key.name || 'key'); + var valueName = position + (rules.value.name || 'value'); + serializeMember(name + keyName, key, rules.key, fn); + serializeMember(name + valueName, value, rules.value, fn); + }); +} - /** - * @api private - */ - callListeners: function callListeners(listeners, args, doneCallback, prevError) { - var self = this; - var error = prevError || null; +function serializeList(name, list, rules, fn) { + var memberRules = rules.member || {}; - function callNextListener(err) { - if (err) { - error = AWS.util.error(error || new Error(), err); - if (self._haltHandlersOnError) { - return doneCallback.call(self, error); - } - } - self.callListeners(listeners, args, doneCallback, error); + if (list.length === 0) { + if (rules.api.protocol !== 'ec2') { + fn.call(this, name, null); } + return; + } - while (listeners.length > 0) { - var listener = listeners.shift(); - if (listener._isAsync) { // asynchronous listener - listener.apply(self, args.concat([callNextListener])); - return; // stop here, callNextListener will continue - } else { // synchronous listener - try { - listener.apply(self, args); - } catch (err) { - error = AWS.util.error(error || new Error(), err); - } - if (error && self._haltHandlersOnError) { - doneCallback.call(self, error); - return; - } + util.arrayEach(list, function (v, n) { + var suffix = '.' + (n + 1); + if (rules.api.protocol === 'ec2') { + // Do nothing for EC2 + suffix = suffix + ''; // make linter happy + } else if (rules.flattened) { + if (memberRules.name) { + var parts = name.split('.'); + parts.pop(); + parts.push(ucfirst(memberRules)); + name = parts.join('.'); } + } else { + suffix = '.' + (memberRules.name ? memberRules.name : 'member') + suffix; } - doneCallback.call(self, error); - }, + serializeMember(name + suffix, v, memberRules, fn); + }); +} - /** - * Adds or copies a set of listeners from another list of - * listeners or SequentialExecutor object. - * - * @param listeners [map>, AWS.SequentialExecutor] - * a list of events and callbacks, or an event emitter object - * containing listeners to add to this emitter object. - * @return [AWS.SequentialExecutor] the emitter object, for chaining. - * @example Adding listeners from a map of listeners - * emitter.addListeners({ - * event1: [function() { ... }, function() { ... }], - * event2: [function() { ... }] - * }); - * emitter.emit('event1'); // emitter has event1 - * emitter.emit('event2'); // emitter has event2 - * @example Adding listeners from another emitter object - * var emitter1 = new AWS.SequentialExecutor(); - * emitter1.on('event1', function() { ... }); - * emitter1.on('event2', function() { ... }); - * var emitter2 = new AWS.SequentialExecutor(); - * emitter2.addListeners(emitter1); - * emitter2.emit('event1'); // emitter2 has event1 - * emitter2.emit('event2'); // emitter2 has event2 - */ - addListeners: function addListeners(listeners) { - var self = this; +function serializeMember(name, value, rules, fn) { + if (value === null || value === undefined) return; + if (rules.type === 'structure') { + serializeStructure(name, value, rules, fn); + } else if (rules.type === 'list') { + serializeList(name, value, rules, fn); + } else if (rules.type === 'map') { + serializeMap(name, value, rules, fn); + } else { + fn(name, rules.toWireFormat(value).toString()); + } +} - // extract listeners if parameter is an SequentialExecutor object - if (listeners._events) listeners = listeners._events; +/** + * @api private + */ +module.exports = QueryParamSerializer; - AWS.util.each(listeners, function(event, callbacks) { - if (typeof callbacks === 'function') callbacks = [callbacks]; - AWS.util.arrayEach(callbacks, function(callback) { - self.on(event, callback); - }); - }); - return self; - }, +/***/ }), - /** - * Registers an event with {on} and saves the callback handle function - * as a property on the emitter object using a given `name`. - * - * @param name [String] the property name to set on this object containing - * the callback function handle so that the listener can be removed in - * the future. - * @param (see on) - * @return (see on) - * @example Adding a named listener DATA_CALLBACK - * var listener = function() { doSomething(); }; - * emitter.addNamedListener('DATA_CALLBACK', 'data', listener); - * - * // the following prints: true - * console.log(emitter.DATA_CALLBACK == listener); - */ - addNamedListener: function addNamedListener(name, eventName, callback, toHead) { - this[name] = callback; - this.addListener(eventName, callback, toHead); - return this; - }, +/***/ 16612: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - */ - addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback, toHead) { - callback._isAsync = true; - return this.addNamedListener(name, eventName, callback, toHead); - }, +var AWS = __nccwpck_require__(28437); - /** - * Helper method to add a set of named listeners using - * {addNamedListener}. The callback contains a parameter - * with a handle to the `addNamedListener` method. - * - * @callback callback function(add) - * The callback function is called immediately in order to provide - * the `add` function to the block. This simplifies the addition of - * a large group of named listeners. - * @param add [Function] the {addNamedListener} function to call - * when registering listeners. - * @example Adding a set of named listeners - * emitter.addNamedListeners(function(add) { - * add('DATA_CALLBACK', 'data', function() { ... }); - * add('OTHER', 'otherEvent', function() { ... }); - * add('LAST', 'lastEvent', function() { ... }); - * }); - * - * // these properties are now set: - * emitter.DATA_CALLBACK; - * emitter.OTHER; - * emitter.LAST; - */ - addNamedListeners: function addNamedListeners(callback) { - var self = this; - callback( - function() { - self.addNamedListener.apply(self, arguments); - }, - function() { - self.addNamedAsyncListener.apply(self, arguments); - } - ); - return this; - } -}); +/** + * @api private + */ +var service = null; /** - * {on} is the prefered method. * @api private */ -AWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on; +var api = { + signatureVersion: 'v4', + signingName: 'rds-db', + operations: {} +}; /** * @api private */ -module.exports = AWS.SequentialExecutor; +var requiredAuthTokenOptions = { + region: 'string', + hostname: 'string', + port: 'number', + username: 'string' +}; + +/** + * A signer object can be used to generate an auth token to a database. + */ +AWS.RDS.Signer = AWS.util.inherit({ + /** + * Creates a signer object can be used to generate an auth token. + * + * @option options credentials [AWS.Credentials] the AWS credentials + * to sign requests with. Uses the default credential provider chain + * if not specified. + * @option options hostname [String] the hostname of the database to connect to. + * @option options port [Number] the port number the database is listening on. + * @option options region [String] the region the database is located in. + * @option options username [String] the username to login as. + * @example Passing in options to constructor + * var signer = new AWS.RDS.Signer({ + * credentials: new AWS.SharedIniFileCredentials({profile: 'default'}), + * region: 'us-east-1', + * hostname: 'db.us-east-1.rds.amazonaws.com', + * port: 8000, + * username: 'name' + * }); + */ + constructor: function Signer(options) { + this.options = options || {}; + }, + /** + * @api private + * Strips the protocol from a url. + */ + convertUrlToAuthToken: function convertUrlToAuthToken(url) { + // we are always using https as the protocol + var protocol = 'https://'; + if (url.indexOf(protocol) === 0) { + return url.substring(protocol.length); + } + }, -/***/ }), + /** + * @overload getAuthToken(options = {}, [callback]) + * Generate an auth token to a database. + * @note You must ensure that you have static or previously resolved + * credentials if you call this method synchronously (with no callback), + * otherwise it may not properly sign the request. If you cannot guarantee + * this (you are using an asynchronous credential provider, i.e., EC2 + * IAM roles), you should always call this method with an asynchronous + * callback. + * + * @param options [map] The fields to use when generating an auth token. + * Any options specified here will be merged on top of any options passed + * to AWS.RDS.Signer: + * + * * **credentials** (AWS.Credentials) — the AWS credentials + * to sign requests with. Uses the default credential provider chain + * if not specified. + * * **hostname** (String) — the hostname of the database to connect to. + * * **port** (Number) — the port number the database is listening on. + * * **region** (String) — the region the database is located in. + * * **username** (String) — the username to login as. + * @return [String] if called synchronously (with no callback), returns the + * auth token. + * @return [null] nothing is returned if a callback is provided. + * @callback callback function (err, token) + * If a callback is supplied, it is called when an auth token has been generated. + * @param err [Error] the error object returned from the signer. + * @param token [String] the auth token. + * + * @example Generating an auth token synchronously + * var signer = new AWS.RDS.Signer({ + * // configure options + * region: 'us-east-1', + * username: 'default', + * hostname: 'db.us-east-1.amazonaws.com', + * port: 8000 + * }); + * var token = signer.getAuthToken({ + * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option + * // credentials are not specified here or when creating the signer, so default credential provider will be used + * username: 'test' // overriding username + * }); + * @example Generating an auth token asynchronously + * var signer = new AWS.RDS.Signer({ + * // configure options + * region: 'us-east-1', + * username: 'default', + * hostname: 'db.us-east-1.amazonaws.com', + * port: 8000 + * }); + * signer.getAuthToken({ + * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option + * // credentials are not specified here or when creating the signer, so default credential provider will be used + * username: 'test' // overriding username + * }, function(err, token) { + * if (err) { + * // handle error + * } else { + * // use token + * } + * }); + * + */ + getAuthToken: function getAuthToken(options, callback) { + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = {}; + } + var self = this; + var hasCallback = typeof callback === 'function'; + // merge options with existing options + options = AWS.util.merge(this.options, options); + // validate options + var optionsValidation = this.validateAuthTokenOptions(options); + if (optionsValidation !== true) { + if (hasCallback) { + return callback(optionsValidation, null); + } + throw optionsValidation; + } -/***/ 68903: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 15 minutes + var expires = 900; + // create service to generate a request from + var serviceOptions = { + region: options.region, + endpoint: new AWS.Endpoint(options.hostname + ':' + options.port), + paramValidation: false, + signatureVersion: 'v4' + }; + if (options.credentials) { + serviceOptions.credentials = options.credentials; + } + service = new AWS.Service(serviceOptions); + // ensure the SDK is using sigv4 signing (config is not enough) + service.api = api; -var AWS = __nccwpck_require__(28437); -var Api = __nccwpck_require__(17657); -var regionConfig = __nccwpck_require__(18262); + var request = service.makeRequest(); + // add listeners to request to properly build auth token + this.modifyRequestForAuthToken(request, options); -var inherit = AWS.util.inherit; -var clientCount = 0; -var region_utils = __nccwpck_require__(99517); + if (hasCallback) { + request.presign(expires, function(err, url) { + if (url) { + url = self.convertUrlToAuthToken(url); + } + callback(err, url); + }); + } else { + var url = request.presign(expires); + return this.convertUrlToAuthToken(url); + } + }, -/** - * The service class representing an AWS service. - * - * @class_abstract This class is an abstract class. - * - * @!attribute apiVersions - * @return [Array] the list of API versions supported by this service. - * @readonly - */ -AWS.Service = inherit({ - /** - * Create a new service object with a configuration object - * - * @param config [map] a map of configuration options - */ - constructor: function Service(config) { - if (!this.loadServiceClass) { - throw AWS.util.error(new Error(), - 'Service must be constructed with `new\' operator'); - } + /** + * @api private + * Modifies a request to allow the presigner to generate an auth token. + */ + modifyRequestForAuthToken: function modifyRequestForAuthToken(request, options) { + request.on('build', request.buildAsGet); + var httpRequest = request.httpRequest; + httpRequest.body = AWS.util.queryParamsToString({ + Action: 'connect', + DBUser: options.username + }); + }, - if (config) { - if (config.region) { - var region = config.region; - if (region_utils.isFipsRegion(region)) { - config.region = region_utils.getRealRegion(region); - config.useFipsEndpoint = true; + /** + * @api private + * Validates that the options passed in contain all the keys with values of the correct type that + * are needed to generate an auth token. + */ + validateAuthTokenOptions: function validateAuthTokenOptions(options) { + // iterate over all keys in options + var message = ''; + options = options || {}; + for (var key in requiredAuthTokenOptions) { + if (!Object.prototype.hasOwnProperty.call(requiredAuthTokenOptions, key)) { + continue; + } + if (typeof options[key] !== requiredAuthTokenOptions[key]) { + message += 'option \'' + key + '\' should have been type \'' + requiredAuthTokenOptions[key] + '\', was \'' + typeof options[key] + '\'.\n'; + } } - if (region_utils.isGlobalRegion(region)) { - config.region = region_utils.getRealRegion(region); + if (message.length) { + return AWS.util.error(new Error(), { + code: 'InvalidParameter', + message: message + }); } - } - if (typeof config.useDualstack === 'boolean' - && typeof config.useDualstackEndpoint !== 'boolean') { - config.useDualstackEndpoint = config.useDualstack; - } + return true; } +}); - var ServiceClass = this.loadServiceClass(config || {}); - if (ServiceClass) { - var originalConfig = AWS.util.copy(config); - var svc = new ServiceClass(config); - Object.defineProperty(svc, '_originalConfig', { - get: function() { return originalConfig; }, - enumerable: false, - configurable: true - }); - svc._clientId = ++clientCount; - return svc; - } - this.initialize(config); - }, - /** - * @api private - */ - initialize: function initialize(config) { - var svcConfig = AWS.config[this.serviceIdentifier]; - this.config = new AWS.Config(AWS.config); - if (svcConfig) this.config.update(svcConfig, true); - if (config) this.config.update(config, true); +/***/ }), - this.validateService(); - if (!this.config.endpoint) regionConfig.configureEndpoint(this); +/***/ 81370: +/***/ ((module) => { - this.config.endpoint = this.endpointFromTemplate(this.config.endpoint); - this.setEndpoint(this.config.endpoint); - //enable attaching listeners to service client - AWS.SequentialExecutor.call(this); - AWS.Service.addDefaultMonitoringListeners(this); - if ((this.config.clientSideMonitoring || AWS.Service._clientSideMonitoring) && this.publisher) { - var publisher = this.publisher; - this.addNamedListener('PUBLISH_API_CALL', 'apiCall', function PUBLISH_API_CALL(event) { - process.nextTick(function() {publisher.eventHandler(event);}); - }); - this.addNamedListener('PUBLISH_API_ATTEMPT', 'apiCallAttempt', function PUBLISH_API_ATTEMPT(event) { - process.nextTick(function() {publisher.eventHandler(event);}); - }); - } - }, +module.exports = { + //provide realtime clock for performance measurement + now: function now() { + var second = process.hrtime(); + return second[0] * 1000 + (second[1] / 1000000); + } +}; - /** - * @api private - */ - validateService: function validateService() { - }, - /** - * @api private - */ - loadServiceClass: function loadServiceClass(serviceConfig) { - var config = serviceConfig; - if (!AWS.util.isEmpty(this.api)) { - return null; - } else if (config.apiConfig) { - return AWS.Service.defineServiceApi(this.constructor, config.apiConfig); - } else if (!this.constructor.services) { - return null; - } else { - config = new AWS.Config(AWS.config); - config.update(serviceConfig, true); - var version = config.apiVersions[this.constructor.serviceIdentifier]; - version = version || config.apiVersion; - return this.getLatestServiceClass(version); - } - }, +/***/ }), - /** - * @api private - */ - getLatestServiceClass: function getLatestServiceClass(version) { - version = this.getLatestServiceVersion(version); - if (this.constructor.services[version] === null) { - AWS.Service.defineServiceApi(this.constructor, version); - } +/***/ 99517: +/***/ ((module) => { - return this.constructor.services[version]; - }, +function isFipsRegion(region) { + return typeof region === 'string' && (region.startsWith('fips-') || region.endsWith('-fips')); +} - /** - * @api private - */ - getLatestServiceVersion: function getLatestServiceVersion(version) { - if (!this.constructor.services || this.constructor.services.length === 0) { - throw new Error('No services defined on ' + - this.constructor.serviceIdentifier); - } +function isGlobalRegion(region) { + return typeof region === 'string' && ['aws-global', 'aws-us-gov-global'].includes(region); +} - if (!version) { - version = 'latest'; - } else if (AWS.util.isType(version, Date)) { - version = AWS.util.date.iso8601(version).split('T')[0]; - } +function getRealRegion(region) { + return ['fips-aws-global', 'aws-fips', 'aws-global'].includes(region) + ? 'us-east-1' + : ['fips-aws-us-gov-global', 'aws-us-gov-global'].includes(region) + ? 'us-gov-west-1' + : region.replace(/fips-(dkr-|prod-)?|-fips/, ''); +} - if (Object.hasOwnProperty(this.constructor.services, version)) { - return version; - } +module.exports = { + isFipsRegion: isFipsRegion, + isGlobalRegion: isGlobalRegion, + getRealRegion: getRealRegion +}; - var keys = Object.keys(this.constructor.services).sort(); - var selectedVersion = null; - for (var i = keys.length - 1; i >= 0; i--) { - // versions that end in "*" are not available on disk and can be - // skipped, so do not choose these as selectedVersions - if (keys[i][keys[i].length - 1] !== '*') { - selectedVersion = keys[i]; - } - if (keys[i].substr(0, 10) <= version) { - return selectedVersion; - } - } - throw new Error('Could not find ' + this.constructor.serviceIdentifier + - ' API to satisfy version constraint `' + version + '\''); - }, +/***/ }), - /** - * @api private - */ - api: {}, +/***/ 18262: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * @api private - */ - defaultRetryCount: 3, +var util = __nccwpck_require__(77985); +var regionConfig = __nccwpck_require__(80738); - /** - * @api private - */ - customizeRequests: function customizeRequests(callback) { - if (!callback) { - this.customRequestHandler = null; - } else if (typeof callback === 'function') { - this.customRequestHandler = callback; - } else { - throw new Error('Invalid callback type \'' + typeof callback + '\' provided in customizeRequests'); - } - }, +function generateRegionPrefix(region) { + if (!region) return null; + var parts = region.split('-'); + if (parts.length < 3) return null; + return parts.slice(0, parts.length - 2).join('-') + '-*'; +} - /** - * Calls an operation on a service with the given input parameters. - * - * @param operation [String] the name of the operation to call on the service. - * @param params [map] a map of input options for the operation - * @callback callback function(err, data) - * If a callback is supplied, it is called when a response is returned - * from the service. - * @param err [Error] the error object returned from the request. - * Set to `null` if the request is successful. - * @param data [Object] the de-serialized data returned from - * the request. Set to `null` if a request error occurs. - */ - makeRequest: function makeRequest(operation, params, callback) { - if (typeof params === 'function') { - callback = params; - params = null; - } +function derivedKeys(service) { + var region = service.config.region; + var regionPrefix = generateRegionPrefix(region); + var endpointPrefix = service.api.endpointPrefix; - params = params || {}; - if (this.config.params) { // copy only toplevel bound params - var rules = this.api.operations[operation]; - if (rules) { - params = AWS.util.copy(params); - AWS.util.each(this.config.params, function(key, value) { - if (rules.input.members[key]) { - if (params[key] === undefined || params[key] === null) { - params[key] = value; - } - } - }); - } + return [ + [region, endpointPrefix], + [regionPrefix, endpointPrefix], + [region, '*'], + [regionPrefix, '*'], + ['*', endpointPrefix], + [region, 'internal-*'], + ['*', '*'] + ].map(function(item) { + return item[0] && item[1] ? item.join('/') : null; + }); +} + +function applyConfig(service, config) { + util.each(config, function(key, value) { + if (key === 'globalEndpoint') return; + if (service.config[key] === undefined || service.config[key] === null) { + service.config[key] = value; } + }); +} - var request = new AWS.Request(this, operation, params); - this.addAllRequestListeners(request); - this.attachMonitoringEmitter(request); - if (callback) request.send(callback); - return request; - }, +function configureEndpoint(service) { + var keys = derivedKeys(service); + var useFipsEndpoint = service.config.useFipsEndpoint; + var useDualstackEndpoint = service.config.useDualstackEndpoint; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!key) continue; - /** - * Calls an operation on a service with the given input parameters, without - * any authentication data. This method is useful for "public" API operations. - * - * @param operation [String] the name of the operation to call on the service. - * @param params [map] a map of input options for the operation - * @callback callback function(err, data) - * If a callback is supplied, it is called when a response is returned - * from the service. - * @param err [Error] the error object returned from the request. - * Set to `null` if the request is successful. - * @param data [Object] the de-serialized data returned from - * the request. Set to `null` if a request error occurs. - */ - makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) { - if (typeof params === 'function') { - callback = params; - params = {}; - } + var rules = useFipsEndpoint + ? useDualstackEndpoint + ? regionConfig.dualstackFipsRules + : regionConfig.fipsRules + : useDualstackEndpoint + ? regionConfig.dualstackRules + : regionConfig.rules; - var request = this.makeRequest(operation, params).toUnauthenticated(); - return callback ? request.send(callback) : request; - }, + if (Object.prototype.hasOwnProperty.call(rules, key)) { + var config = rules[key]; + if (typeof config === 'string') { + config = regionConfig.patterns[config]; + } - /** - * Waits for a given state - * - * @param state [String] the state on the service to wait for - * @param params [map] a map of parameters to pass with each request - * @option params $waiter [map] a map of configuration options for the waiter - * @option params $waiter.delay [Number] The number of seconds to wait between - * requests - * @option params $waiter.maxAttempts [Number] The maximum number of requests - * to send while waiting - * @callback callback function(err, data) - * If a callback is supplied, it is called when a response is returned - * from the service. - * @param err [Error] the error object returned from the request. - * Set to `null` if the request is successful. - * @param data [Object] the de-serialized data returned from - * the request. Set to `null` if a request error occurs. - */ - waitFor: function waitFor(state, params, callback) { - var waiter = new AWS.ResourceWaiter(this, state); - return waiter.wait(params, callback); - }, + // set global endpoint + service.isGlobalEndpoint = !!config.globalEndpoint; + if (config.signingRegion) { + service.signingRegion = config.signingRegion; + } + + // signature version + if (!config.signatureVersion) { + // Note: config is a global object and should not be mutated here. + // However, we are retaining this line for backwards compatibility. + // The non-v4 signatureVersion will be set in a copied object below. + config.signatureVersion = 'v4'; + } - /** - * @api private - */ - addAllRequestListeners: function addAllRequestListeners(request) { - var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(), - AWS.EventListeners.CorePost]; - for (var i = 0; i < list.length; i++) { - if (list[i]) request.addListeners(list[i]); - } + var useBearer = (service.api && service.api.signatureVersion) === 'bearer'; - // disable parameter validation - if (!this.config.paramValidation) { - request.removeListener('validate', - AWS.EventListeners.Core.VALIDATE_PARAMETERS); + // merge config + applyConfig(service, Object.assign( + {}, + config, + { signatureVersion: useBearer ? 'bearer' : config.signatureVersion } + )); + return; } + } +} - if (this.config.logger) { // add logging events - request.addListeners(AWS.EventListeners.Logger); - } +function getEndpointSuffix(region) { + var regionRegexes = { + '^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$': 'amazonaws.com', + '^cn\\-\\w+\\-\\d+$': 'amazonaws.com.cn', + '^us\\-gov\\-\\w+\\-\\d+$': 'amazonaws.com', + '^us\\-iso\\-\\w+\\-\\d+$': 'c2s.ic.gov', + '^us\\-isob\\-\\w+\\-\\d+$': 'sc2s.sgov.gov', + '^eu\\-isoe\\-west\\-1$': 'cloud.adc-e.uk', + '^us\\-isof\\-\\w+\\-\\d+$': 'csp.hci.ic.gov', + }; + var defaultSuffix = 'amazonaws.com'; + var regexes = Object.keys(regionRegexes); + for (var i = 0; i < regexes.length; i++) { + var regionPattern = RegExp(regexes[i]); + var dnsSuffix = regionRegexes[regexes[i]]; + if (regionPattern.test(region)) return dnsSuffix; + } + return defaultSuffix; +} - this.setupRequestListeners(request); - // call prototype's customRequestHandler - if (typeof this.constructor.prototype.customRequestHandler === 'function') { - this.constructor.prototype.customRequestHandler(request); - } - // call instance's customRequestHandler - if (Object.prototype.hasOwnProperty.call(this, 'customRequestHandler') && typeof this.customRequestHandler === 'function') { - this.customRequestHandler(request); - } - }, +/** + * @api private + */ +module.exports = { + configureEndpoint: configureEndpoint, + getEndpointSuffix: getEndpointSuffix, +}; - /** - * Event recording metrics for a whole API call. - * @returns {object} a subset of api call metrics - * @api private - */ - apiCallEvent: function apiCallEvent(request) { - var api = request.service.api.operations[request.operation]; - var monitoringEvent = { - Type: 'ApiCall', - Api: api ? api.name : request.operation, - Version: 1, - Service: request.service.api.serviceId || request.service.api.endpointPrefix, - Region: request.httpRequest.region, - MaxRetriesExceeded: 0, - UserAgent: request.httpRequest.getUserAgent(), - }; - var response = request.response; - if (response.httpResponse.statusCode) { - monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode; - } - if (response.error) { - var error = response.error; - var statusCode = response.httpResponse.statusCode; - if (statusCode > 299) { - if (error.code) monitoringEvent.FinalAwsException = error.code; - if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message; - } else { - if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name; - if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message; - } - } - return monitoringEvent; - }, - /** - * Event recording metrics for an API call attempt. - * @returns {object} a subset of api call attempt metrics - * @api private - */ - apiAttemptEvent: function apiAttemptEvent(request) { - var api = request.service.api.operations[request.operation]; - var monitoringEvent = { - Type: 'ApiCallAttempt', - Api: api ? api.name : request.operation, - Version: 1, - Service: request.service.api.serviceId || request.service.api.endpointPrefix, - Fqdn: request.httpRequest.endpoint.hostname, - UserAgent: request.httpRequest.getUserAgent(), - }; - var response = request.response; - if (response.httpResponse.statusCode) { - monitoringEvent.HttpStatusCode = response.httpResponse.statusCode; - } - if ( - !request._unAuthenticated && - request.service.config.credentials && - request.service.config.credentials.accessKeyId - ) { - monitoringEvent.AccessKey = request.service.config.credentials.accessKeyId; - } - if (!response.httpResponse.headers) return monitoringEvent; - if (request.httpRequest.headers['x-amz-security-token']) { - monitoringEvent.SessionToken = request.httpRequest.headers['x-amz-security-token']; - } - if (response.httpResponse.headers['x-amzn-requestid']) { - monitoringEvent.XAmznRequestId = response.httpResponse.headers['x-amzn-requestid']; - } - if (response.httpResponse.headers['x-amz-request-id']) { - monitoringEvent.XAmzRequestId = response.httpResponse.headers['x-amz-request-id']; - } - if (response.httpResponse.headers['x-amz-id-2']) { - monitoringEvent.XAmzId2 = response.httpResponse.headers['x-amz-id-2']; - } - return monitoringEvent; - }, +/***/ }), - /** - * Add metrics of failed request. - * @api private - */ - attemptFailEvent: function attemptFailEvent(request) { - var monitoringEvent = this.apiAttemptEvent(request); - var response = request.response; - var error = response.error; - if (response.httpResponse.statusCode > 299 ) { - if (error.code) monitoringEvent.AwsException = error.code; - if (error.message) monitoringEvent.AwsExceptionMessage = error.message; - } else { - if (error.code || error.name) monitoringEvent.SdkException = error.code || error.name; - if (error.message) monitoringEvent.SdkExceptionMessage = error.message; - } - return monitoringEvent; - }, +/***/ 78652: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Attach listeners to request object to fetch metrics of each request - * and emit data object through \'ApiCall\' and \'ApiCallAttempt\' events. - * @api private - */ - attachMonitoringEmitter: function attachMonitoringEmitter(request) { - var attemptTimestamp; //timestamp marking the beginning of a request attempt - var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency - var attemptLatency; //latency from request sent out to http response reaching SDK - var callStartRealTime; //Start time of API call. Used to calculating API call latency - var attemptCount = 0; //request.retryCount is not reliable here - var region; //region cache region for each attempt since it can be updated in plase (e.g. s3) - var callTimestamp; //timestamp when the request is created +var AWS = __nccwpck_require__(28437); +var AcceptorStateMachine = __nccwpck_require__(68118); +var inherit = AWS.util.inherit; +var domain = AWS.util.domain; +var jmespath = __nccwpck_require__(87783); + +/** + * @api private + */ +var hardErrorStates = {success: 1, error: 1, complete: 1}; + +function isTerminalState(machine) { + return Object.prototype.hasOwnProperty.call(hardErrorStates, machine._asm.currentState); +} + +var fsm = new AcceptorStateMachine(); +fsm.setupStates = function() { + var transition = function(_, done) { var self = this; - var addToHead = true; + self._haltHandlersOnError = false; - request.on('validate', function () { - callStartRealTime = AWS.util.realClock.now(); - callTimestamp = Date.now(); - }, addToHead); - request.on('sign', function () { - attemptStartRealTime = AWS.util.realClock.now(); - attemptTimestamp = Date.now(); - region = request.httpRequest.region; - attemptCount++; - }, addToHead); - request.on('validateResponse', function() { - attemptLatency = Math.round(AWS.util.realClock.now() - attemptStartRealTime); - }); - request.addNamedListener('API_CALL_ATTEMPT', 'success', function API_CALL_ATTEMPT() { - var apiAttemptEvent = self.apiAttemptEvent(request); - apiAttemptEvent.Timestamp = attemptTimestamp; - apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; - apiAttemptEvent.Region = region; - self.emit('apiCallAttempt', [apiAttemptEvent]); - }); - request.addNamedListener('API_CALL_ATTEMPT_RETRY', 'retry', function API_CALL_ATTEMPT_RETRY() { - var apiAttemptEvent = self.attemptFailEvent(request); - apiAttemptEvent.Timestamp = attemptTimestamp; - //attemptLatency may not be available if fail before response - attemptLatency = attemptLatency || - Math.round(AWS.util.realClock.now() - attemptStartRealTime); - apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; - apiAttemptEvent.Region = region; - self.emit('apiCallAttempt', [apiAttemptEvent]); - }); - request.addNamedListener('API_CALL', 'complete', function API_CALL() { - var apiCallEvent = self.apiCallEvent(request); - apiCallEvent.AttemptCount = attemptCount; - if (apiCallEvent.AttemptCount <= 0) return; - apiCallEvent.Timestamp = callTimestamp; - var latency = Math.round(AWS.util.realClock.now() - callStartRealTime); - apiCallEvent.Latency = latency >= 0 ? latency : 0; - var response = request.response; - if ( - response.error && - response.error.retryable && - typeof response.retryCount === 'number' && - typeof response.maxRetries === 'number' && - (response.retryCount >= response.maxRetries) - ) { - apiCallEvent.MaxRetriesExceeded = 1; + self.emit(self._asm.currentState, function(err) { + if (err) { + if (isTerminalState(self)) { + if (domain && self.domain instanceof domain.Domain) { + err.domainEmitter = self; + err.domain = self.domain; + err.domainThrown = false; + self.domain.emit('error', err); + } else { + throw err; + } + } else { + self.response.error = err; + done(err); + } + } else { + done(self.response.error); } - self.emit('apiCall', [apiCallEvent]); }); - }, - - /** - * Override this method to setup any custom request listeners for each - * new request to the service. - * - * @method_abstract This is an abstract method. - */ - setupRequestListeners: function setupRequestListeners(request) { - }, - - /** - * Gets the signing name for a given request - * @api private - */ - getSigningName: function getSigningName() { - return this.api.signingName || this.api.endpointPrefix; - }, - /** - * Gets the signer class for a given request - * @api private - */ - getSignerClass: function getSignerClass(request) { - var version; - // get operation authtype if present - var operation = null; - var authtype = ''; - if (request) { - var operations = request.service.api.operations || {}; - operation = operations[request.operation] || null; - authtype = operation ? operation.authtype : ''; - } - if (this.config.signatureVersion) { - version = this.config.signatureVersion; - } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') { - version = 'v4'; - } else if (authtype === 'bearer') { - version = 'bearer'; - } else { - version = this.api.signatureVersion; - } - return AWS.Signers.RequestSigner.getVersion(version); - }, + }; - /** - * @api private - */ - serviceInterface: function serviceInterface() { - switch (this.api.protocol) { - case 'ec2': return AWS.EventListeners.Query; - case 'query': return AWS.EventListeners.Query; - case 'json': return AWS.EventListeners.Json; - case 'rest-json': return AWS.EventListeners.RestJson; - case 'rest-xml': return AWS.EventListeners.RestXml; - } - if (this.api.protocol) { - throw new Error('Invalid service `protocol\' ' + - this.api.protocol + ' in API config'); - } - }, + this.addState('validate', 'build', 'error', transition); + this.addState('build', 'afterBuild', 'restart', transition); + this.addState('afterBuild', 'sign', 'restart', transition); + this.addState('sign', 'send', 'retry', transition); + this.addState('retry', 'afterRetry', 'afterRetry', transition); + this.addState('afterRetry', 'sign', 'error', transition); + this.addState('send', 'validateResponse', 'retry', transition); + this.addState('validateResponse', 'extractData', 'extractError', transition); + this.addState('extractError', 'extractData', 'retry', transition); + this.addState('extractData', 'success', 'retry', transition); + this.addState('restart', 'build', 'error', transition); + this.addState('success', 'complete', 'complete', transition); + this.addState('error', 'complete', 'complete', transition); + this.addState('complete', null, null, transition); +}; +fsm.setupStates(); - /** - * @api private - */ - successfulResponse: function successfulResponse(resp) { - return resp.httpResponse.statusCode < 300; - }, +/** + * ## Asynchronous Requests + * + * All requests made through the SDK are asynchronous and use a + * callback interface. Each service method that kicks off a request + * returns an `AWS.Request` object that you can use to register + * callbacks. + * + * For example, the following service method returns the request + * object as "request", which can be used to register callbacks: + * + * ```javascript + * // request is an AWS.Request object + * var request = ec2.describeInstances(); + * + * // register callbacks on request to retrieve response data + * request.on('success', function(response) { + * console.log(response.data); + * }); + * ``` + * + * When a request is ready to be sent, the {send} method should + * be called: + * + * ```javascript + * request.send(); + * ``` + * + * Since registered callbacks may or may not be idempotent, requests should only + * be sent once. To perform the same operation multiple times, you will need to + * create multiple request objects, each with its own registered callbacks. + * + * ## Removing Default Listeners for Events + * + * Request objects are built with default listeners for the various events, + * depending on the service type. In some cases, you may want to remove + * some built-in listeners to customize behaviour. Doing this requires + * access to the built-in listener functions, which are exposed through + * the {AWS.EventListeners.Core} namespace. For instance, you may + * want to customize the HTTP handler used when sending a request. In this + * case, you can remove the built-in listener associated with the 'send' + * event, the {AWS.EventListeners.Core.SEND} listener and add your own. + * + * ## Multiple Callbacks and Chaining + * + * You can register multiple callbacks on any request object. The + * callbacks can be registered for different events, or all for the + * same event. In addition, you can chain callback registration, for + * example: + * + * ```javascript + * request. + * on('success', function(response) { + * console.log("Success!"); + * }). + * on('error', function(error, response) { + * console.log("Error!"); + * }). + * on('complete', function(response) { + * console.log("Always!"); + * }). + * send(); + * ``` + * + * The above example will print either "Success! Always!", or "Error! Always!", + * depending on whether the request succeeded or not. + * + * @!attribute httpRequest + * @readonly + * @!group HTTP Properties + * @return [AWS.HttpRequest] the raw HTTP request object + * containing request headers and body information + * sent by the service. + * + * @!attribute startTime + * @readonly + * @!group Operation Properties + * @return [Date] the time that the request started + * + * @!group Request Building Events + * + * @!event validate(request) + * Triggered when a request is being validated. Listeners + * should throw an error if the request should not be sent. + * @param request [Request] the request object being sent + * @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS + * @see AWS.EventListeners.Core.VALIDATE_REGION + * @example Ensuring that a certain parameter is set before sending a request + * var req = s3.putObject(params); + * req.on('validate', function() { + * if (!req.params.Body.match(/^Hello\s/)) { + * throw new Error('Body must start with "Hello "'); + * } + * }); + * req.send(function(err, data) { ... }); + * + * @!event build(request) + * Triggered when the request payload is being built. Listeners + * should fill the necessary information to send the request + * over HTTP. + * @param (see AWS.Request~validate) + * @example Add a custom HTTP header to a request + * var req = s3.putObject(params); + * req.on('build', function() { + * req.httpRequest.headers['Custom-Header'] = 'value'; + * }); + * req.send(function(err, data) { ... }); + * + * @!event sign(request) + * Triggered when the request is being signed. Listeners should + * add the correct authentication headers and/or adjust the body, + * depending on the authentication mechanism being used. + * @param (see AWS.Request~validate) + * + * @!group Request Sending Events + * + * @!event send(response) + * Triggered when the request is ready to be sent. Listeners + * should call the underlying transport layer to initiate + * the sending of the request. + * @param response [Response] the response object + * @context [Request] the request object that was sent + * @see AWS.EventListeners.Core.SEND + * + * @!event retry(response) + * Triggered when a request failed and might need to be retried or redirected. + * If the response is retryable, the listener should set the + * `response.error.retryable` property to `true`, and optionally set + * `response.error.retryDelay` to the millisecond delay for the next attempt. + * In the case of a redirect, `response.error.redirect` should be set to + * `true` with `retryDelay` set to an optional delay on the next request. + * + * If a listener decides that a request should not be retried, + * it should set both `retryable` and `redirect` to false. + * + * Note that a retryable error will be retried at most + * {AWS.Config.maxRetries} times (based on the service object's config). + * Similarly, a request that is redirected will only redirect at most + * {AWS.Config.maxRedirects} times. + * + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * @example Adding a custom retry for a 404 response + * request.on('retry', function(response) { + * // this resource is not yet available, wait 10 seconds to get it again + * if (response.httpResponse.statusCode === 404 && response.error) { + * response.error.retryable = true; // retry this error + * response.error.retryDelay = 10000; // wait 10 seconds + * } + * }); + * + * @!group Data Parsing Events + * + * @!event extractError(response) + * Triggered on all non-2xx requests so that listeners can extract + * error details from the response body. Listeners to this event + * should set the `response.error` property. + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * + * @!event extractData(response) + * Triggered in successful requests to allow listeners to + * de-serialize the response body into `response.data`. + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * + * @!group Completion Events + * + * @!event success(response) + * Triggered when the request completed successfully. + * `response.data` will contain the response data and + * `response.error` will be null. + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * + * @!event error(error, response) + * Triggered when an error occurs at any point during the + * request. `response.error` will contain details about the error + * that occurred. `response.data` will be null. + * @param error [Error] the error object containing details about + * the error that occurred. + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * + * @!event complete(response) + * Triggered whenever a request cycle completes. `response.error` + * should be checked, since the request may have failed. + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * + * @!group HTTP Events + * + * @!event httpHeaders(statusCode, headers, response, statusMessage) + * Triggered when headers are sent by the remote server + * @param statusCode [Integer] the HTTP response code + * @param headers [map] the response headers + * @param (see AWS.Request~send) + * @param statusMessage [String] A status message corresponding to the HTTP + * response code + * @context (see AWS.Request~send) + * + * @!event httpData(chunk, response) + * Triggered when data is sent by the remote server + * @param chunk [Buffer] the buffer data containing the next data chunk + * from the server + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * @see AWS.EventListeners.Core.HTTP_DATA + * + * @!event httpUploadProgress(progress, response) + * Triggered when the HTTP request has uploaded more data + * @param progress [map] An object containing the `loaded` and `total` bytes + * of the request. + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * @note This event will not be emitted in Node.js 0.8.x. + * + * @!event httpDownloadProgress(progress, response) + * Triggered when the HTTP request has downloaded more data + * @param progress [map] An object containing the `loaded` and `total` bytes + * of the request. + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * @note This event will not be emitted in Node.js 0.8.x. + * + * @!event httpError(error, response) + * Triggered when the HTTP request failed + * @param error [Error] the error object that was thrown + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * + * @!event httpDone(response) + * Triggered when the server is finished sending data + * @param (see AWS.Request~send) + * @context (see AWS.Request~send) + * + * @see AWS.Response + */ +AWS.Request = inherit({ /** - * How many times a failed request should be retried before giving up. - * the defaultRetryCount can be overriden by service classes. + * Creates a request for an operation on a given service with + * a set of input parameters. * - * @api private - */ - numRetries: function numRetries() { - if (this.config.maxRetries !== undefined) { - return this.config.maxRetries; - } else { - return this.defaultRetryCount; - } - }, - - /** - * @api private - */ - retryDelays: function retryDelays(retryCount, err) { - return AWS.util.calculateRetryDelay(retryCount, this.config.retryDelayOptions, err); - }, - - /** - * @api private + * @param service [AWS.Service] the service to perform the operation on + * @param operation [String] the operation to perform on the service + * @param params [Object] parameters to send to the operation. + * See the operation's documentation for the format of the + * parameters. */ - retryableError: function retryableError(error) { - if (this.timeoutError(error)) return true; - if (this.networkingError(error)) return true; - if (this.expiredCredentialsError(error)) return true; - if (this.throttledError(error)) return true; - if (error.statusCode >= 500) return true; - return false; - }, + constructor: function Request(service, operation, params) { + var endpoint = service.endpoint; + var region = service.config.region; + var customUserAgent = service.config.customUserAgent; - /** - * @api private - */ - networkingError: function networkingError(error) { - return error.code === 'NetworkingError'; - }, + if (service.signingRegion) { + region = service.signingRegion; + } else if (service.isGlobalEndpoint) { + region = 'us-east-1'; + } - /** - * @api private - */ - timeoutError: function timeoutError(error) { - return error.code === 'TimeoutError'; - }, + this.domain = domain && domain.active; + this.service = service; + this.operation = operation; + this.params = params || {}; + this.httpRequest = new AWS.HttpRequest(endpoint, region); + this.httpRequest.appendToUserAgent(customUserAgent); + this.startTime = service.getSkewCorrectedDate(); - /** - * @api private - */ - expiredCredentialsError: function expiredCredentialsError(error) { - // TODO : this only handles *one* of the expired credential codes - return (error.code === 'ExpiredTokenException'); - }, + this.response = new AWS.Response(this); + this._asm = new AcceptorStateMachine(fsm.states, 'validate'); + this._haltHandlersOnError = false; - /** - * @api private - */ - clockSkewError: function clockSkewError(error) { - switch (error.code) { - case 'RequestTimeTooSkewed': - case 'RequestExpired': - case 'InvalidSignatureException': - case 'SignatureDoesNotMatch': - case 'AuthFailure': - case 'RequestInTheFuture': - return true; - default: return false; - } + AWS.SequentialExecutor.call(this); + this.emit = this.emitEvent; }, /** - * @api private + * @!group Sending a Request */ - getSkewCorrectedDate: function getSkewCorrectedDate() { - return new Date(Date.now() + this.config.systemClockOffset); - }, /** - * @api private + * @overload send(callback = null) + * Sends the request object. + * + * @callback callback function(err, data) + * If a callback is supplied, it is called when a response is returned + * from the service. + * @context [AWS.Request] the request object being sent. + * @param err [Error] the error object returned from the request. + * Set to `null` if the request is successful. + * @param data [Object] the de-serialized data returned from + * the request. Set to `null` if a request error occurs. + * @example Sending a request with a callback + * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); + * request.send(function(err, data) { console.log(err, data); }); + * @example Sending a request with no callback (using event handlers) + * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); + * request.on('complete', function(response) { ... }); // register a callback + * request.send(); */ - applyClockOffset: function applyClockOffset(newServerTime) { - if (newServerTime) { - this.config.systemClockOffset = newServerTime - Date.now(); + send: function send(callback) { + if (callback) { + // append to user agent + this.httpRequest.appendToUserAgent('callback'); + this.on('complete', function (resp) { + callback.call(resp, resp.error, resp.data); + }); } - }, + this.runTo(); - /** - * @api private - */ - isClockSkewed: function isClockSkewed(newServerTime) { - if (newServerTime) { - return Math.abs(this.getSkewCorrectedDate().getTime() - newServerTime) >= 300000; - } + return this.response; }, /** - * @api private + * @!method promise() + * Sends the request and returns a 'thenable' promise. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function(data) + * Called if the promise is fulfilled. + * @param data [Object] the de-serialized data returned from the request. + * @callback rejectedCallback function(error) + * Called if the promise is rejected. + * @param error [Error] the error object returned from the request. + * @return [Promise] A promise that represents the state of the request. + * @example Sending a request using promises. + * var request = s3.putObject({Bucket: 'bucket', Key: 'key'}); + * var result = request.promise(); + * result.then(function(data) { ... }, function(error) { ... }); */ - throttledError: function throttledError(error) { - // this logic varies between services - if (error.statusCode === 429) return true; - switch (error.code) { - case 'ProvisionedThroughputExceededException': - case 'Throttling': - case 'ThrottlingException': - case 'RequestLimitExceeded': - case 'RequestThrottled': - case 'RequestThrottledException': - case 'TooManyRequestsException': - case 'TransactionInProgressException': //dynamodb - case 'EC2ThrottledException': - return true; - default: - return false; - } - }, /** * @api private */ - endpointFromTemplate: function endpointFromTemplate(endpoint) { - if (typeof endpoint !== 'string') return endpoint; - - var e = endpoint; - e = e.replace(/\{service\}/g, this.api.endpointPrefix); - e = e.replace(/\{region\}/g, this.config.region); - e = e.replace(/\{scheme\}/g, this.config.sslEnabled ? 'https' : 'http'); - return e; + build: function build(callback) { + return this.runTo('send', callback); }, /** * @api private */ - setEndpoint: function setEndpoint(endpoint) { - this.endpoint = new AWS.Endpoint(endpoint, this.config); + runTo: function runTo(state, done) { + this._asm.runTo(state, done, this); + return this; }, /** - * @api private - */ - paginationConfig: function paginationConfig(operation, throwException) { - var paginator = this.api.operations[operation].paginator; - if (!paginator) { - if (throwException) { - var e = new Error(); - throw AWS.util.error(e, 'No pagination configuration for ' + operation); - } - return null; - } - - return paginator; - } -}); - -AWS.util.update(AWS.Service, { - - /** - * Adds one method for each operation described in the api configuration + * Aborts a request, emitting the error and complete events. * - * @api private - */ - defineMethods: function defineMethods(svc) { - AWS.util.each(svc.prototype.api.operations, function iterator(method) { - if (svc.prototype[method]) return; - var operation = svc.prototype.api.operations[method]; - if (operation.authtype === 'none') { - svc.prototype[method] = function (params, callback) { - return this.makeUnauthenticatedRequest(method, params, callback); - }; - } else { - svc.prototype[method] = function (params, callback) { - return this.makeRequest(method, params, callback); - }; - } - }); - }, - - /** - * Defines a new Service class using a service identifier and list of versions - * including an optional set of features (functions) to apply to the class - * prototype. + * @!macro nobrowser + * @example Aborting a request after sending + * var params = { + * Bucket: 'bucket', Key: 'key', + * Body: Buffer.alloc(1024 * 1024 * 5) // 5MB payload + * }; + * var request = s3.putObject(params); + * request.send(function (err, data) { + * if (err) console.log("Error:", err.code, err.message); + * else console.log(data); + * }); * - * @param serviceIdentifier [String] the identifier for the service - * @param versions [Array] a list of versions that work with this - * service - * @param features [Object] an object to attach to the prototype - * @return [Class] the service class defined by this function. - */ - defineService: function defineService(serviceIdentifier, versions, features) { - AWS.Service._serviceMap[serviceIdentifier] = true; - if (!Array.isArray(versions)) { - features = versions; - versions = []; - } - - var svc = inherit(AWS.Service, features || {}); - - if (typeof serviceIdentifier === 'string') { - AWS.Service.addVersions(svc, versions); - - var identifier = svc.serviceIdentifier || serviceIdentifier; - svc.serviceIdentifier = identifier; - } else { // defineService called with an API - svc.prototype.api = serviceIdentifier; - AWS.Service.defineMethods(svc); - } - AWS.SequentialExecutor.call(this.prototype); - //util.clientSideMonitoring is only available in node - if (!this.prototype.publisher && AWS.util.clientSideMonitoring) { - var Publisher = AWS.util.clientSideMonitoring.Publisher; - var configProvider = AWS.util.clientSideMonitoring.configProvider; - var publisherConfig = configProvider(); - this.prototype.publisher = new Publisher(publisherConfig); - if (publisherConfig.enabled) { - //if csm is enabled in environment, SDK should send all metrics - AWS.Service._clientSideMonitoring = true; - } - } - AWS.SequentialExecutor.call(svc.prototype); - AWS.Service.addDefaultMonitoringListeners(svc.prototype); - return svc; - }, - - /** - * @api private + * // abort request in 1 second + * setTimeout(request.abort.bind(request), 1000); + * + * // prints "Error: RequestAbortedError Request aborted by user" + * @return [AWS.Request] the same request object, for chaining. + * @since v1.4.0 */ - addVersions: function addVersions(svc, versions) { - if (!Array.isArray(versions)) versions = [versions]; + abort: function abort() { + this.removeAllListeners('validateResponse'); + this.removeAllListeners('extractError'); + this.on('validateResponse', function addAbortedError(resp) { + resp.error = AWS.util.error(new Error('Request aborted by user'), { + code: 'RequestAbortedError', retryable: false + }); + }); - svc.services = svc.services || {}; - for (var i = 0; i < versions.length; i++) { - if (svc.services[versions[i]] === undefined) { - svc.services[versions[i]] = null; + if (this.httpRequest.stream && !this.httpRequest.stream.didCallback) { // abort HTTP stream + this.httpRequest.stream.abort(); + if (this.httpRequest._abortCallback) { + this.httpRequest._abortCallback(); + } else { + this.removeAllListeners('send'); // haven't sent yet, so let's not } } - svc.apiVersions = Object.keys(svc.services).sort(); + return this; }, /** - * @api private + * Iterates over each page of results given a pageable request, calling + * the provided callback with each page of data. After all pages have been + * retrieved, the callback is called with `null` data. + * + * @note This operation can generate multiple requests to a service. + * @example Iterating over multiple pages of objects in an S3 bucket + * var pages = 1; + * s3.listObjects().eachPage(function(err, data) { + * if (err) return; + * console.log("Page", pages++); + * console.log(data); + * }); + * @example Iterating over multiple pages with an asynchronous callback + * s3.listObjects(params).eachPage(function(err, data, done) { + * doSomethingAsyncAndOrExpensive(function() { + * // The next page of results isn't fetched until done is called + * done(); + * }); + * }); + * @callback callback function(err, data, [doneCallback]) + * Called with each page of resulting data from the request. If the + * optional `doneCallback` is provided in the function, it must be called + * when the callback is complete. + * + * @param err [Error] an error object, if an error occurred. + * @param data [Object] a single page of response data. If there is no + * more data, this object will be `null`. + * @param doneCallback [Function] an optional done callback. If this + * argument is defined in the function declaration, it should be called + * when the next page is ready to be retrieved. This is useful for + * controlling serial pagination across asynchronous operations. + * @return [Boolean] if the callback returns `false`, pagination will + * stop. + * + * @see AWS.Request.eachItem + * @see AWS.Response.nextPage + * @since v1.4.0 */ - defineServiceApi: function defineServiceApi(superclass, version, apiConfig) { - var svc = inherit(superclass, { - serviceIdentifier: superclass.serviceIdentifier - }); + eachPage: function eachPage(callback) { + // Make all callbacks async-ish + callback = AWS.util.fn.makeAsync(callback, 3); - function setApi(api) { - if (api.isApi) { - svc.prototype.api = api; - } else { - svc.prototype.api = new Api(api, { - serviceIdentifier: superclass.serviceIdentifier - }); - } - } + function wrappedCallback(response) { + callback.call(response, response.error, response.data, function (result) { + if (result === false) return; - if (typeof version === 'string') { - if (apiConfig) { - setApi(apiConfig); - } else { - try { - setApi(AWS.apiLoader(superclass.serviceIdentifier, version)); - } catch (err) { - throw AWS.util.error(err, { - message: 'Could not find API configuration ' + - superclass.serviceIdentifier + '-' + version - }); + if (response.hasNextPage()) { + response.nextPage().on('complete', wrappedCallback).send(); + } else { + callback.call(response, null, null, AWS.util.fn.noop); } - } - if (!Object.prototype.hasOwnProperty.call(superclass.services, version)) { - superclass.apiVersions = superclass.apiVersions.concat(version).sort(); - } - superclass.services[version] = svc; - } else { - setApi(version); + }); } - AWS.Service.defineMethods(svc); - return svc; - }, - - /** - * @api private - */ - hasService: function(identifier) { - return Object.prototype.hasOwnProperty.call(AWS.Service._serviceMap, identifier); + this.on('complete', wrappedCallback).send(); }, /** - * @param attachOn attach default monitoring listeners to object + * Enumerates over individual items of a request, paging the responses if + * necessary. * - * Each monitoring event should be emitted from service client to service constructor prototype and then - * to global service prototype like bubbling up. These default monitoring events listener will transfer - * the monitoring events to the upper layer. - * @api private - */ - addDefaultMonitoringListeners: function addDefaultMonitoringListeners(attachOn) { - attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) { - var baseClass = Object.getPrototypeOf(attachOn); - if (baseClass._events) baseClass.emit('apiCallAttempt', [event]); - }); - attachOn.addNamedListener('CALL_EVENTS_BUBBLE', 'apiCall', function CALL_EVENTS_BUBBLE(event) { - var baseClass = Object.getPrototypeOf(attachOn); - if (baseClass._events) baseClass.emit('apiCall', [event]); - }); - }, - - /** - * @api private + * @api experimental + * @since v1.4.0 */ - _serviceMap: {} -}); - -AWS.util.mixin(AWS.Service, AWS.SequentialExecutor); - -/** - * @api private - */ -module.exports = AWS.Service; - - -/***/ }), - -/***/ 4338: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); - -AWS.util.update(AWS.APIGateway.prototype, { -/** - * Sets the Accept header to application/json. - * - * @api private - */ - setAcceptHeader: function setAcceptHeader(req) { - var httpRequest = req.httpRequest; - if (!httpRequest.headers.Accept) { - httpRequest.headers['Accept'] = 'application/json'; + eachItem: function eachItem(callback) { + var self = this; + function wrappedCallback(err, data) { + if (err) return callback(err, null); + if (data === null) return callback(null, null); + + var config = self.service.paginationConfig(self.operation); + var resultKey = config.resultKey; + if (Array.isArray(resultKey)) resultKey = resultKey[0]; + var items = jmespath.search(data, resultKey); + var continueIteration = true; + AWS.util.arrayEach(items, function(item) { + continueIteration = callback(null, item); + if (continueIteration === false) { + return AWS.util.abort; + } + }); + return continueIteration; } + + this.eachPage(wrappedCallback); }, /** - * @api private + * @return [Boolean] whether the operation can return multiple pages of + * response data. + * @see AWS.Response.eachPage + * @since v1.4.0 */ - setupRequestListeners: function setupRequestListeners(request) { - request.addListener('build', this.setAcceptHeader); - if (request.operation === 'getExport') { - var params = request.params || {}; - if (params.exportType === 'swagger') { - request.addListener('extractData', AWS.util.convertPayloadToString); - } - } - } -}); + isPageable: function isPageable() { + return this.service.paginationConfig(this.operation) ? true : false; + }, + /** + * Sends the request and converts the request object into a readable stream + * that can be read from or piped into a writable stream. + * + * @note The data read from a readable stream contains only + * the raw HTTP body contents. + * @example Manually reading from a stream + * request.createReadStream().on('data', function(data) { + * console.log("Got data:", data.toString()); + * }); + * @example Piping a request body into a file + * var out = fs.createWriteStream('/path/to/outfile.jpg'); + * s3.service.getObject(params).createReadStream().pipe(out); + * @return [Stream] the readable stream object that can be piped + * or read from (by registering 'data' event listeners). + * @!macro nobrowser + */ + createReadStream: function createReadStream() { + var streams = AWS.util.stream; + var req = this; + var stream = null; + if (AWS.HttpClient.streamsApiVersion === 2) { + stream = new streams.PassThrough(); + process.nextTick(function() { req.send(); }); + } else { + stream = new streams.Stream(); + stream.readable = true; -/***/ }), + stream.sent = false; + stream.on('newListener', function(event) { + if (!stream.sent && event === 'data') { + stream.sent = true; + process.nextTick(function() { req.send(); }); + } + }); + } -/***/ 95483: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + this.on('error', function(err) { + stream.emit('error', err); + }); -var AWS = __nccwpck_require__(28437); + this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) { + if (statusCode < 300) { + req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA); + req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR); + req.on('httpError', function streamHttpError(error) { + resp.error = error; + resp.error.retryable = false; + }); -// pull in CloudFront signer -__nccwpck_require__(93260); + var shouldCheckContentLength = false; + var expectedLen; + if (req.httpRequest.method !== 'HEAD') { + expectedLen = parseInt(headers['content-length'], 10); + } + if (expectedLen !== undefined && !isNaN(expectedLen) && expectedLen >= 0) { + shouldCheckContentLength = true; + var receivedLen = 0; + } -AWS.util.update(AWS.CloudFront.prototype, { + var checkContentLengthAndEmit = function checkContentLengthAndEmit() { + if (shouldCheckContentLength && receivedLen !== expectedLen) { + stream.emit('error', AWS.util.error( + new Error('Stream content length mismatch. Received ' + + receivedLen + ' of ' + expectedLen + ' bytes.'), + { code: 'StreamContentLengthMismatch' } + )); + } else if (AWS.HttpClient.streamsApiVersion === 2) { + stream.end(); + } else { + stream.emit('end'); + } + }; - setupRequestListeners: function setupRequestListeners(request) { - request.addListener('extractData', AWS.util.hoistPayloadMember); - } + var httpStream = resp.httpResponse.createUnbufferedStream(); -}); + if (AWS.HttpClient.streamsApiVersion === 2) { + if (shouldCheckContentLength) { + var lengthAccumulator = new streams.PassThrough(); + lengthAccumulator._write = function(chunk) { + if (chunk && chunk.length) { + receivedLen += chunk.length; + } + return streams.PassThrough.prototype._write.apply(this, arguments); + }; + lengthAccumulator.on('end', checkContentLengthAndEmit); + stream.on('error', function(err) { + shouldCheckContentLength = false; + httpStream.unpipe(lengthAccumulator); + lengthAccumulator.emit('end'); + lengthAccumulator.end(); + }); + httpStream.pipe(lengthAccumulator).pipe(stream, { end: false }); + } else { + httpStream.pipe(stream); + } + } else { -/***/ }), + if (shouldCheckContentLength) { + httpStream.on('data', function(arg) { + if (arg && arg.length) { + receivedLen += arg.length; + } + }); + } -/***/ 48571: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + httpStream.on('data', function(arg) { + stream.emit('data', arg); + }); + httpStream.on('end', checkContentLengthAndEmit); + } -var AWS = __nccwpck_require__(28437); + httpStream.on('error', function(err) { + shouldCheckContentLength = false; + stream.emit('error', err); + }); + } + }); -/** - * Constructs a service interface object. Each API operation is exposed as a - * function on service. - * - * ### Sending a Request Using CloudSearchDomain - * - * ```javascript - * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); - * csd.search(params, function (err, data) { - * if (err) console.log(err, err.stack); // an error occurred - * else console.log(data); // successful response - * }); - * ``` - * - * ### Locking the API Version - * - * In order to ensure that the CloudSearchDomain object uses this specific API, - * you can construct the object by passing the `apiVersion` option to the - * constructor: - * - * ```javascript - * var csd = new AWS.CloudSearchDomain({ - * endpoint: 'my.host.tld', - * apiVersion: '2013-01-01' - * }); - * ``` - * - * You can also set the API version globally in `AWS.config.apiVersions` using - * the **cloudsearchdomain** service identifier: - * - * ```javascript - * AWS.config.apiVersions = { - * cloudsearchdomain: '2013-01-01', - * // other service API versions - * }; - * - * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); - * ``` - * - * @note You *must* provide an `endpoint` configuration parameter when - * constructing this service. See {constructor} for more information. - * - * @!method constructor(options = {}) - * Constructs a service object. This object has one method for each - * API operation. - * - * @example Constructing a CloudSearchDomain object - * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); - * @note You *must* provide an `endpoint` when constructing this service. - * @option (see AWS.Config.constructor) - * - * @service cloudsearchdomain - * @version 2013-01-01 - */ -AWS.util.update(AWS.CloudSearchDomain.prototype, { - /** - * @api private - */ - validateService: function validateService() { - if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { - var msg = 'AWS.CloudSearchDomain requires an explicit ' + - '`endpoint\' configuration option.'; - throw AWS.util.error(new Error(), - {name: 'InvalidEndpoint', message: msg}); - } + return stream; }, /** + * @param [Array,Response] args This should be the response object, + * or an array of args to send to the event. * @api private */ - setupRequestListeners: function setupRequestListeners(request) { - request.removeListener('validate', - AWS.EventListeners.Core.VALIDATE_CREDENTIALS - ); - request.onAsync('validate', this.validateCredentials); - request.addListener('validate', this.updateRegion); - if (request.operation === 'search') { - request.addListener('build', this.convertGetToPost); - } - }, + emitEvent: function emit(eventName, args, done) { + if (typeof args === 'function') { done = args; args = null; } + if (!done) done = function() { }; + if (!args) args = this.eventParameters(eventName, this.response); - /** - * @api private - */ - validateCredentials: function(req, done) { - if (!req.service.api.signatureVersion) return done(); // none - req.service.config.getCredentials(function(err) { - if (err) { - req.removeListener('sign', AWS.EventListeners.Core.SIGN); - } - done(); + var origEmit = AWS.SequentialExecutor.prototype.emit; + origEmit.call(this, eventName, args, function (err) { + if (err) this.response.error = err; + done.call(this, err); }); }, /** * @api private */ - convertGetToPost: function(request) { - var httpRequest = request.httpRequest; - // convert queries to POST to avoid length restrictions - var path = httpRequest.path.split('?'); - httpRequest.method = 'POST'; - httpRequest.path = path[0]; - httpRequest.body = path[1]; - httpRequest.headers['Content-Length'] = httpRequest.body.length; - httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded'; + eventParameters: function eventParameters(eventName) { + switch (eventName) { + case 'restart': + case 'validate': + case 'sign': + case 'build': + case 'afterValidate': + case 'afterBuild': + return [this]; + case 'error': + return [this.response.error, this.response]; + default: + return [this.response]; + } }, /** * @api private */ - updateRegion: function updateRegion(request) { - var endpoint = request.httpRequest.endpoint.hostname; - var zones = endpoint.split('.'); - request.httpRequest.region = zones[1] || request.httpRequest.region; - } - -}); - - -/***/ }), - -/***/ 59050: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var rdsutil = __nccwpck_require__(30650); - -/** -* @api private -*/ -var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; - -AWS.util.update(AWS.DocDB.prototype, { - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - if ( - crossRegionOperations.indexOf(request.operation) !== -1 && - this.config.params && - this.config.params.SourceRegion && - request.params && - !request.params.SourceRegion - ) { - request.params.SourceRegion = this.config.params.SourceRegion; + presign: function presign(expires, callback) { + if (!callback && typeof expires === 'function') { + callback = expires; + expires = null; } - rdsutil.setupRequestListeners(this, request, crossRegionOperations); + return new AWS.Signers.Presign().sign(this.toGet(), expires, callback); }, -}); - - -/***/ }), - -/***/ 17101: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -__nccwpck_require__(90030); -AWS.util.update(AWS.DynamoDB.prototype, { /** * @api private */ - setupRequestListeners: function setupRequestListeners(request) { - if (request.service.config.dynamoDbCrc32) { - request.removeListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); - request.addListener('extractData', this.checkCrc32); - request.addListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); - } + isPresigned: function isPresigned() { + return Object.prototype.hasOwnProperty.call(this.httpRequest.headers, 'presigned-expires'); }, /** * @api private */ - checkCrc32: function checkCrc32(resp) { - if (!resp.httpResponse.streaming && !resp.request.service.crc32IsValid(resp)) { - resp.data = null; - resp.error = AWS.util.error(new Error(), { - code: 'CRC32CheckFailed', - message: 'CRC32 integrity check failed', - retryable: true - }); - resp.request.haltHandlersOnError(); - throw (resp.error); - } + toUnauthenticated: function toUnauthenticated() { + this._unAuthenticated = true; + this.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS); + this.removeListener('sign', AWS.EventListeners.Core.SIGN); + return this; }, /** * @api private */ - crc32IsValid: function crc32IsValid(resp) { - var crc = resp.httpResponse.headers['x-amz-crc32']; - if (!crc) return true; // no (valid) CRC32 header - return parseInt(crc, 10) === AWS.util.crypto.crc32(resp.httpResponse.body); + toGet: function toGet() { + if (this.service.api.protocol === 'query' || + this.service.api.protocol === 'ec2') { + this.removeListener('build', this.buildAsGet); + this.addListener('build', this.buildAsGet); + } + return this; }, /** * @api private */ - defaultRetryCount: 10, + buildAsGet: function buildAsGet(request) { + request.httpRequest.method = 'GET'; + request.httpRequest.path = request.service.endpoint.path + + '?' + request.httpRequest.body; + request.httpRequest.body = ''; + + // don't need these headers on a GET request + delete request.httpRequest.headers['Content-Length']; + delete request.httpRequest.headers['Content-Type']; + }, /** * @api private */ - retryDelays: function retryDelays(retryCount, err) { - var retryDelayOptions = AWS.util.copy(this.config.retryDelayOptions); - - if (typeof retryDelayOptions.base !== 'number') { - retryDelayOptions.base = 50; // default for dynamodb - } - var delay = AWS.util.calculateRetryDelay(retryCount, retryDelayOptions, err); - return delay; + haltHandlersOnError: function haltHandlersOnError() { + this._haltHandlersOnError = true; } }); +/** + * @api private + */ +AWS.Request.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.promise = function promise() { + var self = this; + // append to user agent + this.httpRequest.appendToUserAgent('promise'); + return new PromiseDependency(function(resolve, reject) { + self.on('complete', function(resp) { + if (resp.error) { + reject(resp.error); + } else { + // define $response property so that it is not enumerable + // this prevents circular reference errors when stringifying the JSON object + resolve(Object.defineProperty( + resp.data || {}, + '$response', + {value: resp} + )); + } + }); + self.runTo(); + }); + }; +}; + +/** + * @api private + */ +AWS.Request.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.promise; +}; + +AWS.util.addPromises(AWS.Request); + +AWS.util.mixin(AWS.Request, AWS.SequentialExecutor); + /***/ }), -/***/ 92501: +/***/ 39925: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You + * may not use this file except in compliance with the License. A copy of + * the License is located at + * + * http://aws.amazon.com/apache2.0/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF + * ANY KIND, either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + */ + var AWS = __nccwpck_require__(28437); +var inherit = AWS.util.inherit; +var jmespath = __nccwpck_require__(87783); -AWS.util.update(AWS.EC2.prototype, { - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - request.removeListener('extractError', AWS.EventListeners.Query.EXTRACT_ERROR); - request.addListener('extractError', this.extractError); +/** + * @api private + */ +function CHECK_ACCEPTORS(resp) { + var waiter = resp.request._waiter; + var acceptors = waiter.config.acceptors; + var acceptorMatched = false; + var state = 'retry'; - if (request.operation === 'copySnapshot') { - request.onAsync('validate', this.buildCopySnapshotPresignedUrl); + acceptors.forEach(function(acceptor) { + if (!acceptorMatched) { + var matcher = waiter.matchers[acceptor.matcher]; + if (matcher && matcher(resp, acceptor.expected, acceptor.argument)) { + acceptorMatched = true; + state = acceptor.state; + } } - }, + }); - /** - * @api private - */ - buildCopySnapshotPresignedUrl: function buildCopySnapshotPresignedUrl(req, done) { - if (req.params.PresignedUrl || req._subRequest) { - return done(); - } + if (!acceptorMatched && resp.error) state = 'failure'; - req.params = AWS.util.copy(req.params); - req.params.DestinationRegion = req.service.config.region; + if (state === 'success') { + waiter.setSuccess(resp); + } else { + waiter.setError(resp, state === 'retry'); + } +} - var config = AWS.util.copy(req.service.config); - delete config.endpoint; - config.region = req.params.SourceRegion; - var svc = new req.service.constructor(config); - var newReq = svc[req.operation](req.params); - newReq._subRequest = true; - newReq.presign(function(err, url) { - if (err) done(err); - else { - req.params.PresignedUrl = url; - done(); - } - }); +/** + * @api private + */ +AWS.ResourceWaiter = inherit({ + /** + * Waits for a given state on a service object + * @param service [Service] the service object to wait on + * @param state [String] the state (defined in waiter configuration) to wait + * for. + * @example Create a waiter for running EC2 instances + * var ec2 = new AWS.EC2; + * var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning'); + */ + constructor: function constructor(service, state) { + this.service = service; + this.state = state; + this.loadWaiterConfig(this.state); }, - /** - * @api private - */ - extractError: function extractError(resp) { - // EC2 nests the error code and message deeper than other AWS Query services. - var httpResponse = resp.httpResponse; - var data = new AWS.XML.Parser().parse(httpResponse.body.toString() || ''); - if (data.Errors) { - resp.error = AWS.util.error(new Error(), { - code: data.Errors.Error.Code, - message: data.Errors.Error.Message - }); - } else { - resp.error = AWS.util.error(new Error(), { - code: httpResponse.statusCode, - message: null - }); - } - resp.error.requestId = data.RequestID || null; - } -}); + service: null, + state: null, -/***/ }), + config: null, -/***/ 3034: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + matchers: { + path: function(resp, expected, argument) { + try { + var result = jmespath.search(resp.data, argument); + } catch (err) { + return false; + } -var AWS = __nccwpck_require__(28437); + return jmespath.strictDeepEqual(result,expected); + }, -AWS.util.update(AWS.EventBridge.prototype, { - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - if (request.operation === 'putEvents') { - var params = request.params || {}; - if (params.EndpointId !== undefined) { - throw new AWS.util.error(new Error(), { - code: 'InvalidParameter', - message: 'EndpointId is not supported in current SDK.\n' + - 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).' - }); + pathAll: function(resp, expected, argument) { + try { + var results = jmespath.search(resp.data, argument); + } catch (err) { + return false; } - } - }, -}); + if (!Array.isArray(results)) results = [results]; + var numResults = results.length; + if (!numResults) return false; + for (var ind = 0 ; ind < numResults; ind++) { + if (!jmespath.strictDeepEqual(results[ind], expected)) { + return false; + } + } + return true; + }, -/***/ }), + pathAny: function(resp, expected, argument) { + try { + var results = jmespath.search(resp.data, argument); + } catch (err) { + return false; + } -/***/ 14472: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + if (!Array.isArray(results)) results = [results]; + var numResults = results.length; + for (var ind = 0 ; ind < numResults; ind++) { + if (jmespath.strictDeepEqual(results[ind], expected)) { + return true; + } + } + return false; + }, -var AWS = __nccwpck_require__(28437); + status: function(resp, expected) { + var statusCode = resp.httpResponse.statusCode; + return (typeof statusCode === 'number') && (statusCode === expected); + }, -AWS.util.update(AWS.Glacier.prototype, { - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - if (Array.isArray(request._events.validate)) { - request._events.validate.unshift(this.validateAccountId); - } else { - request.on('validate', this.validateAccountId); + error: function(resp, expected) { + if (typeof expected === 'string' && resp.error) { + return expected === resp.error.code; + } + // if expected is not string, can be boolean indicating presence of error + return expected === !!resp.error; } - request.removeListener('afterBuild', - AWS.EventListeners.Core.COMPUTE_SHA256); - request.on('build', this.addGlacierApiVersion); - request.on('build', this.addTreeHashHeaders); }, - /** - * @api private - */ - validateAccountId: function validateAccountId(request) { - if (request.params.accountId !== undefined) return; - request.params = AWS.util.copy(request.params); - request.params.accountId = '-'; - }, + listeners: new AWS.SequentialExecutor().addNamedListeners(function(add) { + add('RETRY_CHECK', 'retry', function(resp) { + var waiter = resp.request._waiter; + if (resp.error && resp.error.code === 'ResourceNotReady') { + resp.error.retryDelay = (waiter.config.delay || 0) * 1000; + } + }); - /** - * @api private - */ - addGlacierApiVersion: function addGlacierApiVersion(request) { - var version = request.service.api.apiVersion; - request.httpRequest.headers['x-amz-glacier-version'] = version; - }, + add('CHECK_OUTPUT', 'extractData', CHECK_ACCEPTORS); + + add('CHECK_ERROR', 'extractError', CHECK_ACCEPTORS); + }), /** - * @api private + * @return [AWS.Request] */ - addTreeHashHeaders: function addTreeHashHeaders(request) { - if (request.params.body === undefined) return; - - var hashes = request.service.computeChecksums(request.params.body); - request.httpRequest.headers['X-Amz-Content-Sha256'] = hashes.linearHash; - - if (!request.httpRequest.headers['x-amz-sha256-tree-hash']) { - request.httpRequest.headers['x-amz-sha256-tree-hash'] = hashes.treeHash; + wait: function wait(params, callback) { + if (typeof params === 'function') { + callback = params; params = undefined; } - }, - /** - * @!group Computing Checksums - */ + if (params && params.$waiter) { + params = AWS.util.copy(params); + if (typeof params.$waiter.delay === 'number') { + this.config.delay = params.$waiter.delay; + } + if (typeof params.$waiter.maxAttempts === 'number') { + this.config.maxAttempts = params.$waiter.maxAttempts; + } + delete params.$waiter; + } - /** - * Computes the SHA-256 linear and tree hash checksums for a given - * block of Buffer data. Pass the tree hash of the computed checksums - * as the checksum input to the {completeMultipartUpload} when performing - * a multi-part upload. - * - * @example Calculate checksum of 5.5MB data chunk - * var glacier = new AWS.Glacier(); - * var data = Buffer.alloc(5.5 * 1024 * 1024); - * data.fill('0'); // fill with zeros - * var results = glacier.computeChecksums(data); - * // Result: { linearHash: '68aff0c5a9...', treeHash: '154e26c78f...' } - * @param data [Buffer, String] data to calculate the checksum for - * @return [map] a map containing - * the linearHash and treeHash properties representing hex based digests - * of the respective checksums. - * @see completeMultipartUpload - */ - computeChecksums: function computeChecksums(data) { - if (!AWS.util.Buffer.isBuffer(data)) data = AWS.util.buffer.toBuffer(data); + var request = this.service.makeRequest(this.config.operation, params); + request._waiter = this; + request.response.maxRetries = this.config.maxAttempts; + request.addListeners(this.listeners); - var mb = 1024 * 1024; - var hashes = []; - var hash = AWS.util.crypto.createHash('sha256'); + if (callback) request.send(callback); + return request; + }, - // build leaf nodes in 1mb chunks - for (var i = 0; i < data.length; i += mb) { - var chunk = data.slice(i, Math.min(i + mb, data.length)); - hash.update(chunk); - hashes.push(AWS.util.crypto.sha256(chunk)); - } + setSuccess: function setSuccess(resp) { + resp.error = null; + resp.data = resp.data || {}; + resp.request.removeAllListeners('extractData'); + }, - return { - linearHash: hash.digest('hex'), - treeHash: this.buildHashTree(hashes) - }; + setError: function setError(resp, retryable) { + resp.data = null; + resp.error = AWS.util.error(resp.error || new Error(), { + code: 'ResourceNotReady', + message: 'Resource is not in the state ' + this.state, + retryable: retryable + }); }, /** + * Loads waiter configuration from API configuration + * * @api private */ - buildHashTree: function buildHashTree(hashes) { - // merge leaf nodes - while (hashes.length > 1) { - var tmpHashes = []; - for (var i = 0; i < hashes.length; i += 2) { - if (hashes[i + 1]) { - var tmpHash = AWS.util.buffer.alloc(64); - tmpHash.write(hashes[i], 0, 32, 'binary'); - tmpHash.write(hashes[i + 1], 32, 32, 'binary'); - tmpHashes.push(AWS.util.crypto.sha256(tmpHash)); - } else { - tmpHashes.push(hashes[i]); - } - } - hashes = tmpHashes; + loadWaiterConfig: function loadWaiterConfig(state) { + if (!this.service.api.waiters[state]) { + throw new AWS.util.error(new Error(), { + code: 'StateNotFoundError', + message: 'State ' + state + ' not found.' + }); } - return AWS.util.crypto.toHex(hashes[0]); + this.config = AWS.util.copy(this.service.api.waiters[state]); } }); /***/ }), -/***/ 27062: +/***/ 58743: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); +var inherit = AWS.util.inherit; +var jmespath = __nccwpck_require__(87783); /** - * @api private - */ -var blobPayloadOutputOps = [ - 'deleteThingShadow', - 'getThingShadow', - 'updateThingShadow' -]; - -/** - * Constructs a service interface object. Each API operation is exposed as a - * function on service. + * This class encapsulates the response information + * from a service request operation sent through {AWS.Request}. + * The response object has two main properties for getting information + * back from a request: * - * ### Sending a Request Using IotData + * ## The `data` property * - * ```javascript - * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); - * iotdata.getThingShadow(params, function (err, data) { - * if (err) console.log(err, err.stack); // an error occurred - * else console.log(data); // successful response - * }); + * The `response.data` property contains the serialized object data + * retrieved from the service request. For instance, for an + * Amazon DynamoDB `listTables` method call, the response data might + * look like: + * + * ``` + * > resp.data + * { TableNames: + * [ 'table1', 'table2', ... ] } * ``` * - * ### Locking the API Version + * The `data` property can be null if an error occurs (see below). * - * In order to ensure that the IotData object uses this specific API, - * you can construct the object by passing the `apiVersion` option to the - * constructor: + * ## The `error` property * - * ```javascript - * var iotdata = new AWS.IotData({ - * endpoint: 'my.host.tld', - * apiVersion: '2015-05-28' - * }); + * In the event of a service error (or transfer error), the + * `response.error` property will be filled with the given + * error data in the form: + * + * ``` + * { code: 'SHORT_UNIQUE_ERROR_CODE', + * message: 'Some human readable error message' } * ``` * - * You can also set the API version globally in `AWS.config.apiVersions` using - * the **iotdata** service identifier: + * In the case of an error, the `data` property will be `null`. + * Note that if you handle events that can be in a failure state, + * you should always check whether `response.error` is set + * before attempting to access the `response.data` property. * - * ```javascript - * AWS.config.apiVersions = { - * iotdata: '2015-05-28', - * // other service API versions - * }; + * @!attribute data + * @readonly + * @!group Data Properties + * @note Inside of a {AWS.Request~httpData} event, this + * property contains a single raw packet instead of the + * full de-serialized service response. + * @return [Object] the de-serialized response data + * from the service. * - * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); - * ``` + * @!attribute error + * An structure containing information about a service + * or networking error. + * @readonly + * @!group Data Properties + * @note This attribute is only filled if a service or + * networking error occurs. + * @return [Error] + * * code [String] a unique short code representing the + * error that was emitted. + * * message [String] a longer human readable error message + * * retryable [Boolean] whether the error message is + * retryable. + * * statusCode [Numeric] in the case of a request that reached the service, + * this value contains the response status code. + * * time [Date] the date time object when the error occurred. + * * hostname [String] set when a networking error occurs to easily + * identify the endpoint of the request. + * * region [String] set when a networking error occurs to easily + * identify the region of the request. * - * @note You *must* provide an `endpoint` configuration parameter when - * constructing this service. See {constructor} for more information. + * @!attribute requestId + * @readonly + * @!group Data Properties + * @return [String] the unique request ID associated with the response. + * Log this value when debugging requests for AWS support. * - * @!method constructor(options = {}) - * Constructs a service object. This object has one method for each - * API operation. + * @!attribute retryCount + * @readonly + * @!group Operation Properties + * @return [Integer] the number of retries that were + * attempted before the request was completed. * - * @example Constructing a IotData object - * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); - * @note You *must* provide an `endpoint` when constructing this service. - * @option (see AWS.Config.constructor) + * @!attribute redirectCount + * @readonly + * @!group Operation Properties + * @return [Integer] the number of redirects that were + * followed before the request was completed. * - * @service iotdata - * @version 2015-05-28 + * @!attribute httpResponse + * @readonly + * @!group HTTP Properties + * @return [AWS.HttpResponse] the raw HTTP response object + * containing the response headers and body information + * from the server. + * + * @see AWS.Request */ -AWS.util.update(AWS.IotData.prototype, { - /** - * @api private - */ - validateService: function validateService() { - if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { - var msg = 'AWS.IotData requires an explicit ' + - '`endpoint\' configuration option.'; - throw AWS.util.error(new Error(), - {name: 'InvalidEndpoint', message: msg}); - } - }, - - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - request.addListener('validateResponse', this.validateResponseBody); - if (blobPayloadOutputOps.indexOf(request.operation) > -1) { - request.addListener('extractData', AWS.util.convertPayloadToString); - } - }, - - /** - * @api private - */ - validateResponseBody: function validateResponseBody(resp) { - var body = resp.httpResponse.body.toString() || '{}'; - var bodyCheck = body.trim(); - if (!bodyCheck || bodyCheck.charAt(0) !== '{') { - resp.httpResponse.body = ''; - } - } - -}); - - -/***/ }), - -/***/ 8452: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); - -AWS.util.update(AWS.Lambda.prototype, { - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - if (request.operation === 'invoke') { - request.addListener('extractData', AWS.util.convertPayloadToString); - } - } -}); - - - -/***/ }), - -/***/ 19174: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); +AWS.Response = inherit({ -AWS.util.update(AWS.MachineLearning.prototype, { /** * @api private */ - setupRequestListeners: function setupRequestListeners(request) { - if (request.operation === 'predict') { - request.addListener('build', this.buildEndpoint); + constructor: function Response(request) { + this.request = request; + this.data = null; + this.error = null; + this.retryCount = 0; + this.redirectCount = 0; + this.httpResponse = new AWS.HttpResponse(); + if (request) { + this.maxRetries = request.service.numRetries(); + this.maxRedirects = request.service.config.maxRedirects; } }, /** - * Updates request endpoint from PredictEndpoint - * @api private + * Creates a new request for the next page of response data, calling the + * callback with the page data if a callback is provided. + * + * @callback callback function(err, data) + * Called when a page of data is returned from the next request. + * + * @param err [Error] an error object, if an error occurred in the request + * @param data [Object] the next page of data, or null, if there are no + * more pages left. + * @return [AWS.Request] the request object for the next page of data + * @return [null] if no callback is provided and there are no pages left + * to retrieve. + * @since v1.4.0 */ - buildEndpoint: function buildEndpoint(request) { - var url = request.params.PredictEndpoint; - if (url) { - request.httpRequest.endpoint = new AWS.Endpoint(url); - } - } - -}); - - -/***/ }), - -/***/ 73090: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var rdsutil = __nccwpck_require__(30650); - -/** -* @api private -*/ -var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; - -AWS.util.update(AWS.Neptune.prototype, { - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - if ( - crossRegionOperations.indexOf(request.operation) !== -1 && - this.config.params && - this.config.params.SourceRegion && - request.params && - !request.params.SourceRegion - ) { - request.params.SourceRegion = this.config.params.SourceRegion; - } - rdsutil.setupRequestListeners(this, request, crossRegionOperations); - }, -}); - + nextPage: function nextPage(callback) { + var config; + var service = this.request.service; + var operation = this.request.operation; + try { + config = service.paginationConfig(operation, true); + } catch (e) { this.error = e; } -/***/ }), + if (!this.hasNextPage()) { + if (callback) callback(this.error, null); + else if (this.error) throw this.error; + return null; + } -/***/ 71963: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + var params = AWS.util.copy(this.request.params); + if (!this.nextPageTokens) { + return callback ? callback(null, null) : null; + } else { + var inputTokens = config.inputToken; + if (typeof inputTokens === 'string') inputTokens = [inputTokens]; + for (var i = 0; i < inputTokens.length; i++) { + params[inputTokens[i]] = this.nextPageTokens[i]; + } + return service.makeRequest(this.request.operation, params, callback); + } + }, -var AWS = __nccwpck_require__(28437); + /** + * @return [Boolean] whether more pages of data can be returned by further + * requests + * @since v1.4.0 + */ + hasNextPage: function hasNextPage() { + this.cacheNextPageTokens(); + if (this.nextPageTokens) return true; + if (this.nextPageTokens === undefined) return undefined; + else return false; + }, -if (AWS.NeptuneGraph) { - AWS.util.update(AWS.NeptuneGraph.prototype, { /** * @api private */ - validateService: function validateService() { - var msg = 'AWS Neptune Graph is not available in the AWS SDK for JavaScript v2, consider using the AWS SDK for JavaScript v3: https://www.npmjs.com/package/@aws-sdk/client-neptune-graph'; - throw AWS.util.error(new Error(), - {name: 'ServiceExcludedFromV2', message: msg}); - }, - }); -}; - - -/***/ }), - -/***/ 53199: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -__nccwpck_require__(44086); - - -/***/ }), - -/***/ 71928: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var rdsutil = __nccwpck_require__(30650); -__nccwpck_require__(16612); - /** - * @api private - */ - var crossRegionOperations = ['copyDBSnapshot', 'createDBInstanceReadReplica', 'createDBCluster', 'copyDBClusterSnapshot', 'startDBInstanceAutomatedBackupsReplication']; - - AWS.util.update(AWS.RDS.prototype, { - /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(request) { - rdsutil.setupRequestListeners(this, request, crossRegionOperations); - }, - }); - + cacheNextPageTokens: function cacheNextPageTokens() { + if (Object.prototype.hasOwnProperty.call(this, 'nextPageTokens')) return this.nextPageTokens; + this.nextPageTokens = undefined; -/***/ }), + var config = this.request.service.paginationConfig(this.request.operation); + if (!config) return this.nextPageTokens; -/***/ 64070: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + this.nextPageTokens = null; + if (config.moreResults) { + if (!jmespath.search(this.data, config.moreResults)) { + return this.nextPageTokens; + } + } -var AWS = __nccwpck_require__(28437); + var exprs = config.outputToken; + if (typeof exprs === 'string') exprs = [exprs]; + AWS.util.arrayEach.call(this, exprs, function (expr) { + var output = jmespath.search(this.data, expr); + if (output) { + this.nextPageTokens = this.nextPageTokens || []; + this.nextPageTokens.push(output); + } + }); -AWS.util.update(AWS.RDSDataService.prototype, { - /** - * @return [Boolean] whether the error can be retried - * @api private - */ - retryableError: function retryableError(error) { - if (error.code === 'BadRequestException' && - error.message && - error.message.match(/^Communications link failure/) && - error.statusCode === 400) { - return true; - } else { - var _super = AWS.Service.prototype.retryableError; - return _super.call(this, error); - } + return this.nextPageTokens; } + }); /***/ }), -/***/ 30650: +/***/ 81600: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); +var byteLength = AWS.util.string.byteLength; +var Buffer = AWS.util.Buffer; -var rdsutil = { +/** + * The managed uploader allows for easy and efficient uploading of buffers, + * blobs, or streams, using a configurable amount of concurrency to perform + * multipart uploads where possible. This abstraction also enables uploading + * streams of unknown size due to the use of multipart uploads. + * + * To construct a managed upload object, see the {constructor} function. + * + * ## Tracking upload progress + * + * The managed upload object can also track progress by attaching an + * 'httpUploadProgress' listener to the upload manager. This event is similar + * to {AWS.Request~httpUploadProgress} but groups all concurrent upload progress + * into a single event. See {AWS.S3.ManagedUpload~httpUploadProgress} for more + * information. + * + * ## Handling Multipart Cleanup + * + * By default, this class will automatically clean up any multipart uploads + * when an individual part upload fails. This behavior can be disabled in order + * to manually handle failures by setting the `leavePartsOnError` configuration + * option to `true` when initializing the upload object. + * + * @!event httpUploadProgress(progress) + * Triggered when the uploader has uploaded more data. + * @note The `total` property may not be set if the stream being uploaded has + * not yet finished chunking. In this case the `total` will be undefined + * until the total stream size is known. + * @note This event will not be emitted in Node.js 0.8.x. + * @param progress [map] An object containing the `loaded` and `total` bytes + * of the request and the `key` of the S3 object. Note that `total` may be undefined until the payload + * size is known. + * @context (see AWS.Request~send) + */ +AWS.S3.ManagedUpload = AWS.util.inherit({ /** - * @api private - */ - setupRequestListeners: function setupRequestListeners(service, request, crossRegionOperations) { - if (crossRegionOperations.indexOf(request.operation) !== -1 && - request.params.SourceRegion) { - request.params = AWS.util.copy(request.params); - if (request.params.PreSignedUrl || - request.params.SourceRegion === service.config.region) { - delete request.params.SourceRegion; - } else { - var doesParamValidation = !!service.config.paramValidation; - // remove the validate parameters listener so we can re-add it after we build the URL - if (doesParamValidation) { - request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); - } - request.onAsync('validate', rdsutil.buildCrossRegionPresignedUrl); - if (doesParamValidation) { - request.addListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); - } - } - } + * Creates a managed upload object with a set of configuration options. + * + * @note A "Body" parameter is required to be set prior to calling {send}. + * @note In Node.js, sending "Body" as {https://nodejs.org/dist/latest/docs/api/stream.html#stream_object_mode object-mode stream} + * may result in upload hangs. Using buffer stream is preferable. + * @option options params [map] a map of parameters to pass to the upload + * requests. The "Body" parameter is required to be specified either on + * the service or in the params option. + * @note ContentMD5 should not be provided when using the managed upload object. + * Instead, setting "computeChecksums" to true will enable automatic ContentMD5 generation + * by the managed upload object. + * @option options queueSize [Number] (4) the size of the concurrent queue + * manager to upload parts in parallel. Set to 1 for synchronous uploading + * of parts. Note that the uploader will buffer at most queueSize * partSize + * bytes into memory at any given time. + * @option options partSize [Number] (5mb) the size in bytes for each + * individual part to be uploaded. Adjust the part size to ensure the number + * of parts does not exceed {maxTotalParts}. See {minPartSize} for the + * minimum allowed part size. + * @option options leavePartsOnError [Boolean] (false) whether to abort the + * multipart upload if an error occurs. Set to true if you want to handle + * failures manually. + * @option options service [AWS.S3] an optional S3 service object to use for + * requests. This object might have bound parameters used by the uploader. + * @option options tags [Array] The tags to apply to the uploaded object. + * Each tag should have a `Key` and `Value` keys. + * @example Creating a default uploader for a stream object + * var upload = new AWS.S3.ManagedUpload({ + * params: {Bucket: 'bucket', Key: 'key', Body: stream} + * }); + * @example Creating an uploader with concurrency of 1 and partSize of 10mb + * var upload = new AWS.S3.ManagedUpload({ + * partSize: 10 * 1024 * 1024, queueSize: 1, + * params: {Bucket: 'bucket', Key: 'key', Body: stream} + * }); + * @example Creating an uploader with tags + * var upload = new AWS.S3.ManagedUpload({ + * params: {Bucket: 'bucket', Key: 'key', Body: stream}, + * tags: [{Key: 'tag1', Value: 'value1'}, {Key: 'tag2', Value: 'value2'}] + * }); + * @see send + */ + constructor: function ManagedUpload(options) { + var self = this; + AWS.SequentialExecutor.call(self); + self.body = null; + self.sliceFn = null; + self.callback = null; + self.parts = {}; + self.completeInfo = []; + self.fillQueue = function() { + self.callback(new Error('Unsupported body payload ' + typeof self.body)); + }; + + self.configure(options); }, /** * @api private */ - buildCrossRegionPresignedUrl: function buildCrossRegionPresignedUrl(req, done) { - var config = AWS.util.copy(req.service.config); - config.region = req.params.SourceRegion; - delete req.params.SourceRegion; - delete config.endpoint; - // relevant params for the operation will already be in req.params - delete config.params; - config.signatureVersion = 'v4'; - var destinationRegion = req.service.config.region; + configure: function configure(options) { + options = options || {}; + this.partSize = this.minPartSize; - var svc = new req.service.constructor(config); - var newReq = svc[req.operation](AWS.util.copy(req.params)); - newReq.on('build', function addDestinationRegionParam(request) { - var httpRequest = request.httpRequest; - httpRequest.params.DestinationRegion = destinationRegion; - httpRequest.body = AWS.util.queryParamsToString(httpRequest.params); - }); - newReq.presign(function(err, url) { - if (err) done(err); - else { - req.params.PreSignedUrl = url; - done(); + if (options.queueSize) this.queueSize = options.queueSize; + if (options.partSize) this.partSize = options.partSize; + if (options.leavePartsOnError) this.leavePartsOnError = true; + if (options.tags) { + if (!Array.isArray(options.tags)) { + throw new Error('Tags must be specified as an array; ' + + typeof options.tags + ' provided.'); } - }); - } -}; - -/** - * @api private - */ -module.exports = rdsutil; - - -/***/ }), + this.tags = options.tags; + } -/***/ 69627: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + if (this.partSize < this.minPartSize) { + throw new Error('partSize must be greater than ' + + this.minPartSize); + } -var AWS = __nccwpck_require__(28437); + this.service = options.service; + this.bindServiceObject(options.params); + this.validateBody(); + this.adjustTotalBytes(); + }, -AWS.util.update(AWS.Route53.prototype, { /** * @api private */ - setupRequestListeners: function setupRequestListeners(request) { - request.on('build', this.sanitizeUrl); - }, + leavePartsOnError: false, /** * @api private */ - sanitizeUrl: function sanitizeUrl(request) { - var path = request.httpRequest.path; - request.httpRequest.path = path.replace(/\/%2F\w+%2F/, '/'); - }, + queueSize: 4, /** - * @return [Boolean] whether the error can be retried * @api private */ - retryableError: function retryableError(error) { - if (error.code === 'PriorRequestNotComplete' && - error.statusCode === 400) { - return true; - } else { - var _super = AWS.Service.prototype.retryableError; - return _super.call(this, error); - } - } -}); + partSize: null, + /** + * @readonly + * @return [Number] the minimum number of bytes for an individual part + * upload. + */ + minPartSize: 1024 * 1024 * 5, -/***/ }), + /** + * @readonly + * @return [Number] the maximum allowed number of parts in a multipart upload. + */ + maxTotalParts: 10000, -/***/ 26543: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Initiates the managed upload for the payload. + * + * @callback callback function(err, data) + * @param err [Error] an error or null if no error occurred. + * @param data [map] The response data from the successful upload: + * * `Location` (String) the URL of the uploaded object + * * `ETag` (String) the ETag of the uploaded object + * * `Bucket` (String) the bucket to which the object was uploaded + * * `Key` (String) the key to which the object was uploaded + * @example Sending a managed upload object + * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; + * var upload = new AWS.S3.ManagedUpload({params: params}); + * upload.send(function(err, data) { + * console.log(err, data); + * }); + */ + send: function(callback) { + var self = this; + self.failed = false; + self.callback = callback || function(err) { if (err) throw err; }; -var AWS = __nccwpck_require__(28437); -var v4Credentials = __nccwpck_require__(62660); -var resolveRegionalEndpointsFlag = __nccwpck_require__(85566); -var s3util = __nccwpck_require__(35895); -var regionUtil = __nccwpck_require__(18262); + var runFill = true; + if (self.sliceFn) { + self.fillQueue = self.fillBuffer; + } else if (AWS.util.isNode()) { + var Stream = AWS.util.stream.Stream; + if (self.body instanceof Stream) { + runFill = false; + self.fillQueue = self.fillStream; + self.partBuffers = []; + self.body. + on('error', function(err) { self.cleanup(err); }). + on('readable', function() { self.fillQueue(); }). + on('end', function() { + self.isDoneChunking = true; + self.numParts = self.totalPartNumbers; + self.fillQueue.call(self); -// Pull in managed upload extension -__nccwpck_require__(81600); + if (self.isDoneChunking && self.totalPartNumbers >= 1 && self.doneParts === self.numParts) { + self.finishMultiPart(); + } + }); + } + } -/** - * @api private - */ -var operationsWith200StatusCodeError = { - 'completeMultipartUpload': true, - 'copyObject': true, - 'uploadPartCopy': true -}; + if (runFill) self.fillQueue.call(self); + }, -/** - * @api private - */ - var regionRedirectErrorCodes = [ - 'AuthorizationHeaderMalformed', // non-head operations on virtual-hosted global bucket endpoints - 'BadRequest', // head operations on virtual-hosted global bucket endpoints - 'PermanentRedirect', // non-head operations on path-style or regional endpoints - 301 // head operations on path-style or regional endpoints - ]; + /** + * @!method promise() + * Returns a 'thenable' promise. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function(data) + * Called if the promise is fulfilled. + * @param data [map] The response data from the successful upload: + * `Location` (String) the URL of the uploaded object + * `ETag` (String) the ETag of the uploaded object + * `Bucket` (String) the bucket to which the object was uploaded + * `Key` (String) the key to which the object was uploaded + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] an error or null if no error occurred. + * @return [Promise] A promise that represents the state of the upload request. + * @example Sending an upload request using promises. + * var upload = s3.upload({Bucket: 'bucket', Key: 'key', Body: stream}); + * var promise = upload.promise(); + * promise.then(function(data) { ... }, function(err) { ... }); + */ -var OBJECT_LAMBDA_SERVICE = 's3-object-lambda'; + /** + * Aborts a managed upload, including all concurrent upload requests. + * @note By default, calling this function will cleanup a multipart upload + * if one was created. To leave the multipart upload around after aborting + * a request, configure `leavePartsOnError` to `true` in the {constructor}. + * @note Calling {abort} in the browser environment will not abort any requests + * that are already in flight. If a multipart upload was created, any parts + * not yet uploaded will not be sent, and the multipart upload will be cleaned up. + * @example Aborting an upload + * var params = { + * Bucket: 'bucket', Key: 'key', + * Body: Buffer.alloc(1024 * 1024 * 25) // 25MB payload + * }; + * var upload = s3.upload(params); + * upload.send(function (err, data) { + * if (err) console.log("Error:", err.code, err.message); + * else console.log(data); + * }); + * + * // abort request in 1 second + * setTimeout(upload.abort.bind(upload), 1000); + */ + abort: function() { + var self = this; + //abort putObject request + if (self.isDoneChunking === true && self.totalPartNumbers === 1 && self.singlePart) { + self.singlePart.abort(); + } else { + self.cleanup(AWS.util.error(new Error('Request aborted by user'), { + code: 'RequestAbortedError', retryable: false + })); + } + }, -AWS.util.update(AWS.S3.prototype, { /** * @api private */ - getSignatureVersion: function getSignatureVersion(request) { - var defaultApiVersion = this.api.signatureVersion; - var userDefinedVersion = this._originalConfig ? this._originalConfig.signatureVersion : null; - var regionDefinedVersion = this.config.signatureVersion; - var isPresigned = request ? request.isPresigned() : false; - /* - 1) User defined version specified: - a) always return user defined version - 2) No user defined version specified: - a) If not using presigned urls, default to V4 - b) If using presigned urls, default to lowest version the region supports - */ - if (userDefinedVersion) { - userDefinedVersion = userDefinedVersion === 'v2' ? 's3' : userDefinedVersion; - return userDefinedVersion; + validateBody: function validateBody() { + var self = this; + self.body = self.service.config.params.Body; + if (typeof self.body === 'string') { + self.body = AWS.util.buffer.toBuffer(self.body); + } else if (!self.body) { + throw new Error('params.Body is required'); } - if (isPresigned !== true) { - defaultApiVersion = 'v4'; - } else if (regionDefinedVersion) { - defaultApiVersion = regionDefinedVersion; + self.sliceFn = AWS.util.arraySliceFn(self.body); + }, + + /** + * @api private + */ + bindServiceObject: function bindServiceObject(params) { + params = params || {}; + var self = this; + // bind parameters to new service object + if (!self.service) { + self.service = new AWS.S3({params: params}); + } else { + // Create a new S3 client from the supplied client's constructor. + var service = self.service; + var config = AWS.util.copy(service.config); + config.signatureVersion = service.getSignatureVersion(); + self.service = new service.constructor.__super__(config); + self.service.config.params = + AWS.util.merge(self.service.config.params || {}, params); + Object.defineProperty(self.service, '_originalConfig', { + get: function() { return service._originalConfig; }, + enumerable: false, + configurable: true + }); } - return defaultApiVersion; }, /** * @api private */ - getSigningName: function getSigningName(req) { - if (req && req.operation === 'writeGetObjectResponse') { - return OBJECT_LAMBDA_SERVICE; + adjustTotalBytes: function adjustTotalBytes() { + var self = this; + try { // try to get totalBytes + self.totalBytes = byteLength(self.body); + } catch (e) { } + + // try to adjust partSize if we know payload length + if (self.totalBytes) { + var newPartSize = Math.ceil(self.totalBytes / self.maxTotalParts); + if (newPartSize > self.partSize) self.partSize = newPartSize; + } else { + self.totalBytes = undefined; } - - var _super = AWS.Service.prototype.getSigningName; - return (req && req._parsedArn && req._parsedArn.service) - ? req._parsedArn.service - : _super.call(this); }, /** * @api private */ - getSignerClass: function getSignerClass(request) { - var signatureVersion = this.getSignatureVersion(request); - return AWS.Signers.RequestSigner.getVersion(signatureVersion); - }, + isDoneChunking: false, /** * @api private */ - validateService: function validateService() { - var msg; - var messages = []; - - // default to us-east-1 when no region is provided - if (!this.config.region) this.config.region = 'us-east-1'; + partPos: 0, - if (!this.config.endpoint && this.config.s3BucketEndpoint) { - messages.push('An endpoint must be provided when configuring ' + - '`s3BucketEndpoint` to true.'); - } - if (messages.length === 1) { - msg = messages[0]; - } else if (messages.length > 1) { - msg = 'Multiple configuration errors:\n' + messages.join('\n'); - } - if (msg) { - throw AWS.util.error(new Error(), - {name: 'InvalidEndpoint', message: msg}); - } - }, + /** + * @api private + */ + totalChunkedBytes: 0, /** * @api private */ - shouldDisableBodySigning: function shouldDisableBodySigning(request) { - var signerClass = this.getSignerClass(); - if (this.config.s3DisableBodySigning === true && signerClass === AWS.Signers.V4 - && request.httpRequest.endpoint.protocol === 'https:') { - return true; - } - return false; - }, + totalUploadedBytes: 0, /** * @api private */ - setupRequestListeners: function setupRequestListeners(request) { - var prependListener = true; - request.addListener('validate', this.validateScheme); - request.addListener('validate', this.validateBucketName, prependListener); - request.addListener('validate', this.optInUsEast1RegionalEndpoint, prependListener); + totalBytes: undefined, - request.removeListener('validate', - AWS.EventListeners.Core.VALIDATE_REGION); - request.addListener('build', this.addContentType); - request.addListener('build', this.computeContentMd5); - request.addListener('build', this.computeSseCustomerKeyMd5); - request.addListener('build', this.populateURI); - request.addListener('afterBuild', this.addExpect100Continue); - request.addListener('extractError', this.extractError); - request.addListener('extractData', AWS.util.hoistPayloadMember); - request.addListener('extractData', this.extractData); - request.addListener('extractData', this.extractErrorFrom200Response); - request.addListener('beforePresign', this.prepareSignedUrl); - if (this.shouldDisableBodySigning(request)) { - request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); - request.addListener('afterBuild', this.disableBodySigning); - } - //deal with ARNs supplied to Bucket - if (request.operation !== 'createBucket' && s3util.isArnInParam(request, 'Bucket')) { - // avoid duplicate parsing in the future - request._parsedArn = AWS.util.ARN.parse(request.params.Bucket); + /** + * @api private + */ + numParts: 0, - request.removeListener('validate', this.validateBucketName); - request.removeListener('build', this.populateURI); - if (request._parsedArn.service === 's3') { - request.addListener('validate', s3util.validateS3AccessPointArn); - request.addListener('validate', this.validateArnResourceType); - request.addListener('validate', this.validateArnRegion); - } else if (request._parsedArn.service === 's3-outposts') { - request.addListener('validate', s3util.validateOutpostsAccessPointArn); - request.addListener('validate', s3util.validateOutpostsArn); - request.addListener('validate', s3util.validateArnRegion); - } - request.addListener('validate', s3util.validateArnAccount); - request.addListener('validate', s3util.validateArnService); - request.addListener('build', this.populateUriFromAccessPointArn); - request.addListener('build', s3util.validatePopulateUriFromArn); - return; - } - //listeners regarding region inference - request.addListener('validate', this.validateBucketEndpoint); - request.addListener('validate', this.correctBucketRegionFromCache); - request.onAsync('extractError', this.requestBucketRegion); - if (AWS.util.isBrowser()) { - request.onAsync('retry', this.reqRegionForNetworkingError); - } - }, + /** + * @api private + */ + totalPartNumbers: 0, /** * @api private */ - validateScheme: function(req) { - var params = req.params, - scheme = req.httpRequest.endpoint.protocol, - sensitive = params.SSECustomerKey || params.CopySourceSSECustomerKey; - if (sensitive && scheme !== 'https:') { - var msg = 'Cannot send SSE keys over HTTP. Set \'sslEnabled\'' + - 'to \'true\' in your configuration'; - throw AWS.util.error(new Error(), - { code: 'ConfigError', message: msg }); - } - }, + activeParts: 0, /** * @api private */ - validateBucketEndpoint: function(req) { - if (!req.params.Bucket && req.service.config.s3BucketEndpoint) { - var msg = 'Cannot send requests to root API with `s3BucketEndpoint` set.'; - throw AWS.util.error(new Error(), - { code: 'ConfigError', message: msg }); - } - }, + doneParts: 0, /** * @api private */ - validateArnRegion: function validateArnRegion(req) { - s3util.validateArnRegion(req, { allowFipsEndpoint: true }); - }, + parts: null, /** - * Validate resource-type supplied in S3 ARN + * @api private */ - validateArnResourceType: function validateArnResourceType(req) { - var resource = req._parsedArn.resource; + completeInfo: null, - if ( - resource.indexOf('accesspoint:') !== 0 && - resource.indexOf('accesspoint/') !== 0 - ) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'ARN resource should begin with \'accesspoint/\'' - }); - } - }, + /** + * @api private + */ + failed: false, /** * @api private */ - validateBucketName: function validateBucketName(req) { - var service = req.service; - var signatureVersion = service.getSignatureVersion(req); - var bucket = req.params && req.params.Bucket; - var key = req.params && req.params.Key; - var slashIndex = bucket && bucket.indexOf('/'); - if (bucket && slashIndex >= 0) { - if (typeof key === 'string' && slashIndex > 0) { - req.params = AWS.util.copy(req.params); - // Need to include trailing slash to match sigv2 behavior - var prefix = bucket.substr(slashIndex + 1) || ''; - req.params.Key = prefix + '/' + key; - req.params.Bucket = bucket.substr(0, slashIndex); - } else if (signatureVersion === 'v4') { - var msg = 'Bucket names cannot contain forward slashes. Bucket: ' + bucket; - throw AWS.util.error(new Error(), - { code: 'InvalidBucket', message: msg }); - } - } - }, + multipartReq: null, /** * @api private */ - isValidAccelerateOperation: function isValidAccelerateOperation(operation) { - var invalidOperations = [ - 'createBucket', - 'deleteBucket', - 'listBuckets' - ]; - return invalidOperations.indexOf(operation) === -1; - }, + partBuffers: null, /** - * When us-east-1 region endpoint configuration is set, in stead of sending request to - * global endpoint(e.g. 's3.amazonaws.com'), we will send request to - * 's3.us-east-1.amazonaws.com'. * @api private */ - optInUsEast1RegionalEndpoint: function optInUsEast1RegionalEndpoint(req) { - var service = req.service; - var config = service.config; - config.s3UsEast1RegionalEndpoint = resolveRegionalEndpointsFlag(service._originalConfig, { - env: 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT', - sharedConfig: 's3_us_east_1_regional_endpoint', - clientConfig: 's3UsEast1RegionalEndpoint' - }); - if ( - !(service._originalConfig || {}).endpoint && - req.httpRequest.region === 'us-east-1' && - config.s3UsEast1RegionalEndpoint === 'regional' && - req.httpRequest.endpoint.hostname.indexOf('s3.amazonaws.com') >= 0 - ) { - var insertPoint = config.endpoint.indexOf('.amazonaws.com'); - var regionalEndpoint = config.endpoint.substring(0, insertPoint) + - '.us-east-1' + config.endpoint.substring(insertPoint); - req.httpRequest.updateEndpoint(regionalEndpoint); - } - }, + partBufferLength: 0, /** - * S3 prefers dns-compatible bucket names to be moved from the uri path - * to the hostname as a sub-domain. This is not possible, even for dns-compat - * buckets when using SSL and the bucket name contains a dot ('.'). The - * ssl wildcard certificate is only 1-level deep. - * * @api private */ - populateURI: function populateURI(req) { - var httpRequest = req.httpRequest; - var b = req.params.Bucket; - var service = req.service; - var endpoint = httpRequest.endpoint; - if (b) { - if (!service.pathStyleBucketName(b)) { - if (service.config.useAccelerateEndpoint && service.isValidAccelerateOperation(req.operation)) { - if (service.config.useDualstackEndpoint) { - endpoint.hostname = b + '.s3-accelerate.dualstack.amazonaws.com'; - } else { - endpoint.hostname = b + '.s3-accelerate.amazonaws.com'; - } - } else if (!service.config.s3BucketEndpoint) { - endpoint.hostname = - b + '.' + endpoint.hostname; - } + fillBuffer: function fillBuffer() { + var self = this; + var bodyLen = byteLength(self.body); - var port = endpoint.port; - if (port !== 80 && port !== 443) { - endpoint.host = endpoint.hostname + ':' + - endpoint.port; - } else { - endpoint.host = endpoint.hostname; - } + if (bodyLen === 0) { + self.isDoneChunking = true; + self.numParts = 1; + self.nextChunk(self.body); + return; + } - httpRequest.virtualHostedBucket = b; // needed for signing the request - service.removeVirtualHostedBucketFromPath(req); + while (self.activeParts < self.queueSize && self.partPos < bodyLen) { + var endPos = Math.min(self.partPos + self.partSize, bodyLen); + var buf = self.sliceFn.call(self.body, self.partPos, endPos); + self.partPos += self.partSize; + + if (byteLength(buf) < self.partSize || self.partPos === bodyLen) { + self.isDoneChunking = true; + self.numParts = self.totalPartNumbers + 1; } + self.nextChunk(buf); } }, /** - * Takes the bucket name out of the path if bucket is virtual-hosted - * * @api private */ - removeVirtualHostedBucketFromPath: function removeVirtualHostedBucketFromPath(req) { - var httpRequest = req.httpRequest; - var bucket = httpRequest.virtualHostedBucket; - if (bucket && httpRequest.path) { - if (req.params && req.params.Key) { - var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key); - if (httpRequest.path.indexOf(encodedS3Key) === 0 && (httpRequest.path.length === encodedS3Key.length || httpRequest.path[encodedS3Key.length] === '?')) { - //path only contains key or path contains only key and querystring - return; - } + fillStream: function fillStream() { + var self = this; + if (self.activeParts >= self.queueSize) return; + + var buf = self.body.read(self.partSize - self.partBufferLength) || + self.body.read(); + if (buf) { + self.partBuffers.push(buf); + self.partBufferLength += buf.length; + self.totalChunkedBytes += buf.length; + } + + if (self.partBufferLength >= self.partSize) { + // if we have single buffer we avoid copyfull concat + var pbuf = self.partBuffers.length === 1 ? + self.partBuffers[0] : Buffer.concat(self.partBuffers); + self.partBuffers = []; + self.partBufferLength = 0; + + // if we have more than partSize, push the rest back on the queue + if (pbuf.length > self.partSize) { + var rest = pbuf.slice(self.partSize); + self.partBuffers.push(rest); + self.partBufferLength += rest.length; + pbuf = pbuf.slice(0, self.partSize); } - httpRequest.path = httpRequest.path.replace(new RegExp('/' + bucket), ''); - if (httpRequest.path[0] !== '/') { - httpRequest.path = '/' + httpRequest.path; + + self.nextChunk(pbuf); + } + + if (self.isDoneChunking && !self.isDoneSending) { + // if we have single buffer we avoid copyfull concat + pbuf = self.partBuffers.length === 1 ? + self.partBuffers[0] : Buffer.concat(self.partBuffers); + self.partBuffers = []; + self.partBufferLength = 0; + self.totalBytes = self.totalChunkedBytes; + self.isDoneSending = true; + + if (self.numParts === 0 || pbuf.length > 0) { + self.numParts++; + self.nextChunk(pbuf); } } + + self.body.read(0); }, /** - * When user supply an access point ARN in the Bucket parameter, we need to - * populate the URI according to the ARN. + * @api private */ - populateUriFromAccessPointArn: function populateUriFromAccessPointArn(req) { - var accessPointArn = req._parsedArn; + nextChunk: function nextChunk(chunk) { + var self = this; + if (self.failed) return null; - var isOutpostArn = accessPointArn.service === 's3-outposts'; - var isObjectLambdaArn = accessPointArn.service === 's3-object-lambda'; + var partNumber = ++self.totalPartNumbers; + if (self.isDoneChunking && partNumber === 1) { + var params = {Body: chunk}; + if (this.tags) { + params.Tagging = this.getTaggingHeader(); + } + var req = self.service.putObject(params); + req._managedUpload = self; + req.on('httpUploadProgress', self.progress).send(self.finishSinglePart); + self.singlePart = req; //save the single part request + return null; + } else if (self.service.config.params.ContentMD5) { + var err = AWS.util.error(new Error('The Content-MD5 you specified is invalid for multi-part uploads.'), { + code: 'InvalidDigest', retryable: false + }); - var outpostsSuffix = isOutpostArn ? '.' + accessPointArn.outpostId: ''; - var serviceName = isOutpostArn ? 's3-outposts': 's3-accesspoint'; - var fipsSuffix = !isOutpostArn && req.service.config.useFipsEndpoint ? '-fips': ''; - var dualStackSuffix = !isOutpostArn && - req.service.config.useDualstackEndpoint ? '.dualstack' : ''; + self.cleanup(err); + return null; + } - var endpoint = req.httpRequest.endpoint; - var dnsSuffix = regionUtil.getEndpointSuffix(accessPointArn.region); - var useArnRegion = req.service.config.s3UseArnRegion; + if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) { + return null; // Already uploaded this part. + } - endpoint.hostname = [ - accessPointArn.accessPoint + '-' + accessPointArn.accountId + outpostsSuffix, - serviceName + fipsSuffix + dualStackSuffix, - useArnRegion ? accessPointArn.region : req.service.config.region, - dnsSuffix - ].join('.'); + self.activeParts++; + if (!self.service.config.params.UploadId) { - if (isObjectLambdaArn) { - // should be in the format: "accesspoint/${accesspointName}" - var serviceName = 's3-object-lambda'; - var accesspointName = accessPointArn.resource.split('/')[1]; - var fipsSuffix = req.service.config.useFipsEndpoint ? '-fips': ''; - endpoint.hostname = [ - accesspointName + '-' + accessPointArn.accountId, - serviceName + fipsSuffix, - useArnRegion ? accessPointArn.region : req.service.config.region, - dnsSuffix - ].join('.'); - } - endpoint.host = endpoint.hostname; - var encodedArn = AWS.util.uriEscape(req.params.Bucket); - var path = req.httpRequest.path; - //remove the Bucket value from path - req.httpRequest.path = path.replace(new RegExp('/' + encodedArn), ''); - if (req.httpRequest.path[0] !== '/') { - req.httpRequest.path = '/' + req.httpRequest.path; + if (!self.multipartReq) { // create multipart + self.multipartReq = self.service.createMultipartUpload(); + self.multipartReq.on('success', function(resp) { + self.service.config.params.UploadId = resp.data.UploadId; + self.multipartReq = null; + }); + self.queueChunks(chunk, partNumber); + self.multipartReq.on('error', function(err) { + self.cleanup(err); + }); + self.multipartReq.send(); + } else { + self.queueChunks(chunk, partNumber); + } + } else { // multipart is created, just send + self.uploadPart(chunk, partNumber); } - req.httpRequest.region = accessPointArn.region; //region used to sign }, /** - * Adds Expect: 100-continue header if payload is greater-or-equal 1MB * @api private */ - addExpect100Continue: function addExpect100Continue(req) { - var len = req.httpRequest.headers['Content-Length']; - if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) { - req.httpRequest.headers['Expect'] = '100-continue'; + getTaggingHeader: function getTaggingHeader() { + var kvPairStrings = []; + for (var i = 0; i < this.tags.length; i++) { + kvPairStrings.push(AWS.util.uriEscape(this.tags[i].Key) + '=' + + AWS.util.uriEscape(this.tags[i].Value)); } + + return kvPairStrings.join('&'); }, /** - * Adds a default content type if none is supplied. - * * @api private */ - addContentType: function addContentType(req) { - var httpRequest = req.httpRequest; - if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') { - // Content-Type is not set in GET/HEAD requests - delete httpRequest.headers['Content-Type']; - return; - } + uploadPart: function uploadPart(chunk, partNumber) { + var self = this; - if (!httpRequest.headers['Content-Type']) { // always have a Content-Type - httpRequest.headers['Content-Type'] = 'application/octet-stream'; - } + var partParams = { + Body: chunk, + ContentLength: AWS.util.string.byteLength(chunk), + PartNumber: partNumber + }; - var contentType = httpRequest.headers['Content-Type']; - if (AWS.util.isBrowser()) { - if (typeof httpRequest.body === 'string' && !contentType.match(/;\s*charset=/)) { - var charset = '; charset=UTF-8'; - httpRequest.headers['Content-Type'] += charset; - } else { - var replaceFn = function(_, prefix, charsetName) { - return prefix + charsetName.toUpperCase(); - }; + var partInfo = {ETag: null, PartNumber: partNumber}; + self.completeInfo[partNumber] = partInfo; - httpRequest.headers['Content-Type'] = - contentType.replace(/(;\s*charset=)(.+)$/, replaceFn); + var req = self.service.uploadPart(partParams); + self.parts[partNumber] = req; + req._lastUploadedBytes = 0; + req._managedUpload = self; + req.on('httpUploadProgress', self.progress); + req.send(function(err, data) { + delete self.parts[partParams.PartNumber]; + self.activeParts--; + + if (!err && (!data || !data.ETag)) { + var message = 'No access to ETag property on response.'; + if (AWS.util.isBrowser()) { + message += ' Check CORS configuration to expose ETag header.'; + } + + err = AWS.util.error(new Error(message), { + code: 'ETagMissing', retryable: false + }); } - } + if (err) return self.cleanup(err); + //prevent sending part being returned twice (https://github.com/aws/aws-sdk-js/issues/2304) + if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null; + partInfo.ETag = data.ETag; + self.doneParts++; + if (self.isDoneChunking && self.doneParts === self.totalPartNumbers) { + self.finishMultiPart(); + } else { + self.fillQueue.call(self); + } + }); }, /** - * Checks whether checksums should be computed for the request if it's not - * already set by {AWS.EventListeners.Core.COMPUTE_CHECKSUM}. It depends on - * whether {AWS.Config.computeChecksums} is set. - * - * @param req [AWS.Request] the request to check against - * @return [Boolean] whether to compute checksums for a request. * @api private */ - willComputeChecksums: function willComputeChecksums(req) { - var rules = req.service.api.operations[req.operation].input.members; - var body = req.httpRequest.body; - var needsContentMD5 = req.service.config.computeChecksums && - rules.ContentMD5 && - !req.params.ContentMD5 && - body && - (AWS.util.Buffer.isBuffer(req.httpRequest.body) || typeof req.httpRequest.body === 'string'); + queueChunks: function queueChunks(chunk, partNumber) { + var self = this; + self.multipartReq.on('success', function() { + self.uploadPart(chunk, partNumber); + }); + }, - // Sha256 signing disabled, and not a presigned url - if (needsContentMD5 && req.service.shouldDisableBodySigning(req) && !req.isPresigned()) { - return true; + /** + * @api private + */ + cleanup: function cleanup(err) { + var self = this; + if (self.failed) return; + + // clean up stream + if (typeof self.body.removeAllListeners === 'function' && + typeof self.body.resume === 'function') { + self.body.removeAllListeners('readable'); + self.body.removeAllListeners('end'); + self.body.resume(); + } + + // cleanup multipartReq listeners + if (self.multipartReq) { + self.multipartReq.removeAllListeners('success'); + self.multipartReq.removeAllListeners('error'); + self.multipartReq.removeAllListeners('complete'); + delete self.multipartReq; + } + + if (self.service.config.params.UploadId && !self.leavePartsOnError) { + self.service.abortMultipartUpload().send(); + } else if (self.leavePartsOnError) { + self.isDoneChunking = false; } - // SigV2 and presign, for backwards compatibility purpose. - if (needsContentMD5 && this.getSignatureVersion(req) === 's3' && req.isPresigned()) { - return true; - } + AWS.util.each(self.parts, function(partNumber, part) { + part.removeAllListeners('complete'); + part.abort(); + }); - return false; + self.activeParts = 0; + self.partPos = 0; + self.numParts = 0; + self.totalPartNumbers = 0; + self.parts = {}; + self.failed = true; + self.callback(err); }, /** - * A listener that computes the Content-MD5 and sets it in the header. - * This listener is to support S3-specific features like - * s3DisableBodySigning and SigV2 presign. Content MD5 logic for SigV4 is - * handled in AWS.EventListeners.Core.COMPUTE_CHECKSUM - * * @api private */ - computeContentMd5: function computeContentMd5(req) { - if (req.service.willComputeChecksums(req)) { - var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64'); - req.httpRequest.headers['Content-MD5'] = md5; - } + finishMultiPart: function finishMultiPart() { + var self = this; + var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } }; + self.service.completeMultipartUpload(completeParams, function(err, data) { + if (err) { + return self.cleanup(err); + } + + if (data && typeof data.Location === 'string') { + data.Location = data.Location.replace(/%2F/g, '/'); + } + + if (Array.isArray(self.tags)) { + for (var i = 0; i < self.tags.length; i++) { + self.tags[i].Value = String(self.tags[i].Value); + } + self.service.putObjectTagging( + {Tagging: {TagSet: self.tags}}, + function(e, d) { + if (e) { + self.callback(e); + } else { + self.callback(e, data); + } + } + ); + } else { + self.callback(err, data); + } + }); }, /** * @api private */ - computeSseCustomerKeyMd5: function computeSseCustomerKeyMd5(req) { - var keys = { - SSECustomerKey: 'x-amz-server-side-encryption-customer-key-MD5', - CopySourceSSECustomerKey: 'x-amz-copy-source-server-side-encryption-customer-key-MD5' - }; - AWS.util.each(keys, function(key, header) { - if (req.params[key]) { - var value = AWS.util.crypto.md5(req.params[key], 'base64'); - req.httpRequest.headers[header] = value; - } - }); + finishSinglePart: function finishSinglePart(err, data) { + var upload = this.request._managedUpload; + var httpReq = this.request.httpRequest; + var endpoint = httpReq.endpoint; + if (err) return upload.callback(err); + data.Location = + [endpoint.protocol, '//', endpoint.host, httpReq.path].join(''); + data.key = this.request.params.Key; // will stay undocumented + data.Key = this.request.params.Key; + data.Bucket = this.request.params.Bucket; + upload.callback(err, data); }, /** - * Returns true if the bucket name should be left in the URI path for - * a request to S3. This function takes into account the current - * endpoint protocol (e.g. http or https). - * * @api private */ - pathStyleBucketName: function pathStyleBucketName(bucketName) { - // user can force path style requests via the configuration - if (this.config.s3ForcePathStyle) return true; - if (this.config.s3BucketEndpoint) return false; - - if (s3util.dnsCompatibleBucketName(bucketName)) { - return (this.config.sslEnabled && bucketName.match(/\./)) ? true : false; + progress: function progress(info) { + var upload = this._managedUpload; + if (this.operation === 'putObject') { + info.part = 1; + info.key = this.params.Key; } else { - return true; // not dns compatible names must always use path style + upload.totalUploadedBytes += info.loaded - this._lastUploadedBytes; + this._lastUploadedBytes = info.loaded; + info = { + loaded: upload.totalUploadedBytes, + total: upload.totalBytes, + part: this.params.PartNumber, + key: this.params.Key + }; } + upload.emit('httpUploadProgress', [info]); + } +}); + +AWS.util.mixin(AWS.S3.ManagedUpload, AWS.SequentialExecutor); + +/** + * @api private + */ +AWS.S3.ManagedUpload.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.promise = AWS.util.promisifyMethod('send', PromiseDependency); +}; + +/** + * @api private + */ +AWS.S3.ManagedUpload.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.promise; +}; + +AWS.util.addPromises(AWS.S3.ManagedUpload); + +/** + * @api private + */ +module.exports = AWS.S3.ManagedUpload; + + +/***/ }), + +/***/ 55948: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +/** + * @api private + * @!method on(eventName, callback) + * Registers an event listener callback for the event given by `eventName`. + * Parameters passed to the callback function depend on the individual event + * being triggered. See the event documentation for those parameters. + * + * @param eventName [String] the event name to register the listener for + * @param callback [Function] the listener callback function + * @param toHead [Boolean] attach the listener callback to the head of callback array if set to true. + * Default to be false. + * @return [AWS.SequentialExecutor] the same object for chaining + */ +AWS.SequentialExecutor = AWS.util.inherit({ + + constructor: function SequentialExecutor() { + this._events = {}; }, /** - * For COPY operations, some can be error even with status code 200. - * SDK treats the response as exception when response body indicates - * an exception or body is empty. - * * @api private */ - extractErrorFrom200Response: function extractErrorFrom200Response(resp) { - if (!operationsWith200StatusCodeError[resp.request.operation]) return; - var httpResponse = resp.httpResponse; - if (httpResponse.body && httpResponse.body.toString().match('')) { - // Response body with '...' indicates an exception. - // Get S3 client object. In ManagedUpload, this.service refers to - // S3 client object. - resp.data = null; - var service = this.service ? this.service : this; - service.extractError(resp); - throw resp.error; - } else if (!httpResponse.body || !httpResponse.body.toString().match(/<[\w_]/)) { - // When body is empty or incomplete, S3 might stop the request on detecting client - // side aborting the request. - resp.data = null; - throw AWS.util.error(new Error(), { - code: 'InternalError', - message: 'S3 aborted request' - }); + listeners: function listeners(eventName) { + return this._events[eventName] ? this._events[eventName].slice(0) : []; + }, + + on: function on(eventName, listener, toHead) { + if (this._events[eventName]) { + toHead ? + this._events[eventName].unshift(listener) : + this._events[eventName].push(listener); + } else { + this._events[eventName] = [listener]; } + return this; }, - /** - * @return [Boolean] whether the error can be retried - * @api private - */ - retryableError: function retryableError(error, request) { - if (operationsWith200StatusCodeError[request.operation] && - error.statusCode === 200) { - return true; - } else if (request._requestRegionForBucket && - request.service.bucketRegionCache[request._requestRegionForBucket]) { - return false; - } else if (error && error.code === 'RequestTimeout') { - return true; - } else if (error && - regionRedirectErrorCodes.indexOf(error.code) != -1 && - error.region && error.region != request.httpRequest.region) { - request.httpRequest.region = error.region; - if (error.statusCode === 301) { - request.service.updateReqBucketRegion(request); + onAsync: function onAsync(eventName, listener, toHead) { + listener._isAsync = true; + return this.on(eventName, listener, toHead); + }, + + removeListener: function removeListener(eventName, listener) { + var listeners = this._events[eventName]; + if (listeners) { + var length = listeners.length; + var position = -1; + for (var i = 0; i < length; ++i) { + if (listeners[i] === listener) { + position = i; + } } - return true; + if (position > -1) { + listeners.splice(position, 1); + } + } + return this; + }, + + removeAllListeners: function removeAllListeners(eventName) { + if (eventName) { + delete this._events[eventName]; } else { - var _super = AWS.Service.prototype.retryableError; - return _super.call(this, error, request); + this._events = {}; } + return this; }, /** - * Updates httpRequest with region. If region is not provided, then - * the httpRequest will be updated based on httpRequest.region - * * @api private */ - updateReqBucketRegion: function updateReqBucketRegion(request, region) { - var httpRequest = request.httpRequest; - if (typeof region === 'string' && region.length) { - httpRequest.region = region; - } - if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) { - return; - } - var service = request.service; - var s3Config = service.config; - var s3BucketEndpoint = s3Config.s3BucketEndpoint; - if (s3BucketEndpoint) { - delete s3Config.s3BucketEndpoint; - } - var newConfig = AWS.util.copy(s3Config); - delete newConfig.endpoint; - newConfig.region = httpRequest.region; - - httpRequest.endpoint = (new AWS.S3(newConfig)).endpoint; - service.populateURI(request); - s3Config.s3BucketEndpoint = s3BucketEndpoint; - httpRequest.headers.Host = httpRequest.endpoint.host; - - if (request._asm.currentState === 'validate') { - request.removeListener('build', service.populateURI); - request.addListener('build', service.removeVirtualHostedBucketFromPath); - } + emit: function emit(eventName, eventArgs, doneCallback) { + if (!doneCallback) doneCallback = function() { }; + var listeners = this.listeners(eventName); + var count = listeners.length; + this.callListeners(listeners, eventArgs, doneCallback); + return count > 0; }, /** - * Provides a specialized parser for getBucketLocation -- all other - * operations are parsed by the super class. - * * @api private */ - extractData: function extractData(resp) { - var req = resp.request; - if (req.operation === 'getBucketLocation') { - var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/); - delete resp.data['_']; - if (match) { - resp.data.LocationConstraint = match[1]; - } else { - resp.data.LocationConstraint = ''; + callListeners: function callListeners(listeners, args, doneCallback, prevError) { + var self = this; + var error = prevError || null; + + function callNextListener(err) { + if (err) { + error = AWS.util.error(error || new Error(), err); + if (self._haltHandlersOnError) { + return doneCallback.call(self, error); + } } + self.callListeners(listeners, args, doneCallback, error); } - var bucket = req.params.Bucket || null; - if (req.operation === 'deleteBucket' && typeof bucket === 'string' && !resp.error) { - req.service.clearBucketRegionCache(bucket); - } else { - var headers = resp.httpResponse.headers || {}; - var region = headers['x-amz-bucket-region'] || null; - if (!region && req.operation === 'createBucket' && !resp.error) { - var createBucketConfiguration = req.params.CreateBucketConfiguration; - if (!createBucketConfiguration) { - region = 'us-east-1'; - } else if (createBucketConfiguration.LocationConstraint === 'EU') { - region = 'eu-west-1'; - } else { - region = createBucketConfiguration.LocationConstraint; + + while (listeners.length > 0) { + var listener = listeners.shift(); + if (listener._isAsync) { // asynchronous listener + listener.apply(self, args.concat([callNextListener])); + return; // stop here, callNextListener will continue + } else { // synchronous listener + try { + listener.apply(self, args); + } catch (err) { + error = AWS.util.error(error || new Error(), err); + } + if (error && self._haltHandlersOnError) { + doneCallback.call(self, error); + return; } - } - if (region) { - if (bucket && region !== req.service.bucketRegionCache[bucket]) { - req.service.bucketRegionCache[bucket] = region; - } } } - req.service.extractRequestIds(resp); + doneCallback.call(self, error); }, /** - * Extracts an error object from the http response. + * Adds or copies a set of listeners from another list of + * listeners or SequentialExecutor object. * - * @api private + * @param listeners [map>, AWS.SequentialExecutor] + * a list of events and callbacks, or an event emitter object + * containing listeners to add to this emitter object. + * @return [AWS.SequentialExecutor] the emitter object, for chaining. + * @example Adding listeners from a map of listeners + * emitter.addListeners({ + * event1: [function() { ... }, function() { ... }], + * event2: [function() { ... }] + * }); + * emitter.emit('event1'); // emitter has event1 + * emitter.emit('event2'); // emitter has event2 + * @example Adding listeners from another emitter object + * var emitter1 = new AWS.SequentialExecutor(); + * emitter1.on('event1', function() { ... }); + * emitter1.on('event2', function() { ... }); + * var emitter2 = new AWS.SequentialExecutor(); + * emitter2.addListeners(emitter1); + * emitter2.emit('event1'); // emitter2 has event1 + * emitter2.emit('event2'); // emitter2 has event2 */ - extractError: function extractError(resp) { - var codes = { - 304: 'NotModified', - 403: 'Forbidden', - 400: 'BadRequest', - 404: 'NotFound' - }; - - var req = resp.request; - var code = resp.httpResponse.statusCode; - var body = resp.httpResponse.body || ''; + addListeners: function addListeners(listeners) { + var self = this; - var headers = resp.httpResponse.headers || {}; - var region = headers['x-amz-bucket-region'] || null; - var bucket = req.params.Bucket || null; - var bucketRegionCache = req.service.bucketRegionCache; - if (region && bucket && region !== bucketRegionCache[bucket]) { - bucketRegionCache[bucket] = region; - } + // extract listeners if parameter is an SequentialExecutor object + if (listeners._events) listeners = listeners._events; - var cachedRegion; - if (codes[code] && body.length === 0) { - if (bucket && !region) { - cachedRegion = bucketRegionCache[bucket] || null; - if (cachedRegion !== req.httpRequest.region) { - region = cachedRegion; - } - } - resp.error = AWS.util.error(new Error(), { - code: codes[code], - message: null, - region: region + AWS.util.each(listeners, function(event, callbacks) { + if (typeof callbacks === 'function') callbacks = [callbacks]; + AWS.util.arrayEach(callbacks, function(callback) { + self.on(event, callback); }); - } else { - var data = new AWS.XML.Parser().parse(body.toString()); - - if (data.Region && !region) { - region = data.Region; - if (bucket && region !== bucketRegionCache[bucket]) { - bucketRegionCache[bucket] = region; - } - } else if (bucket && !region && !data.Region) { - cachedRegion = bucketRegionCache[bucket] || null; - if (cachedRegion !== req.httpRequest.region) { - region = cachedRegion; - } - } + }); - resp.error = AWS.util.error(new Error(), { - code: data.Code || code, - message: data.Message || null, - region: region - }); - } - req.service.extractRequestIds(resp); + return self; }, /** - * If region was not obtained synchronously, then send async request - * to get bucket region for errors resulting from wrong region. + * Registers an event with {on} and saves the callback handle function + * as a property on the emitter object using a given `name`. * - * @api private + * @param name [String] the property name to set on this object containing + * the callback function handle so that the listener can be removed in + * the future. + * @param (see on) + * @return (see on) + * @example Adding a named listener DATA_CALLBACK + * var listener = function() { doSomething(); }; + * emitter.addNamedListener('DATA_CALLBACK', 'data', listener); + * + * // the following prints: true + * console.log(emitter.DATA_CALLBACK == listener); */ - requestBucketRegion: function requestBucketRegion(resp, done) { - var error = resp.error; - var req = resp.request; - var bucket = req.params.Bucket || null; + addNamedListener: function addNamedListener(name, eventName, callback, toHead) { + this[name] = callback; + this.addListener(eventName, callback, toHead); + return this; + }, - if (!error || !bucket || error.region || req.operation === 'listObjects' || - (AWS.util.isNode() && req.operation === 'headBucket') || - (error.statusCode === 400 && req.operation !== 'headObject') || - regionRedirectErrorCodes.indexOf(error.code) === -1) { - return done(); - } - var reqOperation = AWS.util.isNode() ? 'headBucket' : 'listObjects'; - var reqParams = {Bucket: bucket}; - if (reqOperation === 'listObjects') reqParams.MaxKeys = 0; - var regionReq = req.service[reqOperation](reqParams); - regionReq._requestRegionForBucket = bucket; - regionReq.send(function() { - var region = req.service.bucketRegionCache[bucket] || null; - error.region = region; - done(); - }); + /** + * @api private + */ + addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback, toHead) { + callback._isAsync = true; + return this.addNamedListener(name, eventName, callback, toHead); }, - /** - * For browser only. If NetworkingError received, will attempt to obtain - * the bucket region. + /** + * Helper method to add a set of named listeners using + * {addNamedListener}. The callback contains a parameter + * with a handle to the `addNamedListener` method. + * + * @callback callback function(add) + * The callback function is called immediately in order to provide + * the `add` function to the block. This simplifies the addition of + * a large group of named listeners. + * @param add [Function] the {addNamedListener} function to call + * when registering listeners. + * @example Adding a set of named listeners + * emitter.addNamedListeners(function(add) { + * add('DATA_CALLBACK', 'data', function() { ... }); + * add('OTHER', 'otherEvent', function() { ... }); + * add('LAST', 'lastEvent', function() { ... }); + * }); + * + * // these properties are now set: + * emitter.DATA_CALLBACK; + * emitter.OTHER; + * emitter.LAST; + */ + addNamedListeners: function addNamedListeners(callback) { + var self = this; + callback( + function() { + self.addNamedListener.apply(self, arguments); + }, + function() { + self.addNamedAsyncListener.apply(self, arguments); + } + ); + return this; + } +}); + +/** + * {on} is the prefered method. + * @api private + */ +AWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on; + +/** + * @api private + */ +module.exports = AWS.SequentialExecutor; + + +/***/ }), + +/***/ 68903: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var Api = __nccwpck_require__(17657); +var regionConfig = __nccwpck_require__(18262); + +var inherit = AWS.util.inherit; +var clientCount = 0; +var region_utils = __nccwpck_require__(99517); + +/** + * The service class representing an AWS service. + * + * @class_abstract This class is an abstract class. + * + * @!attribute apiVersions + * @return [Array] the list of API versions supported by this service. + * @readonly + */ +AWS.Service = inherit({ + /** + * Create a new service object with a configuration object * - * @api private + * @param config [map] a map of configuration options */ - reqRegionForNetworkingError: function reqRegionForNetworkingError(resp, done) { - if (!AWS.util.isBrowser()) { - return done(); - } - var error = resp.error; - var request = resp.request; - var bucket = request.params.Bucket; - if (!error || error.code !== 'NetworkingError' || !bucket || - request.httpRequest.region === 'us-east-1') { - return done(); + constructor: function Service(config) { + if (!this.loadServiceClass) { + throw AWS.util.error(new Error(), + 'Service must be constructed with `new\' operator'); } - var service = request.service; - var bucketRegionCache = service.bucketRegionCache; - var cachedRegion = bucketRegionCache[bucket] || null; - if (cachedRegion && cachedRegion !== request.httpRequest.region) { - service.updateReqBucketRegion(request, cachedRegion); - done(); - } else if (!s3util.dnsCompatibleBucketName(bucket)) { - service.updateReqBucketRegion(request, 'us-east-1'); - if (bucketRegionCache[bucket] !== 'us-east-1') { - bucketRegionCache[bucket] = 'us-east-1'; + if (config) { + if (config.region) { + var region = config.region; + if (region_utils.isFipsRegion(region)) { + config.region = region_utils.getRealRegion(region); + config.useFipsEndpoint = true; + } + if (region_utils.isGlobalRegion(region)) { + config.region = region_utils.getRealRegion(region); + } } - done(); - } else if (request.httpRequest.virtualHostedBucket) { - var getRegionReq = service.listObjects({Bucket: bucket, MaxKeys: 0}); - service.updateReqBucketRegion(getRegionReq, 'us-east-1'); - getRegionReq._requestRegionForBucket = bucket; + if (typeof config.useDualstack === 'boolean' + && typeof config.useDualstackEndpoint !== 'boolean') { + config.useDualstackEndpoint = config.useDualstack; + } + } - getRegionReq.send(function() { - var region = service.bucketRegionCache[bucket] || null; - if (region && region !== request.httpRequest.region) { - service.updateReqBucketRegion(request, region); - } - done(); + var ServiceClass = this.loadServiceClass(config || {}); + if (ServiceClass) { + var originalConfig = AWS.util.copy(config); + var svc = new ServiceClass(config); + Object.defineProperty(svc, '_originalConfig', { + get: function() { return originalConfig; }, + enumerable: false, + configurable: true }); - } else { - // DNS-compatible path-style - // (s3ForcePathStyle or bucket name with dot over https) - // Cannot obtain region information for this case - done(); + svc._clientId = ++clientCount; + return svc; } - }, + this.initialize(config); + }, /** - * Cache for bucket region. - * * @api private */ - bucketRegionCache: {}, + initialize: function initialize(config) { + var svcConfig = AWS.config[this.serviceIdentifier]; + this.config = new AWS.Config(AWS.config); + if (svcConfig) this.config.update(svcConfig, true); + if (config) this.config.update(config, true); - /** - * Clears bucket region cache. - * - * @api private - */ - clearBucketRegionCache: function(buckets) { - var bucketRegionCache = this.bucketRegionCache; - if (!buckets) { - buckets = Object.keys(bucketRegionCache); - } else if (typeof buckets === 'string') { - buckets = [buckets]; - } - for (var i = 0; i < buckets.length; i++) { - delete bucketRegionCache[buckets[i]]; - } - return bucketRegionCache; - }, + this.validateService(); + if (!this.config.endpoint) regionConfig.configureEndpoint(this); - /** - * Corrects request region if bucket's cached region is different - * - * @api private - */ - correctBucketRegionFromCache: function correctBucketRegionFromCache(req) { - var bucket = req.params.Bucket || null; - if (bucket) { - var service = req.service; - var requestRegion = req.httpRequest.region; - var cachedRegion = service.bucketRegionCache[bucket]; - if (cachedRegion && cachedRegion !== requestRegion) { - service.updateReqBucketRegion(req, cachedRegion); - } + this.config.endpoint = this.endpointFromTemplate(this.config.endpoint); + this.setEndpoint(this.config.endpoint); + //enable attaching listeners to service client + AWS.SequentialExecutor.call(this); + AWS.Service.addDefaultMonitoringListeners(this); + if ((this.config.clientSideMonitoring || AWS.Service._clientSideMonitoring) && this.publisher) { + var publisher = this.publisher; + this.addNamedListener('PUBLISH_API_CALL', 'apiCall', function PUBLISH_API_CALL(event) { + process.nextTick(function() {publisher.eventHandler(event);}); + }); + this.addNamedListener('PUBLISH_API_ATTEMPT', 'apiCallAttempt', function PUBLISH_API_ATTEMPT(event) { + process.nextTick(function() {publisher.eventHandler(event);}); + }); } }, /** - * Extracts S3 specific request ids from the http response. - * * @api private */ - extractRequestIds: function extractRequestIds(resp) { - var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null; - var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null; - resp.extendedRequestId = extendedRequestId; - resp.cfId = cfId; - - if (resp.error) { - resp.error.requestId = resp.requestId || null; - resp.error.extendedRequestId = extendedRequestId; - resp.error.cfId = cfId; - } + validateService: function validateService() { }, /** - * Get a pre-signed URL for a given operation name. - * - * @note You must ensure that you have static or previously resolved - * credentials if you call this method synchronously (with no callback), - * otherwise it may not properly sign the request. If you cannot guarantee - * this (you are using an asynchronous credential provider, i.e., EC2 - * IAM roles), you should always call this method with an asynchronous - * callback. - * @note Not all operation parameters are supported when using pre-signed - * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, - * `ContentLength`, or `Tagging` must be provided as headers when sending a - * request. If you are using pre-signed URLs to upload from a browser and - * need to use these fields, see {createPresignedPost}. - * @note The default signer allows altering the request by adding corresponding - * headers to set some parameters (e.g. Range) and these added parameters - * won't be signed. You must use signatureVersion v4 to to include these - * parameters in the signed portion of the URL and enforce exact matching - * between headers and signed params in the URL. - * @note This operation cannot be used with a promise. See note above regarding - * asynchronous credentials and use with a callback. - * @param operation [String] the name of the operation to call - * @param params [map] parameters to pass to the operation. See the given - * operation for the expected operation parameters. In addition, you can - * also pass the "Expires" parameter to inform S3 how long the URL should - * work for. - * @option params Expires [Integer] (900) the number of seconds to expire - * the pre-signed URL operation in. Defaults to 15 minutes. - * @param callback [Function] if a callback is provided, this function will - * pass the URL as the second parameter (after the error parameter) to - * the callback function. - * @return [String] if called synchronously (with no callback), returns the - * signed URL. - * @return [null] nothing is returned if a callback is provided. - * @example Pre-signing a getObject operation (synchronously) - * var params = {Bucket: 'bucket', Key: 'key'}; - * var url = s3.getSignedUrl('getObject', params); - * console.log('The URL is', url); - * @example Pre-signing a putObject (asynchronously) - * var params = {Bucket: 'bucket', Key: 'key'}; - * s3.getSignedUrl('putObject', params, function (err, url) { - * console.log('The URL is', url); - * }); - * @example Pre-signing a putObject operation with a specific payload - * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; - * var url = s3.getSignedUrl('putObject', params); - * console.log('The URL is', url); - * @example Passing in a 1-minute expiry time for a pre-signed URL - * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; - * var url = s3.getSignedUrl('getObject', params); - * console.log('The URL is', url); // expires in 60 seconds + * @api private */ - getSignedUrl: function getSignedUrl(operation, params, callback) { - params = AWS.util.copy(params || {}); - var expires = params.Expires || 900; - - if (typeof expires !== 'number') { - throw AWS.util.error(new Error(), - { code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires }); - } - - delete params.Expires; // we can't validate this - var request = this.makeRequest(operation, params); - - if (callback) { - AWS.util.defer(function() { - request.presign(expires, callback); - }); + loadServiceClass: function loadServiceClass(serviceConfig) { + var config = serviceConfig; + if (!AWS.util.isEmpty(this.api)) { + return null; + } else if (config.apiConfig) { + return AWS.Service.defineServiceApi(this.constructor, config.apiConfig); + } else if (!this.constructor.services) { + return null; } else { - return request.presign(expires, callback); + config = new AWS.Config(AWS.config); + config.update(serviceConfig, true); + var version = config.apiVersions[this.constructor.serviceIdentifier]; + version = version || config.apiVersion; + return this.getLatestServiceClass(version); } }, /** - * @!method getSignedUrlPromise() - * Returns a 'thenable' promise that will be resolved with a pre-signed URL - * for a given operation name. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @note Not all operation parameters are supported when using pre-signed - * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, - * `ContentLength`, or `Tagging` must be provided as headers when sending a - * request. If you are using pre-signed URLs to upload from a browser and - * need to use these fields, see {createPresignedPost}. - * @param operation [String] the name of the operation to call - * @param params [map] parameters to pass to the operation. See the given - * operation for the expected operation parameters. In addition, you can - * also pass the "Expires" parameter to inform S3 how long the URL should - * work for. - * @option params Expires [Integer] (900) the number of seconds to expire - * the pre-signed URL operation in. Defaults to 15 minutes. - * @callback fulfilledCallback function(url) - * Called if the promise is fulfilled. - * @param url [String] the signed url - * @callback rejectedCallback function(err) - * Called if the promise is rejected. - * @param err [Error] if an error occurred, this value will be filled - * @return [Promise] A promise that represents the state of the `refresh` call. - * @example Pre-signing a getObject operation - * var params = {Bucket: 'bucket', Key: 'key'}; - * var promise = s3.getSignedUrlPromise('getObject', params); - * promise.then(function(url) { - * console.log('The URL is', url); - * }, function(err) { ... }); - * @example Pre-signing a putObject operation with a specific payload - * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; - * var promise = s3.getSignedUrlPromise('putObject', params); - * promise.then(function(url) { - * console.log('The URL is', url); - * }, function(err) { ... }); - * @example Passing in a 1-minute expiry time for a pre-signed URL - * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; - * var promise = s3.getSignedUrlPromise('getObject', params); - * promise.then(function(url) { - * console.log('The URL is', url); - * }, function(err) { ... }); - */ - - /** - * Get a pre-signed POST policy to support uploading to S3 directly from an - * HTML form. - * - * @param params [map] - * @option params Bucket [String] The bucket to which the post should be - * uploaded - * @option params Expires [Integer] (3600) The number of seconds for which - * the presigned policy should be valid. - * @option params Conditions [Array] An array of conditions that must be met - * for the presigned policy to allow the - * upload. This can include required tags, - * the accepted range for content lengths, - * etc. - * @see http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html - * @option params Fields [map] Fields to include in the form. All - * values passed in as fields will be - * signed as exact match conditions. - * @param callback [Function] - * - * @note All fields passed in when creating presigned post data will be signed - * as exact match conditions. Any fields that will be interpolated by S3 - * must be added to the fields hash after signing, and an appropriate - * condition for such fields must be explicitly added to the Conditions - * array passed to this function before signing. - * - * @example Presiging post data with a known key - * var params = { - * Bucket: 'bucket', - * Fields: { - * key: 'key' - * } - * }; - * s3.createPresignedPost(params, function(err, data) { - * if (err) { - * console.error('Presigning post data encountered an error', err); - * } else { - * console.log('The post data is', data); - * } - * }); - * - * @example Presigning post data with an interpolated key - * var params = { - * Bucket: 'bucket', - * Conditions: [ - * ['starts-with', '$key', 'path/to/uploads/'] - * ] - * }; - * s3.createPresignedPost(params, function(err, data) { - * if (err) { - * console.error('Presigning post data encountered an error', err); - * } else { - * data.Fields.key = 'path/to/uploads/${filename}'; - * console.log('The post data is', data); - * } - * }); - * - * @note You must ensure that you have static or previously resolved - * credentials if you call this method synchronously (with no callback), - * otherwise it may not properly sign the request. If you cannot guarantee - * this (you are using an asynchronous credential provider, i.e., EC2 - * IAM roles), you should always call this method with an asynchronous - * callback. - * - * @return [map] If called synchronously (with no callback), returns a hash - * with the url to set as the form action and a hash of fields - * to include in the form. - * @return [null] Nothing is returned if a callback is provided. - * - * @callback callback function (err, data) - * @param err [Error] the error object returned from the policy signer - * @param data [map] The data necessary to construct an HTML form - * @param data.url [String] The URL to use as the action of the form - * @param data.fields [map] A hash of fields that must be included in the - * form for the upload to succeed. This hash will - * include the signed POST policy, your access key - * ID and security token (if present), etc. These - * may be safely included as input elements of type - * 'hidden.' + * @api private */ - createPresignedPost: function createPresignedPost(params, callback) { - if (typeof params === 'function' && callback === undefined) { - callback = params; - params = null; - } - - params = AWS.util.copy(params || {}); - var boundParams = this.config.params || {}; - var bucket = params.Bucket || boundParams.Bucket, - self = this, - config = this.config, - endpoint = AWS.util.copy(this.endpoint); - if (!config.s3BucketEndpoint) { - endpoint.pathname = '/' + bucket; - } - - function finalizePost() { - return { - url: AWS.util.urlFormat(endpoint), - fields: self.preparePostFields( - config.credentials, - config.region, - bucket, - params.Fields, - params.Conditions, - params.Expires - ) - }; + getLatestServiceClass: function getLatestServiceClass(version) { + version = this.getLatestServiceVersion(version); + if (this.constructor.services[version] === null) { + AWS.Service.defineServiceApi(this.constructor, version); } - if (callback) { - config.getCredentials(function (err) { - if (err) { - callback(err); - } else { - try { - callback(null, finalizePost()); - } catch (err) { - callback(err); - } - } - }); - } else { - return finalizePost(); - } + return this.constructor.services[version]; }, /** * @api private */ - preparePostFields: function preparePostFields( - credentials, - region, - bucket, - fields, - conditions, - expiresInSeconds - ) { - var now = this.getSkewCorrectedDate(); - if (!credentials || !region || !bucket) { - throw new Error('Unable to create a POST object policy without a bucket,' - + ' region, and credentials'); + getLatestServiceVersion: function getLatestServiceVersion(version) { + if (!this.constructor.services || this.constructor.services.length === 0) { + throw new Error('No services defined on ' + + this.constructor.serviceIdentifier); } - fields = AWS.util.copy(fields || {}); - conditions = (conditions || []).slice(0); - expiresInSeconds = expiresInSeconds || 3600; - var signingDate = AWS.util.date.iso8601(now).replace(/[:\-]|\.\d{3}/g, ''); - var shortDate = signingDate.substr(0, 8); - var scope = v4Credentials.createScope(shortDate, region, 's3'); - var credential = credentials.accessKeyId + '/' + scope; + if (!version) { + version = 'latest'; + } else if (AWS.util.isType(version, Date)) { + version = AWS.util.date.iso8601(version).split('T')[0]; + } - fields['bucket'] = bucket; - fields['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'; - fields['X-Amz-Credential'] = credential; - fields['X-Amz-Date'] = signingDate; - if (credentials.sessionToken) { - fields['X-Amz-Security-Token'] = credentials.sessionToken; + if (Object.hasOwnProperty(this.constructor.services, version)) { + return version; } - for (var field in fields) { - if (fields.hasOwnProperty(field)) { - var condition = {}; - condition[field] = fields[field]; - conditions.push(condition); + + var keys = Object.keys(this.constructor.services).sort(); + var selectedVersion = null; + for (var i = keys.length - 1; i >= 0; i--) { + // versions that end in "*" are not available on disk and can be + // skipped, so do not choose these as selectedVersions + if (keys[i][keys[i].length - 1] !== '*') { + selectedVersion = keys[i]; + } + if (keys[i].substr(0, 10) <= version) { + return selectedVersion; } } - fields.Policy = this.preparePostPolicy( - new Date(now.valueOf() + expiresInSeconds * 1000), - conditions - ); - fields['X-Amz-Signature'] = AWS.util.crypto.hmac( - v4Credentials.getSigningKey(credentials, shortDate, region, 's3', true), - fields.Policy, - 'hex' - ); - - return fields; + throw new Error('Could not find ' + this.constructor.serviceIdentifier + + ' API to satisfy version constraint `' + version + '\''); }, /** * @api private */ - preparePostPolicy: function preparePostPolicy(expiration, conditions) { - return AWS.util.base64.encode(JSON.stringify({ - expiration: AWS.util.date.iso8601(expiration), - conditions: conditions - })); - }, + api: {}, /** * @api private */ - prepareSignedUrl: function prepareSignedUrl(request) { - request.addListener('validate', request.service.noPresignedContentLength); - request.removeListener('build', request.service.addContentType); - if (!request.params.Body) { - // no Content-MD5/SHA-256 if body is not provided - request.removeListener('build', request.service.computeContentMd5); - } else { - request.addListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); - } - }, + defaultRetryCount: 3, /** * @api private - * @param request */ - disableBodySigning: function disableBodySigning(request) { - var headers = request.httpRequest.headers; - // Add the header to anything that isn't a presigned url, unless that presigned url had a body defined - if (!Object.prototype.hasOwnProperty.call(headers, 'presigned-expires')) { - headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; + customizeRequests: function customizeRequests(callback) { + if (!callback) { + this.customRequestHandler = null; + } else if (typeof callback === 'function') { + this.customRequestHandler = callback; + } else { + throw new Error('Invalid callback type \'' + typeof callback + '\' provided in customizeRequests'); } }, /** - * @api private + * Calls an operation on a service with the given input parameters. + * + * @param operation [String] the name of the operation to call on the service. + * @param params [map] a map of input options for the operation + * @callback callback function(err, data) + * If a callback is supplied, it is called when a response is returned + * from the service. + * @param err [Error] the error object returned from the request. + * Set to `null` if the request is successful. + * @param data [Object] the de-serialized data returned from + * the request. Set to `null` if a request error occurs. */ - noPresignedContentLength: function noPresignedContentLength(request) { - if (request.params.ContentLength !== undefined) { - throw AWS.util.error(new Error(), {code: 'UnexpectedParameter', - message: 'ContentLength is not supported in pre-signed URLs.'}); - } - }, - - createBucket: function createBucket(params, callback) { - // When creating a bucket *outside* the classic region, the location - // constraint must be set for the bucket and it must match the endpoint. - // This chunk of code will set the location constraint param based - // on the region (when possible), but it will not override a passed-in - // location constraint. - if (typeof params === 'function' || !params) { - callback = callback || params; - params = {}; - } - var hostname = this.endpoint.hostname; - // copy params so that appending keys does not unintentioinallly - // mutate params object argument passed in by user - var copiedParams = AWS.util.copy(params); - - if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) { - copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region }; + makeRequest: function makeRequest(operation, params, callback) { + if (typeof params === 'function') { + callback = params; + params = null; } - return this.makeRequest('createBucket', copiedParams, callback); - }, - writeGetObjectResponse: function writeGetObjectResponse(params, callback) { - - var request = this.makeRequest('writeGetObjectResponse', AWS.util.copy(params), callback); - var hostname = this.endpoint.hostname; - if (hostname.indexOf(this.config.region) !== -1) { - // hostname specifies a region already - hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.'); - } else { - // Hostname doesn't have a region. - // Object Lambda requires an explicit region. - hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.' + this.config.region + '.'); + params = params || {}; + if (this.config.params) { // copy only toplevel bound params + var rules = this.api.operations[operation]; + if (rules) { + params = AWS.util.copy(params); + AWS.util.each(this.config.params, function(key, value) { + if (rules.input.members[key]) { + if (params[key] === undefined || params[key] === null) { + params[key] = value; + } + } + }); + } } - request.httpRequest.endpoint = new AWS.Endpoint(hostname, this.config); + var request = new AWS.Request(this, operation, params); + this.addAllRequestListeners(request); + this.attachMonitoringEmitter(request); + if (callback) request.send(callback); return request; }, /** - * @see AWS.S3.ManagedUpload - * @overload upload(params = {}, [options], [callback]) - * Uploads an arbitrarily sized buffer, blob, or stream, using intelligent - * concurrent handling of parts if the payload is large enough. You can - * configure the concurrent queue size by setting `options`. Note that this - * is the only operation for which the SDK can retry requests with stream - * bodies. + * Calls an operation on a service with the given input parameters, without + * any authentication data. This method is useful for "public" API operations. * - * @param (see AWS.S3.putObject) - * @option (see AWS.S3.ManagedUpload.constructor) - * @return [AWS.S3.ManagedUpload] the managed upload object that can call - * `send()` or track progress. - * @example Uploading a stream object - * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; - * s3.upload(params, function(err, data) { - * console.log(err, data); - * }); - * @example Uploading a stream with concurrency of 1 and partSize of 10mb - * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; - * var options = {partSize: 10 * 1024 * 1024, queueSize: 1}; - * s3.upload(params, options, function(err, data) { - * console.log(err, data); - * }); + * @param operation [String] the name of the operation to call on the service. + * @param params [map] a map of input options for the operation * @callback callback function(err, data) - * @param err [Error] an error or null if no error occurred. - * @param data [map] The response data from the successful upload: - * @param data.Location [String] the URL of the uploaded object - * @param data.ETag [String] the ETag of the uploaded object - * @param data.Bucket [String] the bucket to which the object was uploaded - * @param data.Key [String] the key to which the object was uploaded + * If a callback is supplied, it is called when a response is returned + * from the service. + * @param err [Error] the error object returned from the request. + * Set to `null` if the request is successful. + * @param data [Object] the de-serialized data returned from + * the request. Set to `null` if a request error occurs. */ - upload: function upload(params, options, callback) { - if (typeof options === 'function' && callback === undefined) { - callback = options; - options = null; + makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) { + if (typeof params === 'function') { + callback = params; + params = {}; } - options = options || {}; - options = AWS.util.merge(options || {}, {service: this, params: params}); - - var uploader = new AWS.S3.ManagedUpload(options); - if (typeof callback === 'function') uploader.send(callback); - return uploader; - } -}); - -/** - * @api private - */ -AWS.S3.addPromisesToClass = function addPromisesToClass(PromiseDependency) { - this.prototype.getSignedUrlPromise = AWS.util.promisifyMethod('getSignedUrl', PromiseDependency); -}; - -/** - * @api private - */ -AWS.S3.deletePromisesFromClass = function deletePromisesFromClass() { - delete this.prototype.getSignedUrlPromise; -}; - -AWS.util.addPromises(AWS.S3); - - -/***/ }), - -/***/ 71207: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + var request = this.makeRequest(operation, params).toUnauthenticated(); + return callback ? request.send(callback) : request; + }, -var AWS = __nccwpck_require__(28437); -var s3util = __nccwpck_require__(35895); -var regionUtil = __nccwpck_require__(18262); + /** + * Waits for a given state + * + * @param state [String] the state on the service to wait for + * @param params [map] a map of parameters to pass with each request + * @option params $waiter [map] a map of configuration options for the waiter + * @option params $waiter.delay [Number] The number of seconds to wait between + * requests + * @option params $waiter.maxAttempts [Number] The maximum number of requests + * to send while waiting + * @callback callback function(err, data) + * If a callback is supplied, it is called when a response is returned + * from the service. + * @param err [Error] the error object returned from the request. + * Set to `null` if the request is successful. + * @param data [Object] the de-serialized data returned from + * the request. Set to `null` if a request error occurs. + */ + waitFor: function waitFor(state, params, callback) { + var waiter = new AWS.ResourceWaiter(this, state); + return waiter.wait(params, callback); + }, -AWS.util.update(AWS.S3Control.prototype, { /** * @api private */ - setupRequestListeners: function setupRequestListeners(request) { - request.addListener('extractError', this.extractHostId); - request.addListener('extractData', this.extractHostId); - request.addListener('validate', this.validateAccountId); - - var isArnInBucket = s3util.isArnInParam(request, 'Bucket'); - var isArnInName = s3util.isArnInParam(request, 'Name'); - - if (isArnInBucket) { - request._parsedArn = AWS.util.ARN.parse(request.params['Bucket']); - request.addListener('validate', this.validateOutpostsBucketArn); - request.addListener('validate', s3util.validateOutpostsArn); - request.addListener('afterBuild', this.addOutpostIdHeader); - } else if (isArnInName) { - request._parsedArn = AWS.util.ARN.parse(request.params['Name']); - request.addListener('validate', s3util.validateOutpostsAccessPointArn); - request.addListener('validate', s3util.validateOutpostsArn); - request.addListener('afterBuild', this.addOutpostIdHeader); + addAllRequestListeners: function addAllRequestListeners(request) { + var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(), + AWS.EventListeners.CorePost]; + for (var i = 0; i < list.length; i++) { + if (list[i]) request.addListeners(list[i]); } - if (isArnInBucket || isArnInName) { - request.addListener('validate', this.validateArnRegion); - request.addListener('validate', this.validateArnAccountWithParams, true); - request.addListener('validate', s3util.validateArnAccount); - request.addListener('validate', s3util.validateArnService); - request.addListener('build', this.populateParamFromArn, true); - request.addListener('build', this.populateUriFromArn); - request.addListener('build', s3util.validatePopulateUriFromArn); + // disable parameter validation + if (!this.config.paramValidation) { + request.removeListener('validate', + AWS.EventListeners.Core.VALIDATE_PARAMETERS); } - if (request.params.OutpostId && - (request.operation === 'createBucket' || - request.operation === 'listRegionalBuckets')) { - request.addListener('build', this.populateEndpointForOutpostId); + if (this.config.logger) { // add logging events + request.addListeners(AWS.EventListeners.Logger); } - }, - /** - * Adds outpostId header - */ - addOutpostIdHeader: function addOutpostIdHeader(req) { - req.httpRequest.headers['x-amz-outpost-id'] = req._parsedArn.outpostId; + this.setupRequestListeners(request); + // call prototype's customRequestHandler + if (typeof this.constructor.prototype.customRequestHandler === 'function') { + this.constructor.prototype.customRequestHandler(request); + } + // call instance's customRequestHandler + if (Object.prototype.hasOwnProperty.call(this, 'customRequestHandler') && typeof this.customRequestHandler === 'function') { + this.customRequestHandler(request); + } }, /** - * Validate Outposts ARN supplied in Bucket parameter is a valid bucket name + * Event recording metrics for a whole API call. + * @returns {object} a subset of api call metrics + * @api private */ - validateOutpostsBucketArn: function validateOutpostsBucketArn(req) { - var parsedArn = req._parsedArn; - - //can be ':' or '/' - var delimiter = parsedArn.resource['outpost'.length]; - - if (parsedArn.resource.split(delimiter).length !== 4) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'Bucket ARN should have two resources outpost/{outpostId}/bucket/{accesspointName}' - }); + apiCallEvent: function apiCallEvent(request) { + var api = request.service.api.operations[request.operation]; + var monitoringEvent = { + Type: 'ApiCall', + Api: api ? api.name : request.operation, + Version: 1, + Service: request.service.api.serviceId || request.service.api.endpointPrefix, + Region: request.httpRequest.region, + MaxRetriesExceeded: 0, + UserAgent: request.httpRequest.getUserAgent(), + }; + var response = request.response; + if (response.httpResponse.statusCode) { + monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode; } - - var bucket = parsedArn.resource.split(delimiter)[3]; - if (!s3util.dnsCompatibleBucketName(bucket) || bucket.match(/\./)) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'Bucket ARN is not DNS compatible. Got ' + bucket - }); + if (response.error) { + var error = response.error; + var statusCode = response.httpResponse.statusCode; + if (statusCode > 299) { + if (error.code) monitoringEvent.FinalAwsException = error.code; + if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message; + } else { + if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name; + if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message; + } } - - //set parsed valid bucket - req._parsedArn.bucket = bucket; + return monitoringEvent; }, /** + * Event recording metrics for an API call attempt. + * @returns {object} a subset of api call attempt metrics * @api private */ - populateParamFromArn: function populateParamFromArn(req) { - var parsedArn = req._parsedArn; - if (s3util.isArnInParam(req, 'Bucket')) { - req.params.Bucket = parsedArn.bucket; - } else if (s3util.isArnInParam(req, 'Name')) { - req.params.Name = parsedArn.accessPoint; + apiAttemptEvent: function apiAttemptEvent(request) { + var api = request.service.api.operations[request.operation]; + var monitoringEvent = { + Type: 'ApiCallAttempt', + Api: api ? api.name : request.operation, + Version: 1, + Service: request.service.api.serviceId || request.service.api.endpointPrefix, + Fqdn: request.httpRequest.endpoint.hostname, + UserAgent: request.httpRequest.getUserAgent(), + }; + var response = request.response; + if (response.httpResponse.statusCode) { + monitoringEvent.HttpStatusCode = response.httpResponse.statusCode; + } + if ( + !request._unAuthenticated && + request.service.config.credentials && + request.service.config.credentials.accessKeyId + ) { + monitoringEvent.AccessKey = request.service.config.credentials.accessKeyId; + } + if (!response.httpResponse.headers) return monitoringEvent; + if (request.httpRequest.headers['x-amz-security-token']) { + monitoringEvent.SessionToken = request.httpRequest.headers['x-amz-security-token']; + } + if (response.httpResponse.headers['x-amzn-requestid']) { + monitoringEvent.XAmznRequestId = response.httpResponse.headers['x-amzn-requestid']; + } + if (response.httpResponse.headers['x-amz-request-id']) { + monitoringEvent.XAmzRequestId = response.httpResponse.headers['x-amz-request-id']; + } + if (response.httpResponse.headers['x-amz-id-2']) { + monitoringEvent.XAmzId2 = response.httpResponse.headers['x-amz-id-2']; } + return monitoringEvent; }, /** - * Populate URI according to the ARN + * Add metrics of failed request. + * @api private */ - populateUriFromArn: function populateUriFromArn(req) { - var parsedArn = req._parsedArn; - - var endpoint = req.httpRequest.endpoint; - var useArnRegion = req.service.config.s3UseArnRegion; - var useFipsEndpoint = req.service.config.useFipsEndpoint; - - endpoint.hostname = [ - 's3-outposts' + (useFipsEndpoint ? '-fips': ''), - useArnRegion ? parsedArn.region : req.service.config.region, - 'amazonaws.com' - ].join('.'); - endpoint.host = endpoint.hostname; + attemptFailEvent: function attemptFailEvent(request) { + var monitoringEvent = this.apiAttemptEvent(request); + var response = request.response; + var error = response.error; + if (response.httpResponse.statusCode > 299 ) { + if (error.code) monitoringEvent.AwsException = error.code; + if (error.message) monitoringEvent.AwsExceptionMessage = error.message; + } else { + if (error.code || error.name) monitoringEvent.SdkException = error.code || error.name; + if (error.message) monitoringEvent.SdkExceptionMessage = error.message; + } + return monitoringEvent; }, /** + * Attach listeners to request object to fetch metrics of each request + * and emit data object through \'ApiCall\' and \'ApiCallAttempt\' events. * @api private */ - populateEndpointForOutpostId: function populateEndpointForOutpostId(req) { - var endpoint = req.httpRequest.endpoint; - var useFipsEndpoint = req.service.config.useFipsEndpoint; - endpoint.hostname = [ - 's3-outposts' + (useFipsEndpoint ? '-fips': ''), - req.service.config.region, - 'amazonaws.com' - ].join('.'); - endpoint.host = endpoint.hostname; + attachMonitoringEmitter: function attachMonitoringEmitter(request) { + var attemptTimestamp; //timestamp marking the beginning of a request attempt + var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency + var attemptLatency; //latency from request sent out to http response reaching SDK + var callStartRealTime; //Start time of API call. Used to calculating API call latency + var attemptCount = 0; //request.retryCount is not reliable here + var region; //region cache region for each attempt since it can be updated in plase (e.g. s3) + var callTimestamp; //timestamp when the request is created + var self = this; + var addToHead = true; + + request.on('validate', function () { + callStartRealTime = AWS.util.realClock.now(); + callTimestamp = Date.now(); + }, addToHead); + request.on('sign', function () { + attemptStartRealTime = AWS.util.realClock.now(); + attemptTimestamp = Date.now(); + region = request.httpRequest.region; + attemptCount++; + }, addToHead); + request.on('validateResponse', function() { + attemptLatency = Math.round(AWS.util.realClock.now() - attemptStartRealTime); + }); + request.addNamedListener('API_CALL_ATTEMPT', 'success', function API_CALL_ATTEMPT() { + var apiAttemptEvent = self.apiAttemptEvent(request); + apiAttemptEvent.Timestamp = attemptTimestamp; + apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; + apiAttemptEvent.Region = region; + self.emit('apiCallAttempt', [apiAttemptEvent]); + }); + request.addNamedListener('API_CALL_ATTEMPT_RETRY', 'retry', function API_CALL_ATTEMPT_RETRY() { + var apiAttemptEvent = self.attemptFailEvent(request); + apiAttemptEvent.Timestamp = attemptTimestamp; + //attemptLatency may not be available if fail before response + attemptLatency = attemptLatency || + Math.round(AWS.util.realClock.now() - attemptStartRealTime); + apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; + apiAttemptEvent.Region = region; + self.emit('apiCallAttempt', [apiAttemptEvent]); + }); + request.addNamedListener('API_CALL', 'complete', function API_CALL() { + var apiCallEvent = self.apiCallEvent(request); + apiCallEvent.AttemptCount = attemptCount; + if (apiCallEvent.AttemptCount <= 0) return; + apiCallEvent.Timestamp = callTimestamp; + var latency = Math.round(AWS.util.realClock.now() - callStartRealTime); + apiCallEvent.Latency = latency >= 0 ? latency : 0; + var response = request.response; + if ( + response.error && + response.error.retryable && + typeof response.retryCount === 'number' && + typeof response.maxRetries === 'number' && + (response.retryCount >= response.maxRetries) + ) { + apiCallEvent.MaxRetriesExceeded = 1; + } + self.emit('apiCall', [apiCallEvent]); + }); }, /** - * @api private + * Override this method to setup any custom request listeners for each + * new request to the service. + * + * @method_abstract This is an abstract method. */ - extractHostId: function(response) { - var hostId = response.httpResponse.headers ? response.httpResponse.headers['x-amz-id-2'] : null; - response.extendedRequestId = hostId; - if (response.error) { - response.error.extendedRequestId = hostId; - } + setupRequestListeners: function setupRequestListeners(request) { }, /** + * Gets the signing name for a given request * @api private */ - validateArnRegion: function validateArnRegion(req) { - s3util.validateArnRegion(req, { allowFipsEndpoint: true }); + getSigningName: function getSigningName() { + return this.api.signingName || this.api.endpointPrefix; }, /** + * Gets the signer class for a given request * @api private */ - validateArnAccountWithParams: function validateArnAccountWithParams(req) { - var params = req.params; - var inputModel = req.service.api.operations[req.operation].input; - if (inputModel.members.AccountId) { - var parsedArn = req._parsedArn; - if (parsedArn.accountId) { - if (params.AccountId) { - if (params.AccountId !== parsedArn.accountId) { - throw AWS.util.error( - new Error(), - {code: 'ValidationError', message: 'AccountId in ARN and request params should be same.'} - ); - } - } else { - // Store accountId from ARN in params - params.AccountId = parsedArn.accountId; - } - } + getSignerClass: function getSignerClass(request) { + var version; + // get operation authtype if present + var operation = null; + var authtype = ''; + if (request) { + var operations = request.service.api.operations || {}; + operation = operations[request.operation] || null; + authtype = operation ? operation.authtype : ''; + } + if (this.config.signatureVersion) { + version = this.config.signatureVersion; + } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') { + version = 'v4'; + } else if (authtype === 'bearer') { + version = 'bearer'; + } else { + version = this.api.signatureVersion; } + return AWS.Signers.RequestSigner.getVersion(version); }, /** * @api private */ - validateAccountId: function(request) { - var params = request.params; - if (!Object.prototype.hasOwnProperty.call(params, 'AccountId')) return; - var accountId = params.AccountId; - //validate type - if (typeof accountId !== 'string') { - throw AWS.util.error( - new Error(), - {code: 'ValidationError', message: 'AccountId must be a string.'} - ); - } - //validate length - if (accountId.length < 1 || accountId.length > 63) { - throw AWS.util.error( - new Error(), - {code: 'ValidationError', message: 'AccountId length should be between 1 to 63 characters, inclusive.'} - ); + serviceInterface: function serviceInterface() { + switch (this.api.protocol) { + case 'ec2': return AWS.EventListeners.Query; + case 'query': return AWS.EventListeners.Query; + case 'json': return AWS.EventListeners.Json; + case 'rest-json': return AWS.EventListeners.RestJson; + case 'rest-xml': return AWS.EventListeners.RestXml; } - //validate pattern - var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; - if (!hostPattern.test(accountId)) { - throw AWS.util.error(new Error(), - {code: 'ValidationError', message: 'AccountId should be hostname compatible. AccountId: ' + accountId}); + if (this.api.protocol) { + throw new Error('Invalid service `protocol\' ' + + this.api.protocol + ' in API config'); } }, /** * @api private */ - getSigningName: function getSigningName(req) { - var _super = AWS.Service.prototype.getSigningName; - if (req && req._parsedArn && req._parsedArn.service) { - return req._parsedArn.service; - } else if (req.params.OutpostId && - (req.operation === 'createBucket' || - req.operation === 'listRegionalBuckets')) { - return 's3-outposts'; + successfulResponse: function successfulResponse(resp) { + return resp.httpResponse.statusCode < 300; + }, + + /** + * How many times a failed request should be retried before giving up. + * the defaultRetryCount can be overriden by service classes. + * + * @api private + */ + numRetries: function numRetries() { + if (this.config.maxRetries !== undefined) { + return this.config.maxRetries; } else { - return _super.call(this, req); + return this.defaultRetryCount; } }, -}); - - -/***/ }), - -/***/ 35895: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); -var regionUtil = __nccwpck_require__(18262); -var s3util = { /** * @api private */ - isArnInParam: function isArnInParam(req, paramName) { - var inputShape = (req.service.api.operations[req.operation] || {}).input || {}; - var inputMembers = inputShape.members || {}; - if (!req.params[paramName] || !inputMembers[paramName]) return false; - return AWS.util.ARN.validate(req.params[paramName]); + retryDelays: function retryDelays(retryCount, err) { + return AWS.util.calculateRetryDelay(retryCount, this.config.retryDelayOptions, err); }, /** - * Validate service component from ARN supplied in Bucket parameter + * @api private */ - validateArnService: function validateArnService(req) { - var parsedArn = req._parsedArn; - - if (parsedArn.service !== 's3' - && parsedArn.service !== 's3-outposts' - && parsedArn.service !== 's3-object-lambda') { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'expect \'s3\' or \'s3-outposts\' or \'s3-object-lambda\' in ARN service component' - }); - } + retryableError: function retryableError(error) { + if (this.timeoutError(error)) return true; + if (this.networkingError(error)) return true; + if (this.expiredCredentialsError(error)) return true; + if (this.throttledError(error)) return true; + if (error.statusCode >= 500) return true; + return false; }, /** - * Validate account ID from ARN supplied in Bucket parameter is a valid account + * @api private */ - validateArnAccount: function validateArnAccount(req) { - var parsedArn = req._parsedArn; - - if (!/[0-9]{12}/.exec(parsedArn.accountId)) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'ARN accountID does not match regex "[0-9]{12}"' - }); - } + networkingError: function networkingError(error) { + return error.code === 'NetworkingError'; }, /** - * Validate ARN supplied in Bucket parameter is a valid access point ARN + * @api private */ - validateS3AccessPointArn: function validateS3AccessPointArn(req) { - var parsedArn = req._parsedArn; - - //can be ':' or '/' - var delimiter = parsedArn.resource['accesspoint'.length]; - - if (parsedArn.resource.split(delimiter).length !== 2) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'Access Point ARN should have one resource accesspoint/{accesspointName}' - }); - } - - var accessPoint = parsedArn.resource.split(delimiter)[1]; - var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; - if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint - }); - } - - //set parsed valid access point - req._parsedArn.accessPoint = accessPoint; + timeoutError: function timeoutError(error) { + return error.code === 'TimeoutError'; }, /** - * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN + * @api private */ - validateOutpostsArn: function validateOutpostsArn(req) { - var parsedArn = req._parsedArn; - - if ( - parsedArn.resource.indexOf('outpost:') !== 0 && - parsedArn.resource.indexOf('outpost/') !== 0 - ) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'ARN resource should begin with \'outpost/\'' - }); - } - - //can be ':' or '/' - var delimiter = parsedArn.resource['outpost'.length]; - var outpostId = parsedArn.resource.split(delimiter)[1]; - var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); - if (!dnsHostRegex.test(outpostId)) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'Outpost resource in ARN is not DNS compatible. Got ' + outpostId - }); - } - req._parsedArn.outpostId = outpostId; + expiredCredentialsError: function expiredCredentialsError(error) { + // TODO : this only handles *one* of the expired credential codes + return (error.code === 'ExpiredTokenException'); }, /** - * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN + * @api private */ - validateOutpostsAccessPointArn: function validateOutpostsAccessPointArn(req) { - var parsedArn = req._parsedArn; - - //can be ':' or '/' - var delimiter = parsedArn.resource['outpost'.length]; - - if (parsedArn.resource.split(delimiter).length !== 4) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'Outposts ARN should have two resources outpost/{outpostId}/accesspoint/{accesspointName}' - }); - } - - var accessPoint = parsedArn.resource.split(delimiter)[3]; - var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; - if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint - }); + clockSkewError: function clockSkewError(error) { + switch (error.code) { + case 'RequestTimeTooSkewed': + case 'RequestExpired': + case 'InvalidSignatureException': + case 'SignatureDoesNotMatch': + case 'AuthFailure': + case 'RequestInTheFuture': + return true; + default: return false; } - - //set parsed valid access point - req._parsedArn.accessPoint = accessPoint; }, /** - * Validate region field in ARN supplied in Bucket parameter is a valid region + * @api private */ - validateArnRegion: function validateArnRegion(req, options) { - if (options === undefined) { - options = {}; - } - - var useArnRegion = s3util.loadUseArnRegionConfig(req); - var regionFromArn = req._parsedArn.region; - var clientRegion = req.service.config.region; - var useFipsEndpoint = req.service.config.useFipsEndpoint; - var allowFipsEndpoint = options.allowFipsEndpoint || false; - - if (!regionFromArn) { - var message = 'ARN region is empty'; - if (req._parsedArn.service === 's3') { - message = message + '\nYou may want to use multi-regional ARN. The feature is not supported in current SDK. ' + - 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).'; - } - throw AWS.util.error(new Error(), { - code: 'InvalidARN', - message: message - }); - } - - if (useFipsEndpoint && !allowFipsEndpoint) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'ARN endpoint is not compatible with FIPS region' - }); - } - - if (regionFromArn.indexOf('fips') >= 0) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'FIPS region not allowed in ARN' - }); - } - - if (!useArnRegion && regionFromArn !== clientRegion) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'Configured region conflicts with access point region' - }); - } else if ( - useArnRegion && - regionUtil.getEndpointSuffix(regionFromArn) !== regionUtil.getEndpointSuffix(clientRegion) - ) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'Configured region and access point region not in same partition' - }); - } + getSkewCorrectedDate: function getSkewCorrectedDate() { + return new Date(Date.now() + this.config.systemClockOffset); + }, - if (req.service.config.useAccelerateEndpoint) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'useAccelerateEndpoint config is not supported with access point ARN' - }); + /** + * @api private + */ + applyClockOffset: function applyClockOffset(newServerTime) { + if (newServerTime) { + this.config.systemClockOffset = newServerTime - Date.now(); } + }, - if (req._parsedArn.service === 's3-outposts' && req.service.config.useDualstackEndpoint) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'Dualstack is not supported with outposts access point ARN' - }); + /** + * @api private + */ + isClockSkewed: function isClockSkewed(newServerTime) { + if (newServerTime) { + return Math.abs(this.getSkewCorrectedDate().getTime() - newServerTime) >= 300000; } }, - loadUseArnRegionConfig: function loadUseArnRegionConfig(req) { - var envName = 'AWS_S3_USE_ARN_REGION'; - var configName = 's3_use_arn_region'; - var useArnRegion = true; - var originalConfig = req.service._originalConfig || {}; - if (req.service.config.s3UseArnRegion !== undefined) { - return req.service.config.s3UseArnRegion; - } else if (originalConfig.s3UseArnRegion !== undefined) { - useArnRegion = originalConfig.s3UseArnRegion === true; - } else if (AWS.util.isNode()) { - //load from environmental variable AWS_USE_ARN_REGION - if (process.env[envName]) { - var value = process.env[envName].trim().toLowerCase(); - if (['false', 'true'].indexOf(value) < 0) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: envName + ' only accepts true or false. Got ' + process.env[envName], - retryable: false - }); - } - useArnRegion = value === 'true'; - } else { //load from shared config property use_arn_region - var profiles = {}; - var profile = {}; - try { - profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); - profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; - } catch (e) {} - if (profile[configName]) { - if (['false', 'true'].indexOf(profile[configName].trim().toLowerCase()) < 0) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: configName + ' only accepts true or false. Got ' + profile[configName], - retryable: false - }); - } - useArnRegion = profile[configName].trim().toLowerCase() === 'true'; - } - } + /** + * @api private + */ + throttledError: function throttledError(error) { + // this logic varies between services + if (error.statusCode === 429) return true; + switch (error.code) { + case 'ProvisionedThroughputExceededException': + case 'Throttling': + case 'ThrottlingException': + case 'RequestLimitExceeded': + case 'RequestThrottled': + case 'RequestThrottledException': + case 'TooManyRequestsException': + case 'TransactionInProgressException': //dynamodb + case 'EC2ThrottledException': + return true; + default: + return false; } - req.service.config.s3UseArnRegion = useArnRegion; - return useArnRegion; }, /** - * Validations before URI can be populated + * @api private */ - validatePopulateUriFromArn: function validatePopulateUriFromArn(req) { - if (req.service._originalConfig && req.service._originalConfig.endpoint) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'Custom endpoint is not compatible with access point ARN' - }); - } + endpointFromTemplate: function endpointFromTemplate(endpoint) { + if (typeof endpoint !== 'string') return endpoint; - if (req.service.config.s3ForcePathStyle) { - throw AWS.util.error(new Error(), { - code: 'InvalidConfiguration', - message: 'Cannot construct path-style endpoint with access point' - }); - } + var e = endpoint; + e = e.replace(/\{service\}/g, this.api.endpointPrefix); + e = e.replace(/\{region\}/g, this.config.region); + e = e.replace(/\{scheme\}/g, this.config.sslEnabled ? 'https' : 'http'); + return e; }, /** - * Returns true if the bucket name is DNS compatible. Buckets created - * outside of the classic region MUST be DNS compatible. - * * @api private */ - dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) { - var b = bucketName; - var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/); - var ipAddress = new RegExp(/(\d+\.){3}\d+/); - var dots = new RegExp(/\.\./); - return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false; + setEndpoint: function setEndpoint(endpoint) { + this.endpoint = new AWS.Endpoint(endpoint, this.config); }, -}; - -/** - * @api private - */ -module.exports = s3util; + /** + * @api private + */ + paginationConfig: function paginationConfig(operation, throwException) { + var paginator = this.api.operations[operation].paginator; + if (!paginator) { + if (throwException) { + var e = new Error(); + throw AWS.util.error(e, 'No pagination configuration for ' + operation); + } + return null; + } -/***/ }), - -/***/ 94571: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + return paginator; + } +}); -var AWS = __nccwpck_require__(28437); +AWS.util.update(AWS.Service, { -AWS.util.update(AWS.SQS.prototype, { /** + * Adds one method for each operation described in the api configuration + * * @api private */ - setupRequestListeners: function setupRequestListeners(request) { - request.addListener('build', this.buildEndpoint); - - if (request.service.config.computeChecksums) { - if (request.operation === 'sendMessage') { - request.addListener('extractData', this.verifySendMessageChecksum); - } else if (request.operation === 'sendMessageBatch') { - request.addListener('extractData', this.verifySendMessageBatchChecksum); - } else if (request.operation === 'receiveMessage') { - request.addListener('extractData', this.verifyReceiveMessageChecksum); + defineMethods: function defineMethods(svc) { + AWS.util.each(svc.prototype.api.operations, function iterator(method) { + if (svc.prototype[method]) return; + var operation = svc.prototype.api.operations[method]; + if (operation.authtype === 'none') { + svc.prototype[method] = function (params, callback) { + return this.makeUnauthenticatedRequest(method, params, callback); + }; + } else { + svc.prototype[method] = function (params, callback) { + return this.makeRequest(method, params, callback); + }; } - } + }); }, /** - * @api private + * Defines a new Service class using a service identifier and list of versions + * including an optional set of features (functions) to apply to the class + * prototype. + * + * @param serviceIdentifier [String] the identifier for the service + * @param versions [Array] a list of versions that work with this + * service + * @param features [Object] an object to attach to the prototype + * @return [Class] the service class defined by this function. */ - verifySendMessageChecksum: function verifySendMessageChecksum(response) { - if (!response.data) return; + defineService: function defineService(serviceIdentifier, versions, features) { + AWS.Service._serviceMap[serviceIdentifier] = true; + if (!Array.isArray(versions)) { + features = versions; + versions = []; + } - var md5 = response.data.MD5OfMessageBody; - var body = this.params.MessageBody; - var calculatedMd5 = this.service.calculateChecksum(body); - if (calculatedMd5 !== md5) { - var msg = 'Got "' + response.data.MD5OfMessageBody + - '", expecting "' + calculatedMd5 + '".'; - this.service.throwInvalidChecksumError(response, - [response.data.MessageId], msg); + var svc = inherit(AWS.Service, features || {}); + + if (typeof serviceIdentifier === 'string') { + AWS.Service.addVersions(svc, versions); + + var identifier = svc.serviceIdentifier || serviceIdentifier; + svc.serviceIdentifier = identifier; + } else { // defineService called with an API + svc.prototype.api = serviceIdentifier; + AWS.Service.defineMethods(svc); + } + AWS.SequentialExecutor.call(this.prototype); + //util.clientSideMonitoring is only available in node + if (!this.prototype.publisher && AWS.util.clientSideMonitoring) { + var Publisher = AWS.util.clientSideMonitoring.Publisher; + var configProvider = AWS.util.clientSideMonitoring.configProvider; + var publisherConfig = configProvider(); + this.prototype.publisher = new Publisher(publisherConfig); + if (publisherConfig.enabled) { + //if csm is enabled in environment, SDK should send all metrics + AWS.Service._clientSideMonitoring = true; + } } + AWS.SequentialExecutor.call(svc.prototype); + AWS.Service.addDefaultMonitoringListeners(svc.prototype); + return svc; }, /** * @api private */ - verifySendMessageBatchChecksum: function verifySendMessageBatchChecksum(response) { - if (!response.data) return; + addVersions: function addVersions(svc, versions) { + if (!Array.isArray(versions)) versions = [versions]; - var service = this.service; - var entries = {}; - var errors = []; - var messageIds = []; - AWS.util.arrayEach(response.data.Successful, function (entry) { - entries[entry.Id] = entry; - }); - AWS.util.arrayEach(this.params.Entries, function (entry) { - if (entries[entry.Id]) { - var md5 = entries[entry.Id].MD5OfMessageBody; - var body = entry.MessageBody; - if (!service.isChecksumValid(md5, body)) { - errors.push(entry.Id); - messageIds.push(entries[entry.Id].MessageId); - } + svc.services = svc.services || {}; + for (var i = 0; i < versions.length; i++) { + if (svc.services[versions[i]] === undefined) { + svc.services[versions[i]] = null; } - }); - - if (errors.length > 0) { - service.throwInvalidChecksumError(response, messageIds, - 'Invalid messages: ' + errors.join(', ')); } + + svc.apiVersions = Object.keys(svc.services).sort(); }, /** * @api private */ - verifyReceiveMessageChecksum: function verifyReceiveMessageChecksum(response) { - if (!response.data) return; + defineServiceApi: function defineServiceApi(superclass, version, apiConfig) { + var svc = inherit(superclass, { + serviceIdentifier: superclass.serviceIdentifier + }); - var service = this.service; - var messageIds = []; - AWS.util.arrayEach(response.data.Messages, function(message) { - var md5 = message.MD5OfBody; - var body = message.Body; - if (!service.isChecksumValid(md5, body)) { - messageIds.push(message.MessageId); + function setApi(api) { + if (api.isApi) { + svc.prototype.api = api; + } else { + svc.prototype.api = new Api(api, { + serviceIdentifier: superclass.serviceIdentifier + }); } - }); + } - if (messageIds.length > 0) { - service.throwInvalidChecksumError(response, messageIds, - 'Invalid messages: ' + messageIds.join(', ')); + if (typeof version === 'string') { + if (apiConfig) { + setApi(apiConfig); + } else { + try { + setApi(AWS.apiLoader(superclass.serviceIdentifier, version)); + } catch (err) { + throw AWS.util.error(err, { + message: 'Could not find API configuration ' + + superclass.serviceIdentifier + '-' + version + }); + } + } + if (!Object.prototype.hasOwnProperty.call(superclass.services, version)) { + superclass.apiVersions = superclass.apiVersions.concat(version).sort(); + } + superclass.services[version] = svc; + } else { + setApi(version); } - }, - /** - * @api private - */ - throwInvalidChecksumError: function throwInvalidChecksumError(response, ids, message) { - response.error = AWS.util.error(new Error(), { - retryable: true, - code: 'InvalidChecksum', - messageIds: ids, - message: response.request.operation + - ' returned an invalid MD5 response. ' + message - }); + AWS.Service.defineMethods(svc); + return svc; }, /** * @api private */ - isChecksumValid: function isChecksumValid(checksum, data) { - return this.calculateChecksum(data) === checksum; + hasService: function(identifier) { + return Object.prototype.hasOwnProperty.call(AWS.Service._serviceMap, identifier); }, /** + * @param attachOn attach default monitoring listeners to object + * + * Each monitoring event should be emitted from service client to service constructor prototype and then + * to global service prototype like bubbling up. These default monitoring events listener will transfer + * the monitoring events to the upper layer. * @api private */ - calculateChecksum: function calculateChecksum(data) { - return AWS.util.crypto.md5(data, 'hex'); + addDefaultMonitoringListeners: function addDefaultMonitoringListeners(attachOn) { + attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) { + var baseClass = Object.getPrototypeOf(attachOn); + if (baseClass._events) baseClass.emit('apiCallAttempt', [event]); + }); + attachOn.addNamedListener('CALL_EVENTS_BUBBLE', 'apiCall', function CALL_EVENTS_BUBBLE(event) { + var baseClass = Object.getPrototypeOf(attachOn); + if (baseClass._events) baseClass.emit('apiCall', [event]); + }); }, /** * @api private */ - buildEndpoint: function buildEndpoint(request) { - var url = request.httpRequest.params.QueueUrl; - if (url) { - request.httpRequest.endpoint = new AWS.Endpoint(url); - - // signature version 4 requires the region name to be set, - // sqs queue urls contain the region name - var matches = request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./); - if (matches) request.httpRequest.region = matches[1]; - } - } + _serviceMap: {} }); +AWS.util.mixin(AWS.Service, AWS.SequentialExecutor); + +/** + * @api private + */ +module.exports = AWS.Service; + /***/ }), -/***/ 91055: +/***/ 4338: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var resolveRegionalEndpointsFlag = __nccwpck_require__(85566); -var ENV_REGIONAL_ENDPOINT_ENABLED = 'AWS_STS_REGIONAL_ENDPOINTS'; -var CONFIG_REGIONAL_ENDPOINT_ENABLED = 'sts_regional_endpoints'; - -AWS.util.update(AWS.STS.prototype, { - /** - * @overload credentialsFrom(data, credentials = null) - * Creates a credentials object from STS response data containing - * credentials information. Useful for quickly setting AWS credentials. - * - * @note This is a low-level utility function. If you want to load temporary - * credentials into your process for subsequent requests to AWS resources, - * you should use {AWS.TemporaryCredentials} instead. - * @param data [map] data retrieved from a call to {getFederatedToken}, - * {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}. - * @param credentials [AWS.Credentials] an optional credentials object to - * fill instead of creating a new object. Useful when modifying an - * existing credentials object from a refresh call. - * @return [AWS.TemporaryCredentials] the set of temporary credentials - * loaded from a raw STS operation response. - * @example Using credentialsFrom to load global AWS credentials - * var sts = new AWS.STS(); - * sts.getSessionToken(function (err, data) { - * if (err) console.log("Error getting credentials"); - * else { - * AWS.config.credentials = sts.credentialsFrom(data); - * } - * }); - * @see AWS.TemporaryCredentials - */ - credentialsFrom: function credentialsFrom(data, credentials) { - if (!data) return null; - if (!credentials) credentials = new AWS.TemporaryCredentials(); - credentials.expired = false; - credentials.accessKeyId = data.Credentials.AccessKeyId; - credentials.secretAccessKey = data.Credentials.SecretAccessKey; - credentials.sessionToken = data.Credentials.SessionToken; - credentials.expireTime = data.Credentials.Expiration; - return credentials; - }, - - assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) { - return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback); - }, - assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) { - return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback); +AWS.util.update(AWS.APIGateway.prototype, { +/** + * Sets the Accept header to application/json. + * + * @api private + */ + setAcceptHeader: function setAcceptHeader(req) { + var httpRequest = req.httpRequest; + if (!httpRequest.headers.Accept) { + httpRequest.headers['Accept'] = 'application/json'; + } }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { - request.addListener('validate', this.optInRegionalEndpoint, true); - }, - - /** - * @api private - */ - optInRegionalEndpoint: function optInRegionalEndpoint(req) { - var service = req.service; - var config = service.config; - config.stsRegionalEndpoints = resolveRegionalEndpointsFlag(service._originalConfig, { - env: ENV_REGIONAL_ENDPOINT_ENABLED, - sharedConfig: CONFIG_REGIONAL_ENDPOINT_ENABLED, - clientConfig: 'stsRegionalEndpoints' - }); - if ( - config.stsRegionalEndpoints === 'regional' && - service.isGlobalEndpoint - ) { - //client will throw if region is not supplied; request will be signed with specified region - if (!config.region) { - throw AWS.util.error(new Error(), - {code: 'ConfigError', message: 'Missing region in config'}); + request.addListener('build', this.setAcceptHeader); + if (request.operation === 'getExport') { + var params = request.params || {}; + if (params.exportType === 'swagger') { + request.addListener('extractData', AWS.util.convertPayloadToString); } - var insertPoint = config.endpoint.indexOf('.amazonaws.com'); - var regionalEndpoint = config.endpoint.substring(0, insertPoint) + - '.' + config.region + config.endpoint.substring(insertPoint); - req.httpRequest.updateEndpoint(regionalEndpoint); - req.httpRequest.region = config.region; } } - }); + /***/ }), -/***/ 31987: +/***/ 95483: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -AWS.util.hideProperties(AWS, ['SimpleWorkflow']); - -/** - * @constant - * @readonly - * Backwards compatibility for access to the {AWS.SWF} service class. - */ -AWS.SimpleWorkflow = AWS.SWF; - +// pull in CloudFront signer +__nccwpck_require__(93260); -/***/ }), +AWS.util.update(AWS.CloudFront.prototype, { -/***/ 29697: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + setupRequestListeners: function setupRequestListeners(request) { + request.addListener('extractData', AWS.util.hoistPayloadMember); + } -var IniLoader = (__nccwpck_require__(95417).IniLoader); -/** - * Singleton object to load specified config/credentials files. - * It will cache all the files ever loaded; - */ -module.exports.b = new IniLoader(); +}); /***/ }), -/***/ 95417: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 48571: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var os = __nccwpck_require__(22037); -var path = __nccwpck_require__(71017); - -function parseFile(filename) { - return AWS.util.ini.parse(AWS.util.readFileSync(filename)); -} - -function getProfiles(fileContent) { - var tmpContent = {}; - Object.keys(fileContent).forEach(function(sectionName) { - if (/^sso-session\s/.test(sectionName)) return; - Object.defineProperty(tmpContent, sectionName.replace(/^profile\s/, ''), { - value: fileContent[sectionName], - enumerable: true - }); - }); - return tmpContent; -} - -function getSsoSessions(fileContent) { - var tmpContent = {}; - Object.keys(fileContent).forEach(function(sectionName) { - if (!/^sso-session\s/.test(sectionName)) return; - Object.defineProperty(tmpContent, sectionName.replace(/^sso-session\s/, ''), { - value: fileContent[sectionName], - enumerable: true - }); - }); - return tmpContent; -} /** - * Ini file loader class the same as that used in the SDK. It loads and - * parses config and credentials files in .ini format and cache the content - * to assure files are only read once. - * Note that calling operations on the instance instantiated from this class - * won't affect the behavior of SDK since SDK uses an internal singleton of - * this class. - * @!macro nobrowser + * Constructs a service interface object. Each API operation is exposed as a + * function on service. + * + * ### Sending a Request Using CloudSearchDomain + * + * ```javascript + * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); + * csd.search(params, function (err, data) { + * if (err) console.log(err, err.stack); // an error occurred + * else console.log(data); // successful response + * }); + * ``` + * + * ### Locking the API Version + * + * In order to ensure that the CloudSearchDomain object uses this specific API, + * you can construct the object by passing the `apiVersion` option to the + * constructor: + * + * ```javascript + * var csd = new AWS.CloudSearchDomain({ + * endpoint: 'my.host.tld', + * apiVersion: '2013-01-01' + * }); + * ``` + * + * You can also set the API version globally in `AWS.config.apiVersions` using + * the **cloudsearchdomain** service identifier: + * + * ```javascript + * AWS.config.apiVersions = { + * cloudsearchdomain: '2013-01-01', + * // other service API versions + * }; + * + * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); + * ``` + * + * @note You *must* provide an `endpoint` configuration parameter when + * constructing this service. See {constructor} for more information. + * + * @!method constructor(options = {}) + * Constructs a service object. This object has one method for each + * API operation. + * + * @example Constructing a CloudSearchDomain object + * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); + * @note You *must* provide an `endpoint` when constructing this service. + * @option (see AWS.Config.constructor) + * + * @service cloudsearchdomain + * @version 2013-01-01 */ -AWS.IniLoader = AWS.util.inherit({ - constructor: function IniLoader() { - this.resolvedProfiles = {}; - this.resolvedSsoSessions = {}; - }, - - /** Remove all cached files. Used after config files are updated. */ - clearCachedFiles: function clearCachedFiles() { - this.resolvedProfiles = {}; - this.resolvedSsoSessions = {}; - }, - +AWS.util.update(AWS.CloudSearchDomain.prototype, { /** - * Load configurations from config/credentials files and cache them - * for later use. If no file is specified it will try to load default files. - * - * @param options [map] information describing the file - * @option options filename [String] ('~/.aws/credentials' or defined by - * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if - * isConfig is set to true) - * path to the file to be read. - * @option options isConfig [Boolean] (false) True to read config file. - * @return [map] object containing contents from file in key-value - * pairs. + * @api private */ - loadFrom: function loadFrom(options) { - options = options || {}; - var isConfig = options.isConfig === true; - var filename = options.filename || this.getDefaultFilePath(isConfig); - if (!this.resolvedProfiles[filename]) { - var fileContent = parseFile(filename); - if (isConfig) { - Object.defineProperty(this.resolvedProfiles, filename, { - value: getProfiles(fileContent) - }); - } else { - Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent }); - } + validateService: function validateService() { + if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { + var msg = 'AWS.CloudSearchDomain requires an explicit ' + + '`endpoint\' configuration option.'; + throw AWS.util.error(new Error(), + {name: 'InvalidEndpoint', message: msg}); } - return this.resolvedProfiles[filename]; }, /** - * Load sso sessions from config/credentials files and cache them - * for later use. If no file is specified it will try to load default file. - * - * @param options [map] information describing the file - * @option options filename [String] ('~/.aws/config' or defined by - * AWS_CONFIG_FILE process env var) - * @return [map] object containing contents from file in key-value - * pairs. + * @api private */ - loadSsoSessionsFrom: function loadSsoSessionsFrom(options) { - options = options || {}; - var filename = options.filename || this.getDefaultFilePath(true); - if (!this.resolvedSsoSessions[filename]) { - var fileContent = parseFile(filename); - Object.defineProperty(this.resolvedSsoSessions, filename, { - value: getSsoSessions(fileContent) - }); + setupRequestListeners: function setupRequestListeners(request) { + request.removeListener('validate', + AWS.EventListeners.Core.VALIDATE_CREDENTIALS + ); + request.onAsync('validate', this.validateCredentials); + request.addListener('validate', this.updateRegion); + if (request.operation === 'search') { + request.addListener('build', this.convertGetToPost); } - return this.resolvedSsoSessions[filename]; }, /** * @api private */ - getDefaultFilePath: function getDefaultFilePath(isConfig) { - return path.join( - this.getHomeDir(), - '.aws', - isConfig ? 'config' : 'credentials' - ); + validateCredentials: function(req, done) { + if (!req.service.api.signatureVersion) return done(); // none + req.service.config.getCredentials(function(err) { + if (err) { + req.removeListener('sign', AWS.EventListeners.Core.SIGN); + } + done(); + }); }, /** * @api private */ - getHomeDir: function getHomeDir() { - var env = process.env; - var home = env.HOME || - env.USERPROFILE || - (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null); - - if (home) { - return home; - } - - if (typeof os.homedir === 'function') { - return os.homedir(); + convertGetToPost: function(request) { + var httpRequest = request.httpRequest; + if (httpRequest.method === 'POST') { + return; } + // convert queries to POST to avoid length restrictions + var path = httpRequest.path.split('?'); + httpRequest.method = 'POST'; + httpRequest.path = path[0]; + httpRequest.body = path[1]; + httpRequest.headers['Content-Length'] = httpRequest.body.length; + httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded'; + }, - throw AWS.util.error( - new Error('Cannot load credentials, HOME path not set') - ); + /** + * @api private + */ + updateRegion: function updateRegion(request) { + var endpoint = request.httpRequest.endpoint.hostname; + var zones = endpoint.split('.'); + request.httpRequest.region = zones[1] || request.httpRequest.region; } -}); - -var IniLoader = AWS.IniLoader; -module.exports = { - IniLoader: IniLoader -}; +}); /***/ }), -/***/ 98382: +/***/ 59050: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); +var rdsutil = __nccwpck_require__(30650); /** - * @api private - */ -AWS.Signers.Bearer = AWS.util.inherit(AWS.Signers.RequestSigner, { - constructor: function Bearer(request) { - AWS.Signers.RequestSigner.call(this, request); - }, +* @api private +*/ +var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; - addAuthorization: function addAuthorization(token) { - this.request.headers['Authorization'] = 'Bearer ' + token.token; - } +AWS.util.update(AWS.DocDB.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + if ( + crossRegionOperations.indexOf(request.operation) !== -1 && + this.config.params && + this.config.params.SourceRegion && + request.params && + !request.params.SourceRegion + ) { + request.params.SourceRegion = this.config.params.SourceRegion; + } + rdsutil.setupRequestListeners(this, request, crossRegionOperations); + }, }); /***/ }), -/***/ 60328: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 17101: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; - -/** - * @api private - */ -var expiresHeader = 'presigned-expires'; - -/** - * @api private - */ -function signedUrlBuilder(request) { - var expires = request.httpRequest.headers[expiresHeader]; - var signerClass = request.service.getSignerClass(request); - - delete request.httpRequest.headers['User-Agent']; - delete request.httpRequest.headers['X-Amz-User-Agent']; - - if (signerClass === AWS.Signers.V4) { - if (expires > 604800) { // one week expiry is invalid - var message = 'Presigning does not support expiry time greater ' + - 'than a week with SigV4 signing.'; - throw AWS.util.error(new Error(), { - code: 'InvalidExpiryTime', message: message, retryable: false - }); - } - request.httpRequest.headers[expiresHeader] = expires; - } else if (signerClass === AWS.Signers.S3) { - var now = request.service ? request.service.getSkewCorrectedDate() : AWS.util.date.getDate(); - request.httpRequest.headers[expiresHeader] = parseInt( - AWS.util.date.unixTimestamp(now) + expires, 10).toString(); - } else { - throw AWS.util.error(new Error(), { - message: 'Presigning only supports S3 or SigV4 signing.', - code: 'UnsupportedSigner', retryable: false - }); - } -} - -/** - * @api private - */ -function signedUrlSigner(request) { - var endpoint = request.httpRequest.endpoint; - var parsedUrl = AWS.util.urlParse(request.httpRequest.path); - var queryParams = {}; - - if (parsedUrl.search) { - queryParams = AWS.util.queryStringParse(parsedUrl.search.substr(1)); - } - - var auth = request.httpRequest.headers['Authorization'].split(' '); - if (auth[0] === 'AWS') { - auth = auth[1].split(':'); - queryParams['Signature'] = auth.pop(); - queryParams['AWSAccessKeyId'] = auth.join(':'); +__nccwpck_require__(90030); - AWS.util.each(request.httpRequest.headers, function (key, value) { - if (key === expiresHeader) key = 'Expires'; - if (key.indexOf('x-amz-meta-') === 0) { - // Delete existing, potentially not normalized key - delete queryParams[key]; - key = key.toLowerCase(); - } - queryParams[key] = value; - }); - delete request.httpRequest.headers[expiresHeader]; - delete queryParams['Authorization']; - delete queryParams['Host']; - } else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing - auth.shift(); - var rest = auth.join(' '); - var signature = rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1]; - queryParams['X-Amz-Signature'] = signature; - delete queryParams['Expires']; - } +AWS.util.update(AWS.DynamoDB.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + if (request.service.config.dynamoDbCrc32) { + request.removeListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); + request.addListener('extractData', this.checkCrc32); + request.addListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); + } + }, - // build URL - endpoint.pathname = parsedUrl.pathname; - endpoint.search = AWS.util.queryParamsToString(queryParams); -} + /** + * @api private + */ + checkCrc32: function checkCrc32(resp) { + if (!resp.httpResponse.streaming && !resp.request.service.crc32IsValid(resp)) { + resp.data = null; + resp.error = AWS.util.error(new Error(), { + code: 'CRC32CheckFailed', + message: 'CRC32 integrity check failed', + retryable: true + }); + resp.request.haltHandlersOnError(); + throw (resp.error); + } + }, -/** - * @api private - */ -AWS.Signers.Presign = inherit({ /** * @api private */ - sign: function sign(request, expireTime, callback) { - request.httpRequest.headers[expiresHeader] = expireTime || 3600; - request.on('build', signedUrlBuilder); - request.on('sign', signedUrlSigner); - request.removeListener('afterBuild', - AWS.EventListeners.Core.SET_CONTENT_LENGTH); - request.removeListener('afterBuild', - AWS.EventListeners.Core.COMPUTE_SHA256); + crc32IsValid: function crc32IsValid(resp) { + var crc = resp.httpResponse.headers['x-amz-crc32']; + if (!crc) return true; // no (valid) CRC32 header + return parseInt(crc, 10) === AWS.util.crypto.crc32(resp.httpResponse.body); + }, - request.emit('beforePresign', [request]); + /** + * @api private + */ + defaultRetryCount: 10, - if (callback) { - request.build(function() { - if (this.response.error) callback(this.response.error); - else { - callback(null, AWS.util.urlFormat(request.httpRequest.endpoint)); - } - }); - } else { - request.build(); - if (request.response.error) throw request.response.error; - return AWS.util.urlFormat(request.httpRequest.endpoint); + /** + * @api private + */ + retryDelays: function retryDelays(retryCount, err) { + var retryDelayOptions = AWS.util.copy(this.config.retryDelayOptions); + + if (typeof retryDelayOptions.base !== 'number') { + retryDelayOptions.base = 50; // default for dynamodb } + var delay = AWS.util.calculateRetryDelay(retryCount, retryDelayOptions, err); + return delay; } }); -/** - * @api private - */ -module.exports = AWS.Signers.Presign; - /***/ }), -/***/ 9897: +/***/ 92501: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; +AWS.util.update(AWS.EC2.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + request.removeListener('extractError', AWS.EventListeners.Query.EXTRACT_ERROR); + request.addListener('extractError', this.extractError); -/** - * @api private - */ -AWS.Signers.RequestSigner = inherit({ - constructor: function RequestSigner(request) { - this.request = request; + if (request.operation === 'copySnapshot') { + request.onAsync('validate', this.buildCopySnapshotPresignedUrl); + } }, - setServiceClientId: function setServiceClientId(id) { - this.serviceClientId = id; + /** + * @api private + */ + buildCopySnapshotPresignedUrl: function buildCopySnapshotPresignedUrl(req, done) { + if (req.params.PresignedUrl || req._subRequest) { + return done(); + } + + req.params = AWS.util.copy(req.params); + req.params.DestinationRegion = req.service.config.region; + + var config = AWS.util.copy(req.service.config); + delete config.endpoint; + config.region = req.params.SourceRegion; + var svc = new req.service.constructor(config); + var newReq = svc[req.operation](req.params); + newReq._subRequest = true; + newReq.presign(function(err, url) { + if (err) done(err); + else { + req.params.PresignedUrl = url; + done(); + } + }); }, - getServiceClientId: function getServiceClientId() { - return this.serviceClientId; + /** + * @api private + */ + extractError: function extractError(resp) { + // EC2 nests the error code and message deeper than other AWS Query services. + var httpResponse = resp.httpResponse; + var data = new AWS.XML.Parser().parse(httpResponse.body.toString() || ''); + if (data.Errors) { + resp.error = AWS.util.error(new Error(), { + code: data.Errors.Error.Code, + message: data.Errors.Error.Message + }); + } else { + resp.error = AWS.util.error(new Error(), { + code: httpResponse.statusCode, + message: null + }); + } + resp.error.requestId = data.RequestID || null; } }); -AWS.Signers.RequestSigner.getVersion = function getVersion(version) { - switch (version) { - case 'v2': return AWS.Signers.V2; - case 'v3': return AWS.Signers.V3; - case 's3v4': return AWS.Signers.V4; - case 'v4': return AWS.Signers.V4; - case 's3': return AWS.Signers.S3; - case 'v3https': return AWS.Signers.V3Https; - case 'bearer': return AWS.Signers.Bearer; - } - throw new Error('Unknown signing version ' + version); -}; - -__nccwpck_require__(28489); -__nccwpck_require__(66458); -__nccwpck_require__(24473); -__nccwpck_require__(26529); -__nccwpck_require__(58616); -__nccwpck_require__(60328); -__nccwpck_require__(98382); - /***/ }), -/***/ 58616: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 3034: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; -/** - * @api private - */ -AWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, { +AWS.util.update(AWS.EventBridge.prototype, { /** - * When building the stringToSign, these sub resource params should be - * part of the canonical resource string with their NON-decoded values + * @api private */ - subResources: { - 'acl': 1, - 'accelerate': 1, - 'analytics': 1, - 'cors': 1, - 'lifecycle': 1, - 'delete': 1, - 'inventory': 1, - 'location': 1, - 'logging': 1, - 'metrics': 1, - 'notification': 1, - 'partNumber': 1, - 'policy': 1, - 'requestPayment': 1, - 'replication': 1, - 'restore': 1, - 'tagging': 1, - 'torrent': 1, - 'uploadId': 1, - 'uploads': 1, - 'versionId': 1, - 'versioning': 1, - 'versions': 1, - 'website': 1 + setupRequestListeners: function setupRequestListeners(request) { + if (request.operation === 'putEvents') { + var params = request.params || {}; + if (params.EndpointId !== undefined) { + throw new AWS.util.error(new Error(), { + code: 'InvalidParameter', + message: 'EndpointId is not supported in current SDK.\n' + + 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).' + }); + } + } }, +}); - // when building the stringToSign, these querystring params should be - // part of the canonical resource string with their NON-encoded values - responseHeaders: { - 'response-content-type': 1, - 'response-content-language': 1, - 'response-expires': 1, - 'response-cache-control': 1, - 'response-content-disposition': 1, - 'response-content-encoding': 1 - }, - addAuthorization: function addAuthorization(credentials, date) { - if (!this.request.headers['presigned-expires']) { - this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date); - } +/***/ }), - if (credentials.sessionToken) { - // presigned URLs require this header to be lowercased - this.request.headers['x-amz-security-token'] = credentials.sessionToken; - } +/***/ 14472: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - var signature = this.sign(credentials.secretAccessKey, this.stringToSign()); - var auth = 'AWS ' + credentials.accessKeyId + ':' + signature; +var AWS = __nccwpck_require__(28437); - this.request.headers['Authorization'] = auth; +AWS.util.update(AWS.Glacier.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + if (Array.isArray(request._events.validate)) { + request._events.validate.unshift(this.validateAccountId); + } else { + request.on('validate', this.validateAccountId); + } + request.removeListener('afterBuild', + AWS.EventListeners.Core.COMPUTE_SHA256); + request.on('build', this.addGlacierApiVersion); + request.on('build', this.addTreeHashHeaders); }, - stringToSign: function stringToSign() { - var r = this.request; - - var parts = []; - parts.push(r.method); - parts.push(r.headers['Content-MD5'] || ''); - parts.push(r.headers['Content-Type'] || ''); + /** + * @api private + */ + validateAccountId: function validateAccountId(request) { + if (request.params.accountId !== undefined) return; + request.params = AWS.util.copy(request.params); + request.params.accountId = '-'; + }, - // This is the "Date" header, but we use X-Amz-Date. - // The S3 signing mechanism requires us to pass an empty - // string for this Date header regardless. - parts.push(r.headers['presigned-expires'] || ''); + /** + * @api private + */ + addGlacierApiVersion: function addGlacierApiVersion(request) { + var version = request.service.api.apiVersion; + request.httpRequest.headers['x-amz-glacier-version'] = version; + }, - var headers = this.canonicalizedAmzHeaders(); - if (headers) parts.push(headers); - parts.push(this.canonicalizedResource()); + /** + * @api private + */ + addTreeHashHeaders: function addTreeHashHeaders(request) { + if (request.params.body === undefined) return; - return parts.join('\n'); + var hashes = request.service.computeChecksums(request.params.body); + request.httpRequest.headers['X-Amz-Content-Sha256'] = hashes.linearHash; + if (!request.httpRequest.headers['x-amz-sha256-tree-hash']) { + request.httpRequest.headers['x-amz-sha256-tree-hash'] = hashes.treeHash; + } }, - canonicalizedAmzHeaders: function canonicalizedAmzHeaders() { - - var amzHeaders = []; - - AWS.util.each(this.request.headers, function (name) { - if (name.match(/^x-amz-/i)) - amzHeaders.push(name); - }); + /** + * @!group Computing Checksums + */ - amzHeaders.sort(function (a, b) { - return a.toLowerCase() < b.toLowerCase() ? -1 : 1; - }); + /** + * Computes the SHA-256 linear and tree hash checksums for a given + * block of Buffer data. Pass the tree hash of the computed checksums + * as the checksum input to the {completeMultipartUpload} when performing + * a multi-part upload. + * + * @example Calculate checksum of 5.5MB data chunk + * var glacier = new AWS.Glacier(); + * var data = Buffer.alloc(5.5 * 1024 * 1024); + * data.fill('0'); // fill with zeros + * var results = glacier.computeChecksums(data); + * // Result: { linearHash: '68aff0c5a9...', treeHash: '154e26c78f...' } + * @param data [Buffer, String] data to calculate the checksum for + * @return [map] a map containing + * the linearHash and treeHash properties representing hex based digests + * of the respective checksums. + * @see completeMultipartUpload + */ + computeChecksums: function computeChecksums(data) { + if (!AWS.util.Buffer.isBuffer(data)) data = AWS.util.buffer.toBuffer(data); - var parts = []; - AWS.util.arrayEach.call(this, amzHeaders, function (name) { - parts.push(name.toLowerCase() + ':' + String(this.request.headers[name])); - }); + var mb = 1024 * 1024; + var hashes = []; + var hash = AWS.util.crypto.createHash('sha256'); - return parts.join('\n'); + // build leaf nodes in 1mb chunks + for (var i = 0; i < data.length; i += mb) { + var chunk = data.slice(i, Math.min(i + mb, data.length)); + hash.update(chunk); + hashes.push(AWS.util.crypto.sha256(chunk)); + } + return { + linearHash: hash.digest('hex'), + treeHash: this.buildHashTree(hashes) + }; }, - canonicalizedResource: function canonicalizedResource() { + /** + * @api private + */ + buildHashTree: function buildHashTree(hashes) { + // merge leaf nodes + while (hashes.length > 1) { + var tmpHashes = []; + for (var i = 0; i < hashes.length; i += 2) { + if (hashes[i + 1]) { + var tmpHash = AWS.util.buffer.alloc(64); + tmpHash.write(hashes[i], 0, 32, 'binary'); + tmpHash.write(hashes[i + 1], 32, 32, 'binary'); + tmpHashes.push(AWS.util.crypto.sha256(tmpHash)); + } else { + tmpHashes.push(hashes[i]); + } + } + hashes = tmpHashes; + } - var r = this.request; + return AWS.util.crypto.toHex(hashes[0]); + } +}); - var parts = r.path.split('?'); - var path = parts[0]; - var querystring = parts[1]; - var resource = ''; +/***/ }), - if (r.virtualHostedBucket) - resource += '/' + r.virtualHostedBucket; +/***/ 27062: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - resource += path; +var AWS = __nccwpck_require__(28437); - if (querystring) { +/** + * @api private + */ +var blobPayloadOutputOps = [ + 'deleteThingShadow', + 'getThingShadow', + 'updateThingShadow' +]; - // collect a list of sub resources and query params that need to be signed - var resources = []; +/** + * Constructs a service interface object. Each API operation is exposed as a + * function on service. + * + * ### Sending a Request Using IotData + * + * ```javascript + * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); + * iotdata.getThingShadow(params, function (err, data) { + * if (err) console.log(err, err.stack); // an error occurred + * else console.log(data); // successful response + * }); + * ``` + * + * ### Locking the API Version + * + * In order to ensure that the IotData object uses this specific API, + * you can construct the object by passing the `apiVersion` option to the + * constructor: + * + * ```javascript + * var iotdata = new AWS.IotData({ + * endpoint: 'my.host.tld', + * apiVersion: '2015-05-28' + * }); + * ``` + * + * You can also set the API version globally in `AWS.config.apiVersions` using + * the **iotdata** service identifier: + * + * ```javascript + * AWS.config.apiVersions = { + * iotdata: '2015-05-28', + * // other service API versions + * }; + * + * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); + * ``` + * + * @note You *must* provide an `endpoint` configuration parameter when + * constructing this service. See {constructor} for more information. + * + * @!method constructor(options = {}) + * Constructs a service object. This object has one method for each + * API operation. + * + * @example Constructing a IotData object + * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); + * @note You *must* provide an `endpoint` when constructing this service. + * @option (see AWS.Config.constructor) + * + * @service iotdata + * @version 2015-05-28 + */ +AWS.util.update(AWS.IotData.prototype, { + /** + * @api private + */ + validateService: function validateService() { + if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { + var msg = 'AWS.IotData requires an explicit ' + + '`endpoint\' configuration option.'; + throw AWS.util.error(new Error(), + {name: 'InvalidEndpoint', message: msg}); + } + }, - AWS.util.arrayEach.call(this, querystring.split('&'), function (param) { - var name = param.split('=')[0]; - var value = param.split('=')[1]; - if (this.subResources[name] || this.responseHeaders[name]) { - var subresource = { name: name }; - if (value !== undefined) { - if (this.subResources[name]) { - subresource.value = value; - } else { - subresource.value = decodeURIComponent(value); - } - } - resources.push(subresource); + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + request.addListener('validateResponse', this.validateResponseBody); + if (blobPayloadOutputOps.indexOf(request.operation) > -1) { + request.addListener('extractData', AWS.util.convertPayloadToString); } - }); + }, - resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; }); + /** + * @api private + */ + validateResponseBody: function validateResponseBody(resp) { + var body = resp.httpResponse.body.toString() || '{}'; + var bodyCheck = body.trim(); + if (!bodyCheck || bodyCheck.charAt(0) !== '{') { + resp.httpResponse.body = ''; + } + } - if (resources.length) { +}); - querystring = []; - AWS.util.arrayEach(resources, function (res) { - if (res.value === undefined) { - querystring.push(res.name); - } else { - querystring.push(res.name + '=' + res.value); - } - }); - resource += '?' + querystring.join('&'); - } +/***/ }), + +/***/ 8452: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +AWS.util.update(AWS.Lambda.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + if (request.operation === 'invoke') { + request.addListener('extractData', AWS.util.convertPayloadToString); + } + } +}); + - } - return resource; +/***/ }), + +/***/ 19174: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +AWS.util.update(AWS.MachineLearning.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + if (request.operation === 'predict') { + request.addListener('build', this.buildEndpoint); + } }, - sign: function sign(secret, string) { - return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1'); + /** + * Updates request endpoint from PredictEndpoint + * @api private + */ + buildEndpoint: function buildEndpoint(request) { + var url = request.params.PredictEndpoint; + if (url) { + request.httpRequest.endpoint = new AWS.Endpoint(url); + } } -}); -/** - * @api private - */ -module.exports = AWS.Signers.S3; +}); /***/ }), -/***/ 28489: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 73090: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; +var rdsutil = __nccwpck_require__(30650); /** - * @api private - */ -AWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, { - addAuthorization: function addAuthorization(credentials, date) { +* @api private +*/ +var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; - if (!date) date = AWS.util.date.getDate(); +AWS.util.update(AWS.Neptune.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + if ( + crossRegionOperations.indexOf(request.operation) !== -1 && + this.config.params && + this.config.params.SourceRegion && + request.params && + !request.params.SourceRegion + ) { + request.params.SourceRegion = this.config.params.SourceRegion; + } + rdsutil.setupRequestListeners(this, request, crossRegionOperations); + }, +}); - var r = this.request; - r.params.Timestamp = AWS.util.date.iso8601(date); - r.params.SignatureVersion = '2'; - r.params.SignatureMethod = 'HmacSHA256'; - r.params.AWSAccessKeyId = credentials.accessKeyId; +/***/ }), - if (credentials.sessionToken) { - r.params.SecurityToken = credentials.sessionToken; - } +/***/ 53199: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - delete r.params.Signature; // delete old Signature for re-signing - r.params.Signature = this.signature(credentials); +__nccwpck_require__(44086); - r.body = AWS.util.queryParamsToString(r.params); - r.headers['Content-Length'] = r.body.length; - }, - signature: function signature(credentials) { - return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); - }, +/***/ }), - stringToSign: function stringToSign() { - var parts = []; - parts.push(this.request.method); - parts.push(this.request.endpoint.host.toLowerCase()); - parts.push(this.request.pathname()); - parts.push(AWS.util.queryParamsToString(this.request.params)); - return parts.join('\n'); - } +/***/ 71928: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -}); +var AWS = __nccwpck_require__(28437); +var rdsutil = __nccwpck_require__(30650); +__nccwpck_require__(16612); + /** + * @api private + */ + var crossRegionOperations = ['copyDBSnapshot', 'createDBInstanceReadReplica', 'createDBCluster', 'copyDBClusterSnapshot', 'startDBInstanceAutomatedBackupsReplication']; -/** - * @api private - */ -module.exports = AWS.Signers.V2; + AWS.util.update(AWS.RDS.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + rdsutil.setupRequestListeners(this, request, crossRegionOperations); + }, + }); /***/ }), -/***/ 66458: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 64070: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; - -/** - * @api private - */ -AWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, { - addAuthorization: function addAuthorization(credentials, date) { - var datetime = AWS.util.date.rfc822(date); +AWS.util.update(AWS.RDSDataService.prototype, { + /** + * @return [Boolean] whether the error can be retried + * @api private + */ + retryableError: function retryableError(error) { + if (error.code === 'BadRequestException' && + error.message && + error.message.match(/^Communications link failure/) && + error.statusCode === 400) { + return true; + } else { + var _super = AWS.Service.prototype.retryableError; + return _super.call(this, error); + } + } +}); - this.request.headers['X-Amz-Date'] = datetime; - if (credentials.sessionToken) { - this.request.headers['x-amz-security-token'] = credentials.sessionToken; - } +/***/ }), - this.request.headers['X-Amzn-Authorization'] = - this.authorization(credentials, datetime); +/***/ 30650: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - }, +var AWS = __nccwpck_require__(28437); - authorization: function authorization(credentials) { - return 'AWS3 ' + - 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + - 'Algorithm=HmacSHA256,' + - 'SignedHeaders=' + this.signedHeaders() + ',' + - 'Signature=' + this.signature(credentials); +var rdsutil = { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(service, request, crossRegionOperations) { + if (crossRegionOperations.indexOf(request.operation) !== -1 && + request.params.SourceRegion) { + request.params = AWS.util.copy(request.params); + if (request.params.PreSignedUrl || + request.params.SourceRegion === service.config.region) { + delete request.params.SourceRegion; + } else { + var doesParamValidation = !!service.config.paramValidation; + // remove the validate parameters listener so we can re-add it after we build the URL + if (doesParamValidation) { + request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); + } + request.onAsync('validate', rdsutil.buildCrossRegionPresignedUrl); + if (doesParamValidation) { + request.addListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); + } + } + } }, - signedHeaders: function signedHeaders() { - var headers = []; - AWS.util.arrayEach(this.headersToSign(), function iterator(h) { - headers.push(h.toLowerCase()); - }); - return headers.sort().join(';'); - }, + /** + * @api private + */ + buildCrossRegionPresignedUrl: function buildCrossRegionPresignedUrl(req, done) { + var config = AWS.util.copy(req.service.config); + config.region = req.params.SourceRegion; + delete req.params.SourceRegion; + delete config.endpoint; + // relevant params for the operation will already be in req.params + delete config.params; + config.signatureVersion = 'v4'; + var destinationRegion = req.service.config.region; - canonicalHeaders: function canonicalHeaders() { - var headers = this.request.headers; - var parts = []; - AWS.util.arrayEach(this.headersToSign(), function iterator(h) { - parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim()); + var svc = new req.service.constructor(config); + var newReq = svc[req.operation](AWS.util.copy(req.params)); + newReq.on('build', function addDestinationRegionParam(request) { + var httpRequest = request.httpRequest; + httpRequest.params.DestinationRegion = destinationRegion; + httpRequest.body = AWS.util.queryParamsToString(httpRequest.params); }); - return parts.sort().join('\n') + '\n'; - }, - - headersToSign: function headersToSign() { - var headers = []; - AWS.util.each(this.request.headers, function iterator(k) { - if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) { - headers.push(k); + newReq.presign(function(err, url) { + if (err) done(err); + else { + req.params.PreSignedUrl = url; + done(); } }); - return headers; - }, - - signature: function signature(credentials) { - return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); - }, - - stringToSign: function stringToSign() { - var parts = []; - parts.push(this.request.method); - parts.push('/'); - parts.push(''); - parts.push(this.canonicalHeaders()); - parts.push(this.request.body); - return AWS.util.crypto.sha256(parts.join('\n')); } - -}); +}; /** * @api private */ -module.exports = AWS.Signers.V3; +module.exports = rdsutil; /***/ }), -/***/ 24473: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 69627: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var inherit = AWS.util.inherit; -__nccwpck_require__(66458); +AWS.util.update(AWS.Route53.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + request.on('build', this.sanitizeUrl); + }, -/** - * @api private - */ -AWS.Signers.V3Https = inherit(AWS.Signers.V3, { - authorization: function authorization(credentials) { - return 'AWS3-HTTPS ' + - 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + - 'Algorithm=HmacSHA256,' + - 'Signature=' + this.signature(credentials); + /** + * @api private + */ + sanitizeUrl: function sanitizeUrl(request) { + var path = request.httpRequest.path; + request.httpRequest.path = path.replace(/\/%2F\w+%2F/, '/'); }, - stringToSign: function stringToSign() { - return this.request.headers['X-Amz-Date']; + /** + * @return [Boolean] whether the error can be retried + * @api private + */ + retryableError: function retryableError(error) { + if (error.code === 'PriorRequestNotComplete' && + error.statusCode === 400) { + return true; + } else { + var _super = AWS.Service.prototype.retryableError; + return _super.call(this, error); + } } }); -/** - * @api private - */ -module.exports = AWS.Signers.V3Https; - /***/ }), -/***/ 26529: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 26543: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); var v4Credentials = __nccwpck_require__(62660); -var inherit = AWS.util.inherit; +var resolveRegionalEndpointsFlag = __nccwpck_require__(85566); +var s3util = __nccwpck_require__(35895); +var regionUtil = __nccwpck_require__(18262); + +// Pull in managed upload extension +__nccwpck_require__(81600); /** * @api private */ -var expiresHeader = 'presigned-expires'; +var operationsWith200StatusCodeError = { + 'completeMultipartUpload': true, + 'copyObject': true, + 'uploadPartCopy': true +}; /** * @api private */ -AWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, { - constructor: function V4(request, serviceName, options) { - AWS.Signers.RequestSigner.call(this, request); - this.serviceName = serviceName; - options = options || {}; - this.signatureCache = typeof options.signatureCache === 'boolean' ? options.signatureCache : true; - this.operation = options.operation; - this.signatureVersion = options.signatureVersion; - }, - - algorithm: 'AWS4-HMAC-SHA256', + var regionRedirectErrorCodes = [ + 'AuthorizationHeaderMalformed', // non-head operations on virtual-hosted global bucket endpoints + 'BadRequest', // head operations on virtual-hosted global bucket endpoints + 'PermanentRedirect', // non-head operations on path-style or regional endpoints + 301 // head operations on path-style or regional endpoints + ]; - addAuthorization: function addAuthorization(credentials, date) { - var datetime = AWS.util.date.iso8601(date).replace(/[:\-]|\.\d{3}/g, ''); +var OBJECT_LAMBDA_SERVICE = 's3-object-lambda'; - if (this.isPresigned()) { - this.updateForPresigned(credentials, datetime); - } else { - this.addHeaders(credentials, datetime); +AWS.util.update(AWS.S3.prototype, { + /** + * @api private + */ + getSignatureVersion: function getSignatureVersion(request) { + var defaultApiVersion = this.api.signatureVersion; + var userDefinedVersion = this._originalConfig ? this._originalConfig.signatureVersion : null; + var regionDefinedVersion = this.config.signatureVersion; + var isPresigned = request ? request.isPresigned() : false; + /* + 1) User defined version specified: + a) always return user defined version + 2) No user defined version specified: + a) If not using presigned urls, default to V4 + b) If using presigned urls, default to lowest version the region supports + */ + if (userDefinedVersion) { + userDefinedVersion = userDefinedVersion === 'v2' ? 's3' : userDefinedVersion; + return userDefinedVersion; } - - this.request.headers['Authorization'] = - this.authorization(credentials, datetime); - }, - - addHeaders: function addHeaders(credentials, datetime) { - this.request.headers['X-Amz-Date'] = datetime; - if (credentials.sessionToken) { - this.request.headers['x-amz-security-token'] = credentials.sessionToken; + if (isPresigned !== true) { + defaultApiVersion = 'v4'; + } else if (regionDefinedVersion) { + defaultApiVersion = regionDefinedVersion; } + return defaultApiVersion; }, - updateForPresigned: function updateForPresigned(credentials, datetime) { - var credString = this.credentialString(datetime); - var qs = { - 'X-Amz-Date': datetime, - 'X-Amz-Algorithm': this.algorithm, - 'X-Amz-Credential': credentials.accessKeyId + '/' + credString, - 'X-Amz-Expires': this.request.headers[expiresHeader], - 'X-Amz-SignedHeaders': this.signedHeaders() - }; - - if (credentials.sessionToken) { - qs['X-Amz-Security-Token'] = credentials.sessionToken; - } - - if (this.request.headers['Content-Type']) { - qs['Content-Type'] = this.request.headers['Content-Type']; - } - if (this.request.headers['Content-MD5']) { - qs['Content-MD5'] = this.request.headers['Content-MD5']; - } - if (this.request.headers['Cache-Control']) { - qs['Cache-Control'] = this.request.headers['Cache-Control']; + /** + * @api private + */ + getSigningName: function getSigningName(req) { + if (req && req.operation === 'writeGetObjectResponse') { + return OBJECT_LAMBDA_SERVICE; } - // need to pull in any other X-Amz-* headers - AWS.util.each.call(this, this.request.headers, function(key, value) { - if (key === expiresHeader) return; - if (this.isSignableHeader(key)) { - var lowerKey = key.toLowerCase(); - // Metadata should be normalized - if (lowerKey.indexOf('x-amz-meta-') === 0) { - qs[lowerKey] = value; - } else if (lowerKey.indexOf('x-amz-') === 0) { - qs[key] = value; - } - } - }); - - var sep = this.request.path.indexOf('?') >= 0 ? '&' : '?'; - this.request.path += sep + AWS.util.queryParamsToString(qs); - }, - - authorization: function authorization(credentials, datetime) { - var parts = []; - var credString = this.credentialString(datetime); - parts.push(this.algorithm + ' Credential=' + - credentials.accessKeyId + '/' + credString); - parts.push('SignedHeaders=' + this.signedHeaders()); - parts.push('Signature=' + this.signature(credentials, datetime)); - return parts.join(', '); + var _super = AWS.Service.prototype.getSigningName; + return (req && req._parsedArn && req._parsedArn.service) + ? req._parsedArn.service + : _super.call(this); }, - signature: function signature(credentials, datetime) { - var signingKey = v4Credentials.getSigningKey( - credentials, - datetime.substr(0, 8), - this.request.region, - this.serviceName, - this.signatureCache - ); - return AWS.util.crypto.hmac(signingKey, this.stringToSign(datetime), 'hex'); + /** + * @api private + */ + getSignerClass: function getSignerClass(request) { + var signatureVersion = this.getSignatureVersion(request); + return AWS.Signers.RequestSigner.getVersion(signatureVersion); }, - stringToSign: function stringToSign(datetime) { - var parts = []; - parts.push('AWS4-HMAC-SHA256'); - parts.push(datetime); - parts.push(this.credentialString(datetime)); - parts.push(this.hexEncodedHash(this.canonicalString())); - return parts.join('\n'); - }, + /** + * @api private + */ + validateService: function validateService() { + var msg; + var messages = []; - canonicalString: function canonicalString() { - var parts = [], pathname = this.request.pathname(); - if (this.serviceName !== 's3' && this.signatureVersion !== 's3v4') pathname = AWS.util.uriEscapePath(pathname); + // default to us-east-1 when no region is provided + if (!this.config.region) this.config.region = 'us-east-1'; - parts.push(this.request.method); - parts.push(pathname); - parts.push(this.request.search()); - parts.push(this.canonicalHeaders() + '\n'); - parts.push(this.signedHeaders()); - parts.push(this.hexEncodedBodyHash()); - return parts.join('\n'); + if (!this.config.endpoint && this.config.s3BucketEndpoint) { + messages.push('An endpoint must be provided when configuring ' + + '`s3BucketEndpoint` to true.'); + } + if (messages.length === 1) { + msg = messages[0]; + } else if (messages.length > 1) { + msg = 'Multiple configuration errors:\n' + messages.join('\n'); + } + if (msg) { + throw AWS.util.error(new Error(), + {name: 'InvalidEndpoint', message: msg}); + } }, - canonicalHeaders: function canonicalHeaders() { - var headers = []; - AWS.util.each.call(this, this.request.headers, function (key, item) { - headers.push([key, item]); - }); - headers.sort(function (a, b) { - return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1; - }); - var parts = []; - AWS.util.arrayEach.call(this, headers, function (item) { - var key = item[0].toLowerCase(); - if (this.isSignableHeader(key)) { - var value = item[1]; - if (typeof value === 'undefined' || value === null || typeof value.toString !== 'function') { - throw AWS.util.error(new Error('Header ' + key + ' contains invalid value'), { - code: 'InvalidHeader' - }); - } - parts.push(key + ':' + - this.canonicalHeaderValues(value.toString())); - } - }); - return parts.join('\n'); + /** + * @api private + */ + shouldDisableBodySigning: function shouldDisableBodySigning(request) { + var signerClass = this.getSignerClass(); + if (this.config.s3DisableBodySigning === true && signerClass === AWS.Signers.V4 + && request.httpRequest.endpoint.protocol === 'https:') { + return true; + } + return false; }, - canonicalHeaderValues: function canonicalHeaderValues(values) { - return values.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, ''); - }, + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + request.addListener('validateResponse', this.setExpiresString); + var prependListener = true; + request.addListener('validate', this.validateScheme); + request.addListener('validate', this.validateBucketName, prependListener); + request.addListener('validate', this.optInUsEast1RegionalEndpoint, prependListener); - signedHeaders: function signedHeaders() { - var keys = []; - AWS.util.each.call(this, this.request.headers, function (key) { - key = key.toLowerCase(); - if (this.isSignableHeader(key)) keys.push(key); - }); - return keys.sort().join(';'); - }, + request.removeListener('validate', + AWS.EventListeners.Core.VALIDATE_REGION); + request.addListener('build', this.addContentType); + request.addListener('build', this.computeContentMd5); + request.addListener('build', this.computeSseCustomerKeyMd5); + request.addListener('build', this.populateURI); + request.addListener('afterBuild', this.addExpect100Continue); + request.addListener('extractError', this.extractError); + request.addListener('extractData', AWS.util.hoistPayloadMember); + request.addListener('extractData', this.extractData); + request.addListener('extractData', this.extractErrorFrom200Response); + request.addListener('beforePresign', this.prepareSignedUrl); + if (this.shouldDisableBodySigning(request)) { + request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); + request.addListener('afterBuild', this.disableBodySigning); + } + //deal with ARNs supplied to Bucket + if (request.operation !== 'createBucket' && s3util.isArnInParam(request, 'Bucket')) { + // avoid duplicate parsing in the future + request._parsedArn = AWS.util.ARN.parse(request.params.Bucket); - credentialString: function credentialString(datetime) { - return v4Credentials.createScope( - datetime.substr(0, 8), - this.request.region, - this.serviceName - ); + request.removeListener('validate', this.validateBucketName); + request.removeListener('build', this.populateURI); + if (request._parsedArn.service === 's3') { + request.addListener('validate', s3util.validateS3AccessPointArn); + request.addListener('validate', this.validateArnResourceType); + request.addListener('validate', this.validateArnRegion); + } else if (request._parsedArn.service === 's3-outposts') { + request.addListener('validate', s3util.validateOutpostsAccessPointArn); + request.addListener('validate', s3util.validateOutpostsArn); + request.addListener('validate', s3util.validateArnRegion); + } + request.addListener('validate', s3util.validateArnAccount); + request.addListener('validate', s3util.validateArnService); + request.addListener('build', this.populateUriFromAccessPointArn); + request.addListener('build', s3util.validatePopulateUriFromArn); + return; + } + //listeners regarding region inference + request.addListener('validate', this.validateBucketEndpoint); + request.addListener('validate', this.correctBucketRegionFromCache); + request.onAsync('extractError', this.requestBucketRegion); + if (AWS.util.isBrowser()) { + request.onAsync('retry', this.reqRegionForNetworkingError); + } }, - hexEncodedHash: function hash(string) { - return AWS.util.crypto.sha256(string, 'hex'); + /** + * @api private + */ + validateScheme: function(req) { + var params = req.params, + scheme = req.httpRequest.endpoint.protocol, + sensitive = params.SSECustomerKey || params.CopySourceSSECustomerKey; + if (sensitive && scheme !== 'https:') { + var msg = 'Cannot send SSE keys over HTTP. Set \'sslEnabled\'' + + 'to \'true\' in your configuration'; + throw AWS.util.error(new Error(), + { code: 'ConfigError', message: msg }); + } }, - hexEncodedBodyHash: function hexEncodedBodyHash() { - var request = this.request; - if (this.isPresigned() && (['s3', 's3-object-lambda'].indexOf(this.serviceName) > -1) && !request.body) { - return 'UNSIGNED-PAYLOAD'; - } else if (request.headers['X-Amz-Content-Sha256']) { - return request.headers['X-Amz-Content-Sha256']; - } else { - return this.hexEncodedHash(this.request.body || ''); + /** + * @api private + */ + validateBucketEndpoint: function(req) { + if (!req.params.Bucket && req.service.config.s3BucketEndpoint) { + var msg = 'Cannot send requests to root API with `s3BucketEndpoint` set.'; + throw AWS.util.error(new Error(), + { code: 'ConfigError', message: msg }); } }, - unsignableHeaders: [ - 'authorization', - 'content-type', - 'content-length', - 'user-agent', - expiresHeader, - 'expect', - 'x-amzn-trace-id' - ], - - isSignableHeader: function isSignableHeader(key) { - if (key.toLowerCase().indexOf('x-amz-') === 0) return true; - return this.unsignableHeaders.indexOf(key) < 0; + /** + * @api private + */ + validateArnRegion: function validateArnRegion(req) { + s3util.validateArnRegion(req, { allowFipsEndpoint: true }); }, - isPresigned: function isPresigned() { - return this.request.headers[expiresHeader] ? true : false; - } - -}); - -/** - * @api private - */ -module.exports = AWS.Signers.V4; - - -/***/ }), - -/***/ 62660: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var AWS = __nccwpck_require__(28437); - -/** - * @api private - */ -var cachedSecret = {}; - -/** - * @api private - */ -var cacheQueue = []; + /** + * Validate resource-type supplied in S3 ARN + */ + validateArnResourceType: function validateArnResourceType(req) { + var resource = req._parsedArn.resource; -/** - * @api private - */ -var maxCacheEntries = 50; + if ( + resource.indexOf('accesspoint:') !== 0 && + resource.indexOf('accesspoint/') !== 0 + ) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'ARN resource should begin with \'accesspoint/\'' + }); + } + }, -/** - * @api private - */ -var v4Identifier = 'aws4_request'; + /** + * @api private + */ + validateBucketName: function validateBucketName(req) { + var service = req.service; + var signatureVersion = service.getSignatureVersion(req); + var bucket = req.params && req.params.Bucket; + var key = req.params && req.params.Key; + var slashIndex = bucket && bucket.indexOf('/'); + if (bucket && slashIndex >= 0) { + if (typeof key === 'string' && slashIndex > 0) { + req.params = AWS.util.copy(req.params); + // Need to include trailing slash to match sigv2 behavior + var prefix = bucket.substr(slashIndex + 1) || ''; + req.params.Key = prefix + '/' + key; + req.params.Bucket = bucket.substr(0, slashIndex); + } else if (signatureVersion === 'v4') { + var msg = 'Bucket names cannot contain forward slashes. Bucket: ' + bucket; + throw AWS.util.error(new Error(), + { code: 'InvalidBucket', message: msg }); + } + } + }, -/** - * @api private - */ -module.exports = { /** * @api private - * - * @param date [String] - * @param region [String] - * @param serviceName [String] - * @return [String] */ - createScope: function createScope(date, region, serviceName) { - return [ - date.substr(0, 8), - region, - serviceName, - v4Identifier - ].join('/'); + isValidAccelerateOperation: function isValidAccelerateOperation(operation) { + var invalidOperations = [ + 'createBucket', + 'deleteBucket', + 'listBuckets' + ]; + return invalidOperations.indexOf(operation) === -1; }, /** + * When us-east-1 region endpoint configuration is set, in stead of sending request to + * global endpoint(e.g. 's3.amazonaws.com'), we will send request to + * 's3.us-east-1.amazonaws.com'. * @api private - * - * @param credentials [Credentials] - * @param date [String] - * @param region [String] - * @param service [String] - * @param shouldCache [Boolean] - * @return [String] */ - getSigningKey: function getSigningKey( - credentials, - date, - region, - service, - shouldCache - ) { - var credsIdentifier = AWS.util.crypto - .hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64'); - var cacheKey = [credsIdentifier, date, region, service].join('_'); - shouldCache = shouldCache !== false; - if (shouldCache && (cacheKey in cachedSecret)) { - return cachedSecret[cacheKey]; + optInUsEast1RegionalEndpoint: function optInUsEast1RegionalEndpoint(req) { + var service = req.service; + var config = service.config; + config.s3UsEast1RegionalEndpoint = resolveRegionalEndpointsFlag(service._originalConfig, { + env: 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT', + sharedConfig: 's3_us_east_1_regional_endpoint', + clientConfig: 's3UsEast1RegionalEndpoint' + }); + if ( + !(service._originalConfig || {}).endpoint && + req.httpRequest.region === 'us-east-1' && + config.s3UsEast1RegionalEndpoint === 'regional' && + req.httpRequest.endpoint.hostname.indexOf('s3.amazonaws.com') >= 0 + ) { + var insertPoint = config.endpoint.indexOf('.amazonaws.com'); + var regionalEndpoint = config.endpoint.substring(0, insertPoint) + + '.us-east-1' + config.endpoint.substring(insertPoint); + req.httpRequest.updateEndpoint(regionalEndpoint); } + }, - var kDate = AWS.util.crypto.hmac( - 'AWS4' + credentials.secretAccessKey, - date, - 'buffer' - ); - var kRegion = AWS.util.crypto.hmac(kDate, region, 'buffer'); - var kService = AWS.util.crypto.hmac(kRegion, service, 'buffer'); + /** + * S3 prefers dns-compatible bucket names to be moved from the uri path + * to the hostname as a sub-domain. This is not possible, even for dns-compat + * buckets when using SSL and the bucket name contains a dot ('.'). The + * ssl wildcard certificate is only 1-level deep. + * + * @api private + */ + populateURI: function populateURI(req) { + var httpRequest = req.httpRequest; + var b = req.params.Bucket; + var service = req.service; + var endpoint = httpRequest.endpoint; + if (b) { + if (!service.pathStyleBucketName(b)) { + if (service.config.useAccelerateEndpoint && service.isValidAccelerateOperation(req.operation)) { + if (service.config.useDualstackEndpoint) { + endpoint.hostname = b + '.s3-accelerate.dualstack.amazonaws.com'; + } else { + endpoint.hostname = b + '.s3-accelerate.amazonaws.com'; + } + } else if (!service.config.s3BucketEndpoint) { + endpoint.hostname = + b + '.' + endpoint.hostname; + } - var signingKey = AWS.util.crypto.hmac(kService, v4Identifier, 'buffer'); - if (shouldCache) { - cachedSecret[cacheKey] = signingKey; - cacheQueue.push(cacheKey); - if (cacheQueue.length > maxCacheEntries) { - // remove the oldest entry (not the least recently used) - delete cachedSecret[cacheQueue.shift()]; + var port = endpoint.port; + if (port !== 80 && port !== 443) { + endpoint.host = endpoint.hostname + ':' + + endpoint.port; + } else { + endpoint.host = endpoint.hostname; + } + + httpRequest.virtualHostedBucket = b; // needed for signing the request + service.removeVirtualHostedBucketFromPath(req); } } - - return signingKey; }, /** - * @api private + * Takes the bucket name out of the path if bucket is virtual-hosted * - * Empties the derived signing key cache. Made available for testing purposes - * only. + * @api private */ - emptyCache: function emptyCache() { - cachedSecret = {}; - cacheQueue = []; - } -}; + removeVirtualHostedBucketFromPath: function removeVirtualHostedBucketFromPath(req) { + var httpRequest = req.httpRequest; + var bucket = httpRequest.virtualHostedBucket; + if (bucket && httpRequest.path) { + if (req.params && req.params.Key) { + var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key); + if (httpRequest.path.indexOf(encodedS3Key) === 0 && (httpRequest.path.length === encodedS3Key.length || httpRequest.path[encodedS3Key.length] === '?')) { + //path only contains key or path contains only key and querystring + return; + } + } + httpRequest.path = httpRequest.path.replace(new RegExp('/' + bucket), ''); + if (httpRequest.path[0] !== '/') { + httpRequest.path = '/' + httpRequest.path; + } + } + }, + /** + * When user supply an access point ARN in the Bucket parameter, we need to + * populate the URI according to the ARN. + */ + populateUriFromAccessPointArn: function populateUriFromAccessPointArn(req) { + var accessPointArn = req._parsedArn; -/***/ }), + var isOutpostArn = accessPointArn.service === 's3-outposts'; + var isObjectLambdaArn = accessPointArn.service === 's3-object-lambda'; -/***/ 68118: -/***/ ((module) => { + var outpostsSuffix = isOutpostArn ? '.' + accessPointArn.outpostId: ''; + var serviceName = isOutpostArn ? 's3-outposts': 's3-accesspoint'; + var fipsSuffix = !isOutpostArn && req.service.config.useFipsEndpoint ? '-fips': ''; + var dualStackSuffix = !isOutpostArn && + req.service.config.useDualstackEndpoint ? '.dualstack' : ''; -function AcceptorStateMachine(states, state) { - this.currentState = state || null; - this.states = states || {}; -} + var endpoint = req.httpRequest.endpoint; + var dnsSuffix = regionUtil.getEndpointSuffix(accessPointArn.region); + var useArnRegion = req.service.config.s3UseArnRegion; -AcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) { - if (typeof finalState === 'function') { - inputError = bindObject; bindObject = done; - done = finalState; finalState = null; - } + endpoint.hostname = [ + accessPointArn.accessPoint + '-' + accessPointArn.accountId + outpostsSuffix, + serviceName + fipsSuffix + dualStackSuffix, + useArnRegion ? accessPointArn.region : req.service.config.region, + dnsSuffix + ].join('.'); - var self = this; - var state = self.states[self.currentState]; - state.fn.call(bindObject || self, inputError, function(err) { - if (err) { - if (state.fail) self.currentState = state.fail; - else return done ? done.call(bindObject, err) : null; - } else { - if (state.accept) self.currentState = state.accept; - else return done ? done.call(bindObject) : null; + if (isObjectLambdaArn) { + // should be in the format: "accesspoint/${accesspointName}" + var serviceName = 's3-object-lambda'; + var accesspointName = accessPointArn.resource.split('/')[1]; + var fipsSuffix = req.service.config.useFipsEndpoint ? '-fips': ''; + endpoint.hostname = [ + accesspointName + '-' + accessPointArn.accountId, + serviceName + fipsSuffix, + useArnRegion ? accessPointArn.region : req.service.config.region, + dnsSuffix + ].join('.'); } - if (self.currentState === finalState) { - return done ? done.call(bindObject, err) : null; + endpoint.host = endpoint.hostname; + var encodedArn = AWS.util.uriEscape(req.params.Bucket); + var path = req.httpRequest.path; + //remove the Bucket value from path + req.httpRequest.path = path.replace(new RegExp('/' + encodedArn), ''); + if (req.httpRequest.path[0] !== '/') { + req.httpRequest.path = '/' + req.httpRequest.path; } + req.httpRequest.region = accessPointArn.region; //region used to sign + }, - self.runTo(finalState, done, bindObject, err); - }); -}; - -AcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) { - if (typeof acceptState === 'function') { - fn = acceptState; acceptState = null; failState = null; - } else if (typeof failState === 'function') { - fn = failState; failState = null; - } - - if (!this.currentState) this.currentState = name; - this.states[name] = { accept: acceptState, fail: failState, fn: fn }; - return this; -}; - -/** - * @api private - */ -module.exports = AcceptorStateMachine; + /** + * Adds Expect: 100-continue header if payload is greater-or-equal 1MB + * @api private + */ + addExpect100Continue: function addExpect100Continue(req) { + var len = req.httpRequest.headers['Content-Length']; + if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) { + req.httpRequest.headers['Expect'] = '100-continue'; + } + }, + /** + * Adds a default content type if none is supplied. + * + * @api private + */ + addContentType: function addContentType(req) { + var httpRequest = req.httpRequest; + if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') { + // Content-Type is not set in GET/HEAD requests + delete httpRequest.headers['Content-Type']; + return; + } -/***/ }), + if (!httpRequest.headers['Content-Type']) { // always have a Content-Type + httpRequest.headers['Content-Type'] = 'application/octet-stream'; + } -/***/ 82647: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + var contentType = httpRequest.headers['Content-Type']; + if (AWS.util.isBrowser()) { + if (typeof httpRequest.body === 'string' && !contentType.match(/;\s*charset=/)) { + var charset = '; charset=UTF-8'; + httpRequest.headers['Content-Type'] += charset; + } else { + var replaceFn = function(_, prefix, charsetName) { + return prefix + charsetName.toUpperCase(); + }; -var AWS = __nccwpck_require__(28437); + httpRequest.headers['Content-Type'] = + contentType.replace(/(;\s*charset=)(.+)$/, replaceFn); + } + } + }, -/** - * Represents AWS token object, which contains {token}, and optional - * {expireTime}. - * Creating a `Token` object allows you to pass around your - * token to configuration and service objects. - * - * Note that this class typically does not need to be constructed manually, - * as the {AWS.Config} and {AWS.Service} classes both accept simple - * options hashes with the two keys. The token from this object will be used - * automatically in operations which require them. - * - * ## Expiring and Refreshing Token - * - * Occasionally token can expire in the middle of a long-running - * application. In this case, the SDK will automatically attempt to - * refresh the token from the storage location if the Token - * class implements the {refresh} method. - * - * If you are implementing a token storage location, you - * will want to create a subclass of the `Token` class and - * override the {refresh} method. This method allows token to be - * retrieved from the backing store, be it a file system, database, or - * some network storage. The method should reset the token attributes - * on the object. - * - * @!attribute token - * @return [String] represents the literal token string. This will typically - * be a base64 encoded string. - * @!attribute expireTime - * @return [Date] a time when token should be considered expired. Used - * in conjunction with {expired}. - * @!attribute expired - * @return [Boolean] whether the token is expired and require a refresh. Used - * in conjunction with {expireTime}. - */ -AWS.Token = AWS.util.inherit({ /** - * Creates a Token object with a given set of information in options hash. - * @option options token [String] represents the literal token string. - * @option options expireTime [Date] field representing the time at which - * the token expires. - * @example Create a token object - * var token = new AWS.Token({ token: 'token' }); + * Checks whether checksums should be computed for the request if it's not + * already set by {AWS.EventListeners.Core.COMPUTE_CHECKSUM}. It depends on + * whether {AWS.Config.computeChecksums} is set. + * + * @param req [AWS.Request] the request to check against + * @return [Boolean] whether to compute checksums for a request. + * @api private */ - constructor: function Token(options) { - // hide token from being displayed with util.inspect - AWS.util.hideProperties(this, ['token']); + willComputeChecksums: function willComputeChecksums(req) { + var rules = req.service.api.operations[req.operation].input.members; + var body = req.httpRequest.body; + var needsContentMD5 = req.service.config.computeChecksums && + rules.ContentMD5 && + !req.params.ContentMD5 && + body && + (AWS.util.Buffer.isBuffer(req.httpRequest.body) || typeof req.httpRequest.body === 'string'); - this.expired = false; - this.expireTime = null; - this.refreshCallbacks = []; - if (arguments.length === 1) { - var options = arguments[0]; - this.token = options.token; - this.expireTime = options.expireTime; + // Sha256 signing disabled, and not a presigned url + if (needsContentMD5 && req.service.shouldDisableBodySigning(req) && !req.isPresigned()) { + return true; + } + + // SigV2 and presign, for backwards compatibility purpose. + if (needsContentMD5 && this.getSignatureVersion(req) === 's3' && req.isPresigned()) { + return true; } + + return false; }, /** - * @return [Integer] the number of seconds before {expireTime} during which - * the token will be considered expired. + * A listener that computes the Content-MD5 and sets it in the header. + * This listener is to support S3-specific features like + * s3DisableBodySigning and SigV2 presign. Content MD5 logic for SigV4 is + * handled in AWS.EventListeners.Core.COMPUTE_CHECKSUM + * + * @api private */ - expiryWindow: 15, + computeContentMd5: function computeContentMd5(req) { + if (req.service.willComputeChecksums(req)) { + var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64'); + req.httpRequest.headers['Content-MD5'] = md5; + } + }, /** - * @return [Boolean] whether the Token object should call {refresh} - * @note Subclasses should override this method to provide custom refresh - * logic. + * @api private */ - needsRefresh: function needsRefresh() { - var currentTime = AWS.util.date.getDate().getTime(); - var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); + computeSseCustomerKeyMd5: function computeSseCustomerKeyMd5(req) { + var keys = { + SSECustomerKey: 'x-amz-server-side-encryption-customer-key-MD5', + CopySourceSSECustomerKey: 'x-amz-copy-source-server-side-encryption-customer-key-MD5' + }; + AWS.util.each(keys, function(key, header) { + if (req.params[key]) { + var value = AWS.util.crypto.md5(req.params[key], 'base64'); + req.httpRequest.headers[header] = value; + } + }); + }, - if (this.expireTime && adjustedTime > this.expireTime) - return true; + /** + * Returns true if the bucket name should be left in the URI path for + * a request to S3. This function takes into account the current + * endpoint protocol (e.g. http or https). + * + * @api private + */ + pathStyleBucketName: function pathStyleBucketName(bucketName) { + // user can force path style requests via the configuration + if (this.config.s3ForcePathStyle) return true; + if (this.config.s3BucketEndpoint) return false; - return this.expired || !this.token; + if (s3util.dnsCompatibleBucketName(bucketName)) { + return (this.config.sslEnabled && bucketName.match(/\./)) ? true : false; + } else { + return true; // not dns compatible names must always use path style + } }, /** - * Gets the existing token, refreshing them if they are not yet loaded - * or have expired. Users should call this method before using {refresh}, - * as this will not attempt to reload token when they are already - * loaded into the object. + * For COPY operations, some can be error even with status code 200. + * SDK treats the response as exception when response body indicates + * an exception or body is empty. * - * @callback callback function(err) - * When this callback is called with no error, it means either token - * do not need to be refreshed or refreshed token information has - * been loaded into the object (as the `token` property). - * @param err [Error] if an error occurred, this value will be filled + * @api private */ - get: function get(callback) { - var self = this; - if (this.needsRefresh()) { - this.refresh(function(err) { - if (!err) self.expired = false; // reset expired flag - if (callback) callback(err); + extractErrorFrom200Response: function extractErrorFrom200Response(resp) { + var service = this.service ? this.service : this; + if (!service.is200Error(resp) && !operationsWith200StatusCodeError[resp.request.operation]) { + return; + } + var httpResponse = resp.httpResponse; + var bodyString = httpResponse.body && httpResponse.body.toString() || ''; + if (bodyString && bodyString.indexOf('') === bodyString.length - 8) { + // Response body with '...' indicates an exception. + // Get S3 client object. In ManagedUpload, this.service refers to + // S3 client object. + resp.data = null; + service.extractError(resp); + resp.error.is200Error = true; + throw resp.error; + } else if (!httpResponse.body || !bodyString.match(/<[\w_]/)) { + // When body is empty or incomplete, S3 might stop the request on detecting client + // side aborting the request. + resp.data = null; + throw AWS.util.error(new Error(), { + code: 'InternalError', + message: 'S3 aborted request' }); - } else if (callback) { - callback(); } }, /** - * @!method getPromise() - * Returns a 'thenable' promise. - * Gets the existing token, refreshing it if it's not yet loaded - * or have expired. Users should call this method before using {refresh}, - * as this will not attempt to reload token when it's already - * loaded into the object. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function() - * Called if the promise is fulfilled. When this callback is called, it means - * either token does not need to be refreshed or refreshed token information - * has been loaded into the object (as the `token` property). - * @callback rejectedCallback function(err) - * Called if the promise is rejected. - * @param err [Error] if an error occurred, this value will be filled. - * @return [Promise] A promise that represents the state of the `get` call. - * @example Calling the `getPromise` method. - * var promise = tokenProvider.getPromise(); - * promise.then(function() { ... }, function(err) { ... }); + * @api private + * @param resp - to evaluate. + * @return true if the response has status code 200 but is an error. */ + is200Error: function is200Error(resp) { + var code = resp && resp.httpResponse && resp.httpResponse.statusCode; + if (code !== 200) { + return false; + } + try { + var req = resp.request; + var outputMembers = req.service.api.operations[req.operation].output.members; + var keys = Object.keys(outputMembers); + for (var i = 0; i < keys.length; ++i) { + var member = outputMembers[keys[i]]; + if (member.type === 'binary' && member.isStreaming) { + return false; + } + } + + var body = resp.httpResponse.body; + if (body && body.byteLength !== undefined) { + if (body.byteLength < 15 || body.byteLength > 3000) { + // body is too short or long to be an error message. + return false; + } + } + if (!body) { + return false; + } + var bodyString = body.toString(); + if (bodyString.indexOf('') === bodyString.length - 8) { + return true; + } + } catch (e) { + return false; + } + return false; + }, /** - * @!method refreshPromise() - * Returns a 'thenable' promise. - * Refreshes the token. Users should call {get} before attempting - * to forcibly refresh token. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function() - * Called if the promise is fulfilled. When this callback is called, it - * means refreshed token information has been loaded into the object - * (as the `token` property). - * @callback rejectedCallback function(err) - * Called if the promise is rejected. - * @param err [Error] if an error occurred, this value will be filled. - * @return [Promise] A promise that represents the state of the `refresh` call. - * @example Calling the `refreshPromise` method. - * var promise = tokenProvider.refreshPromise(); - * promise.then(function() { ... }, function(err) { ... }); + * @return [Boolean] whether the error can be retried + * @api private */ + retryableError: function retryableError(error, request) { + if (error.is200Error || + (operationsWith200StatusCodeError[request.operation] && error.statusCode === 200)) { + return true; + } else if (request._requestRegionForBucket && + request.service.bucketRegionCache[request._requestRegionForBucket]) { + return false; + } else if (error && error.code === 'RequestTimeout') { + return true; + } else if (error && + regionRedirectErrorCodes.indexOf(error.code) != -1 && + error.region && error.region != request.httpRequest.region) { + request.httpRequest.region = error.region; + if (error.statusCode === 301) { + request.service.updateReqBucketRegion(request); + } + return true; + } else { + var _super = AWS.Service.prototype.retryableError; + return _super.call(this, error, request); + } + }, /** - * Refreshes the token. Users should call {get} before attempting - * to forcibly refresh token. + * Updates httpRequest with region. If region is not provided, then + * the httpRequest will be updated based on httpRequest.region * - * @callback callback function(err) - * When this callback is called with no error, it means refreshed - * token information has been loaded into the object (as the - * `token` property). - * @param err [Error] if an error occurred, this value will be filled - * @note Subclasses should override this class to reset the - * {token} on the token object and then call the callback with - * any error information. - * @see get + * @api private */ - refresh: function refresh(callback) { - this.expired = false; - callback(); + updateReqBucketRegion: function updateReqBucketRegion(request, region) { + var httpRequest = request.httpRequest; + if (typeof region === 'string' && region.length) { + httpRequest.region = region; + } + if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) { + return; + } + var service = request.service; + var s3Config = service.config; + var s3BucketEndpoint = s3Config.s3BucketEndpoint; + if (s3BucketEndpoint) { + delete s3Config.s3BucketEndpoint; + } + var newConfig = AWS.util.copy(s3Config); + delete newConfig.endpoint; + newConfig.region = httpRequest.region; + + httpRequest.endpoint = (new AWS.S3(newConfig)).endpoint; + service.populateURI(request); + s3Config.s3BucketEndpoint = s3BucketEndpoint; + httpRequest.headers.Host = httpRequest.endpoint.host; + + if (request._asm.currentState === 'validate') { + request.removeListener('build', service.populateURI); + request.addListener('build', service.removeVirtualHostedBucketFromPath); + } }, /** + * Provides a specialized parser for getBucketLocation -- all other + * operations are parsed by the super class. + * * @api private - * @param callback */ - coalesceRefresh: function coalesceRefresh(callback, sync) { - var self = this; - if (self.refreshCallbacks.push(callback) === 1) { - self.load(function onLoad(err) { - AWS.util.arrayEach(self.refreshCallbacks, function(callback) { - if (sync) { - callback(err); - } else { - // callback could throw, so defer to ensure all callbacks are notified - AWS.util.defer(function () { - callback(err); - }); + extractData: function extractData(resp) { + var req = resp.request; + if (req.operation === 'getBucketLocation') { + var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/); + delete resp.data['_']; + if (match) { + resp.data.LocationConstraint = match[1]; + } else { + resp.data.LocationConstraint = ''; + } + } + var bucket = req.params.Bucket || null; + if (req.operation === 'deleteBucket' && typeof bucket === 'string' && !resp.error) { + req.service.clearBucketRegionCache(bucket); + } else { + var headers = resp.httpResponse.headers || {}; + var region = headers['x-amz-bucket-region'] || null; + if (!region && req.operation === 'createBucket' && !resp.error) { + var createBucketConfiguration = req.params.CreateBucketConfiguration; + if (!createBucketConfiguration) { + region = 'us-east-1'; + } else if (createBucketConfiguration.LocationConstraint === 'EU') { + region = 'eu-west-1'; + } else { + region = createBucketConfiguration.LocationConstraint; + } + } + if (region) { + if (bucket && region !== req.service.bucketRegionCache[bucket]) { + req.service.bucketRegionCache[bucket] = region; } - }); - self.refreshCallbacks.length = 0; - }); + } } + req.service.extractRequestIds(resp); }, /** + * Extracts an error object from the http response. + * * @api private - * @param callback */ - load: function load(callback) { - callback(); - } -}); - -/** - * @api private - */ -AWS.Token.addPromisesToClass = function addPromisesToClass(PromiseDependency) { - this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); - this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); -}; + extractError: function extractError(resp) { + var codes = { + 304: 'NotModified', + 403: 'Forbidden', + 400: 'BadRequest', + 404: 'NotFound' + }; -/** - * @api private - */ -AWS.Token.deletePromisesFromClass = function deletePromisesFromClass() { - delete this.prototype.getPromise; - delete this.prototype.refreshPromise; -}; + var req = resp.request; + var code = resp.httpResponse.statusCode; + var body = resp.httpResponse.body || ''; -AWS.util.addPromises(AWS.Token); + var headers = resp.httpResponse.headers || {}; + var region = headers['x-amz-bucket-region'] || null; + var bucket = req.params.Bucket || null; + var bucketRegionCache = req.service.bucketRegionCache; + if (region && bucket && region !== bucketRegionCache[bucket]) { + bucketRegionCache[bucket] = region; + } + var cachedRegion; + if (codes[code] && body.length === 0) { + if (bucket && !region) { + cachedRegion = bucketRegionCache[bucket] || null; + if (cachedRegion !== req.httpRequest.region) { + region = cachedRegion; + } + } + resp.error = AWS.util.error(new Error(), { + code: codes[code], + message: null, + region: region + }); + } else { + var data = new AWS.XML.Parser().parse(body.toString()); -/***/ }), + if (data.Region && !region) { + region = data.Region; + if (bucket && region !== bucketRegionCache[bucket]) { + bucketRegionCache[bucket] = region; + } + } else if (bucket && !region && !data.Region) { + cachedRegion = bucketRegionCache[bucket] || null; + if (cachedRegion !== req.httpRequest.region) { + region = cachedRegion; + } + } -/***/ 90327: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + resp.error = AWS.util.error(new Error(), { + code: data.Code || code, + message: data.Message || null, + region: region + }); + } + req.service.extractRequestIds(resp); + }, -var AWS = __nccwpck_require__(28437); -var crypto = __nccwpck_require__(6113); -var fs = __nccwpck_require__(57147); -var path = __nccwpck_require__(71017); -var iniLoader = AWS.util.iniLoader; + /** + * If region was not obtained synchronously, then send async request + * to get bucket region for errors resulting from wrong region. + * + * @api private + */ + requestBucketRegion: function requestBucketRegion(resp, done) { + var error = resp.error; + var req = resp.request; + var bucket = req.params.Bucket || null; -// Tracking refresh attempt to ensure refresh is not attempted more than once every 30 seconds. -var lastRefreshAttemptTime = 0; + if (!error || !bucket || error.region || req.operation === 'listObjects' || + (AWS.util.isNode() && req.operation === 'headBucket') || + (error.statusCode === 400 && req.operation !== 'headObject') || + regionRedirectErrorCodes.indexOf(error.code) === -1) { + return done(); + } + var reqOperation = AWS.util.isNode() ? 'headBucket' : 'listObjects'; + var reqParams = {Bucket: bucket}; + if (reqOperation === 'listObjects') reqParams.MaxKeys = 0; + var regionReq = req.service[reqOperation](reqParams); + regionReq._requestRegionForBucket = bucket; + regionReq.send(function() { + var region = req.service.bucketRegionCache[bucket] || null; + error.region = region; + done(); + }); + }, -/** - * Throws error is key is not present in token object. - * - * @param token [Object] Object to be validated. - * @param key [String] The key to be validated on the object. - */ -var validateTokenKey = function validateTokenKey(token, key) { - if (!token[key]) { - throw AWS.util.error( - new Error('Key "' + key + '" not present in SSO Token'), - { code: 'SSOTokenProviderFailure' } - ); - } -}; + /** + * For browser only. If NetworkingError received, will attempt to obtain + * the bucket region. + * + * @api private + */ + reqRegionForNetworkingError: function reqRegionForNetworkingError(resp, done) { + if (!AWS.util.isBrowser()) { + return done(); + } + var error = resp.error; + var request = resp.request; + var bucket = request.params.Bucket; + if (!error || error.code !== 'NetworkingError' || !bucket || + request.httpRequest.region === 'us-east-1') { + return done(); + } + var service = request.service; + var bucketRegionCache = service.bucketRegionCache; + var cachedRegion = bucketRegionCache[bucket] || null; -/** - * Calls callback function with or without error based on provided times in case - * of unsuccessful refresh. - * - * @param currentTime [number] current time in milliseconds since ECMAScript epoch. - * @param tokenExpireTime [number] token expire time in milliseconds since ECMAScript epoch. - * @param callback [Function] Callback to call in case of error. - */ -var refreshUnsuccessful = function refreshUnsuccessful( - currentTime, - tokenExpireTime, - callback -) { - if (tokenExpireTime > currentTime) { - // Cached token is still valid, return. - callback(null); - } else { - // Token invalid, throw error requesting user to sso login. - throw AWS.util.error( - new Error('SSO Token refresh failed. Please log in using "aws sso login"'), - { code: 'SSOTokenProviderFailure' } - ); - } -}; + if (cachedRegion && cachedRegion !== request.httpRequest.region) { + service.updateReqBucketRegion(request, cachedRegion); + done(); + } else if (!s3util.dnsCompatibleBucketName(bucket)) { + service.updateReqBucketRegion(request, 'us-east-1'); + if (bucketRegionCache[bucket] !== 'us-east-1') { + bucketRegionCache[bucket] = 'us-east-1'; + } + done(); + } else if (request.httpRequest.virtualHostedBucket) { + var getRegionReq = service.listObjects({Bucket: bucket, MaxKeys: 0}); + service.updateReqBucketRegion(getRegionReq, 'us-east-1'); + getRegionReq._requestRegionForBucket = bucket; + + getRegionReq.send(function() { + var region = service.bucketRegionCache[bucket] || null; + if (region && region !== request.httpRequest.region) { + service.updateReqBucketRegion(request, region); + } + done(); + }); + } else { + // DNS-compatible path-style + // (s3ForcePathStyle or bucket name with dot over https) + // Cannot obtain region information for this case + done(); + } + }, -/** - * Represents token loaded from disk derived from the AWS SSO device grant authorication flow. - * - * ## Using SSO Token Provider - * - * This provider is checked by default in the Node.js environment in TokenProviderChain. - * To use the SSO Token Provider, simply add your SSO Start URL and Region to the - * ~/.aws/config file in the following format: - * - * [default] - * sso_start_url = https://d-abc123.awsapps.com/start - * sso_region = us-east-1 - * - * ## Using custom profiles - * - * The SDK supports loading token for separate profiles. This can be done in two ways: - * - * 1. Set the `AWS_PROFILE` environment variable in your process prior to loading the SDK. - * 2. Directly load the AWS.SSOTokenProvider: - * - * ```javascript - * var ssoTokenProvider = new AWS.SSOTokenProvider({profile: 'myprofile'}); - * ``` - * - * @!macro nobrowser - */ -AWS.SSOTokenProvider = AWS.util.inherit(AWS.Token, { /** - * Expiry window of five minutes. + * Cache for bucket region. + * + * @api private */ - expiryWindow: 5 * 60, + bucketRegionCache: {}, /** - * Creates a new token object from cached access token. + * Clears bucket region cache. * - * @param options [map] a set of options - * @option options profile [String] (AWS_PROFILE env var or 'default') - * the name of the profile to load. - * @option options callback [Function] (err) Token is eagerly loaded - * by the constructor. When the callback is called with no error, the - * token has been loaded successfully. + * @api private */ - constructor: function SSOTokenProvider(options) { - AWS.Token.call(this); - - options = options || {}; + clearBucketRegionCache: function(buckets) { + var bucketRegionCache = this.bucketRegionCache; + if (!buckets) { + buckets = Object.keys(bucketRegionCache); + } else if (typeof buckets === 'string') { + buckets = [buckets]; + } + for (var i = 0; i < buckets.length; i++) { + delete bucketRegionCache[buckets[i]]; + } + return bucketRegionCache; + }, - this.expired = true; - this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; - this.get(options.callback || AWS.util.fn.noop); + /** + * Corrects request region if bucket's cached region is different + * + * @api private + */ + correctBucketRegionFromCache: function correctBucketRegionFromCache(req) { + var bucket = req.params.Bucket || null; + if (bucket) { + var service = req.service; + var requestRegion = req.httpRequest.region; + var cachedRegion = service.bucketRegionCache[bucket]; + if (cachedRegion && cachedRegion !== requestRegion) { + service.updateReqBucketRegion(req, cachedRegion); + } + } }, /** - * Reads sso_start_url from provided profile, and reads token from - * ~/.aws/sso/cache/.json - * - * Throws an error if required fields token and expiresAt are missing. - * Throws an error if token has expired and metadata to perform refresh is - * not available. - * Attempts to refresh the token if it's within 5 minutes before expiry time. + * Extracts S3 specific request ids from the http response. * * @api private */ - load: function load(callback) { - var self = this; - var profiles = iniLoader.loadFrom({ isConfig: true }); - var profile = profiles[this.profile] || {}; + extractRequestIds: function extractRequestIds(resp) { + var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null; + var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null; + resp.extendedRequestId = extendedRequestId; + resp.cfId = cfId; - if (Object.keys(profile).length === 0) { - throw AWS.util.error( - new Error('Profile "' + this.profile + '" not found'), - { code: 'SSOTokenProviderFailure' } - ); - } else if (!profile['sso_session']) { - throw AWS.util.error( - new Error('Profile "' + this.profile + '" is missing required property "sso_session".'), - { code: 'SSOTokenProviderFailure' } - ); + if (resp.error) { + resp.error.requestId = resp.requestId || null; + resp.error.extendedRequestId = extendedRequestId; + resp.error.cfId = cfId; } + }, - var ssoSessionName = profile['sso_session']; - var ssoSessions = iniLoader.loadSsoSessionsFrom(); - var ssoSession = ssoSessions[ssoSessionName]; + /** + * Get a pre-signed URL for a given operation name. + * + * @note You must ensure that you have static or previously resolved + * credentials if you call this method synchronously (with no callback), + * otherwise it may not properly sign the request. If you cannot guarantee + * this (you are using an asynchronous credential provider, i.e., EC2 + * IAM roles), you should always call this method with an asynchronous + * callback. + * @note Not all operation parameters are supported when using pre-signed + * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, + * `ContentLength`, or `Tagging` must be provided as headers when sending a + * request. If you are using pre-signed URLs to upload from a browser and + * need to use these fields, see {createPresignedPost}. + * @note The default signer allows altering the request by adding corresponding + * headers to set some parameters (e.g. Range) and these added parameters + * won't be signed. You must use signatureVersion v4 to to include these + * parameters in the signed portion of the URL and enforce exact matching + * between headers and signed params in the URL. + * @note This operation cannot be used with a promise. See note above regarding + * asynchronous credentials and use with a callback. + * @param operation [String] the name of the operation to call + * @param params [map] parameters to pass to the operation. See the given + * operation for the expected operation parameters. In addition, you can + * also pass the "Expires" parameter to inform S3 how long the URL should + * work for. + * @option params Expires [Integer] (900) the number of seconds to expire + * the pre-signed URL operation in. Defaults to 15 minutes. + * @param callback [Function] if a callback is provided, this function will + * pass the URL as the second parameter (after the error parameter) to + * the callback function. + * @return [String] if called synchronously (with no callback), returns the + * signed URL. + * @return [null] nothing is returned if a callback is provided. + * @example Pre-signing a getObject operation (synchronously) + * var params = {Bucket: 'bucket', Key: 'key'}; + * var url = s3.getSignedUrl('getObject', params); + * console.log('The URL is', url); + * @example Pre-signing a putObject (asynchronously) + * var params = {Bucket: 'bucket', Key: 'key'}; + * s3.getSignedUrl('putObject', params, function (err, url) { + * console.log('The URL is', url); + * }); + * @example Pre-signing a putObject operation with a specific payload + * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; + * var url = s3.getSignedUrl('putObject', params); + * console.log('The URL is', url); + * @example Passing in a 1-minute expiry time for a pre-signed URL + * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; + * var url = s3.getSignedUrl('getObject', params); + * console.log('The URL is', url); // expires in 60 seconds + */ + getSignedUrl: function getSignedUrl(operation, params, callback) { + params = AWS.util.copy(params || {}); + var expires = params.Expires || 900; - if (!ssoSession) { - throw AWS.util.error( - new Error('Sso session "' + ssoSessionName + '" not found'), - { code: 'SSOTokenProviderFailure' } - ); - } else if (!ssoSession['sso_start_url']) { - throw AWS.util.error( - new Error('Sso session "' + this.profile + '" is missing required property "sso_start_url".'), - { code: 'SSOTokenProviderFailure' } - ); - } else if (!ssoSession['sso_region']) { - throw AWS.util.error( - new Error('Sso session "' + this.profile + '" is missing required property "sso_region".'), - { code: 'SSOTokenProviderFailure' } - ); + if (typeof expires !== 'number') { + throw AWS.util.error(new Error(), + { code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires }); } - var hasher = crypto.createHash('sha1'); - var fileName = hasher.update(ssoSessionName).digest('hex') + '.json'; - var cachePath = path.join(iniLoader.getHomeDir(), '.aws', 'sso', 'cache', fileName); - var tokenFromCache = JSON.parse(fs.readFileSync(cachePath)); + delete params.Expires; // we can't validate this + var request = this.makeRequest(operation, params); - if (!tokenFromCache) { - throw AWS.util.error( - new Error('Cached token not found. Please log in using "aws sso login"' - + ' for profile "' + this.profile + '".'), - { code: 'SSOTokenProviderFailure' } - ); + if (callback) { + AWS.util.defer(function() { + request.presign(expires, callback); + }); + } else { + return request.presign(expires, callback); } + }, - validateTokenKey(tokenFromCache, 'accessToken'); - validateTokenKey(tokenFromCache, 'expiresAt'); - - var currentTime = AWS.util.date.getDate().getTime(); - var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); - var tokenExpireTime = new Date(tokenFromCache['expiresAt']); + /** + * @!method getSignedUrlPromise() + * Returns a 'thenable' promise that will be resolved with a pre-signed URL + * for a given operation name. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @note Not all operation parameters are supported when using pre-signed + * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, + * `ContentLength`, or `Tagging` must be provided as headers when sending a + * request. If you are using pre-signed URLs to upload from a browser and + * need to use these fields, see {createPresignedPost}. + * @param operation [String] the name of the operation to call + * @param params [map] parameters to pass to the operation. See the given + * operation for the expected operation parameters. In addition, you can + * also pass the "Expires" parameter to inform S3 how long the URL should + * work for. + * @option params Expires [Integer] (900) the number of seconds to expire + * the pre-signed URL operation in. Defaults to 15 minutes. + * @callback fulfilledCallback function(url) + * Called if the promise is fulfilled. + * @param url [String] the signed url + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled + * @return [Promise] A promise that represents the state of the `refresh` call. + * @example Pre-signing a getObject operation + * var params = {Bucket: 'bucket', Key: 'key'}; + * var promise = s3.getSignedUrlPromise('getObject', params); + * promise.then(function(url) { + * console.log('The URL is', url); + * }, function(err) { ... }); + * @example Pre-signing a putObject operation with a specific payload + * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; + * var promise = s3.getSignedUrlPromise('putObject', params); + * promise.then(function(url) { + * console.log('The URL is', url); + * }, function(err) { ... }); + * @example Passing in a 1-minute expiry time for a pre-signed URL + * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; + * var promise = s3.getSignedUrlPromise('getObject', params); + * promise.then(function(url) { + * console.log('The URL is', url); + * }, function(err) { ... }); + */ - if (tokenExpireTime > adjustedTime) { - // Token is valid and not expired. - self.token = tokenFromCache.accessToken; - self.expireTime = tokenExpireTime; - self.expired = false; - callback(null); - return; + /** + * Get a pre-signed POST policy to support uploading to S3 directly from an + * HTML form. + * + * @param params [map] + * @option params Bucket [String] The bucket to which the post should be + * uploaded + * @option params Expires [Integer] (3600) The number of seconds for which + * the presigned policy should be valid. + * @option params Conditions [Array] An array of conditions that must be met + * for the presigned policy to allow the + * upload. This can include required tags, + * the accepted range for content lengths, + * etc. + * @see http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html + * @option params Fields [map] Fields to include in the form. All + * values passed in as fields will be + * signed as exact match conditions. + * @param callback [Function] + * + * @note All fields passed in when creating presigned post data will be signed + * as exact match conditions. Any fields that will be interpolated by S3 + * must be added to the fields hash after signing, and an appropriate + * condition for such fields must be explicitly added to the Conditions + * array passed to this function before signing. + * + * @example Presiging post data with a known key + * var params = { + * Bucket: 'bucket', + * Fields: { + * key: 'key' + * } + * }; + * s3.createPresignedPost(params, function(err, data) { + * if (err) { + * console.error('Presigning post data encountered an error', err); + * } else { + * console.log('The post data is', data); + * } + * }); + * + * @example Presigning post data with an interpolated key + * var params = { + * Bucket: 'bucket', + * Conditions: [ + * ['starts-with', '$key', 'path/to/uploads/'] + * ] + * }; + * s3.createPresignedPost(params, function(err, data) { + * if (err) { + * console.error('Presigning post data encountered an error', err); + * } else { + * data.Fields.key = 'path/to/uploads/${filename}'; + * console.log('The post data is', data); + * } + * }); + * + * @note You must ensure that you have static or previously resolved + * credentials if you call this method synchronously (with no callback), + * otherwise it may not properly sign the request. If you cannot guarantee + * this (you are using an asynchronous credential provider, i.e., EC2 + * IAM roles), you should always call this method with an asynchronous + * callback. + * + * @return [map] If called synchronously (with no callback), returns a hash + * with the url to set as the form action and a hash of fields + * to include in the form. + * @return [null] Nothing is returned if a callback is provided. + * + * @callback callback function (err, data) + * @param err [Error] the error object returned from the policy signer + * @param data [map] The data necessary to construct an HTML form + * @param data.url [String] The URL to use as the action of the form + * @param data.fields [map] A hash of fields that must be included in the + * form for the upload to succeed. This hash will + * include the signed POST policy, your access key + * ID and security token (if present), etc. These + * may be safely included as input elements of type + * 'hidden.' + */ + createPresignedPost: function createPresignedPost(params, callback) { + if (typeof params === 'function' && callback === undefined) { + callback = params; + params = null; } - // Skip new refresh, if last refresh was done within 30 seconds. - if (currentTime - lastRefreshAttemptTime < 30 * 1000) { - refreshUnsuccessful(currentTime, tokenExpireTime, callback); - return; + params = AWS.util.copy(params || {}); + var boundParams = this.config.params || {}; + var bucket = params.Bucket || boundParams.Bucket, + self = this, + config = this.config, + endpoint = AWS.util.copy(this.endpoint); + if (!config.s3BucketEndpoint) { + endpoint.pathname = '/' + bucket; } - // Token is in expiry window, refresh from SSOOIDC.createToken() call. - validateTokenKey(tokenFromCache, 'clientId'); - validateTokenKey(tokenFromCache, 'clientSecret'); - validateTokenKey(tokenFromCache, 'refreshToken'); - - if (!self.service || self.service.config.region !== ssoSession.sso_region) { - self.service = new AWS.SSOOIDC({ region: ssoSession.sso_region }); + function finalizePost() { + return { + url: AWS.util.urlFormat(endpoint), + fields: self.preparePostFields( + config.credentials, + config.region, + bucket, + params.Fields, + params.Conditions, + params.Expires + ) + }; } - var params = { - clientId: tokenFromCache.clientId, - clientSecret: tokenFromCache.clientSecret, - refreshToken: tokenFromCache.refreshToken, - grantType: 'refresh_token', - }; - - lastRefreshAttemptTime = AWS.util.date.getDate().getTime(); - self.service.createToken(params, function(err, data) { - if (err || !data) { - refreshUnsuccessful(currentTime, tokenExpireTime, callback); - } else { - try { - validateTokenKey(data, 'accessToken'); - validateTokenKey(data, 'expiresIn'); - self.expired = false; - self.token = data.accessToken; - self.expireTime = new Date(Date.now() + data.expiresIn * 1000); - callback(null); - + if (callback) { + config.getCredentials(function (err) { + if (err) { + callback(err); + } else { try { - // Write updated token data to disk. - tokenFromCache.accessToken = data.accessToken; - tokenFromCache.expiresAt = self.expireTime.toISOString(); - tokenFromCache.refreshToken = data.refreshToken; - fs.writeFileSync(cachePath, JSON.stringify(tokenFromCache, null, 2)); - } catch (error) { - // Swallow error if unable to write token to file. + callback(null, finalizePost()); + } catch (err) { + callback(err); } - } catch (error) { - refreshUnsuccessful(currentTime, tokenExpireTime, callback); } - } - }); + }); + } else { + return finalizePost(); + } }, /** - * Loads the cached access token from disk. - * - * @callback callback function(err) - * Called after the AWS SSO process has been executed. When this - * callback is called with no error, it means that the token information - * has been loaded into the object (as the `token` property). - * @param err [Error] if an error occurred, this value will be filled. - * @see get + * @api private */ - refresh: function refresh(callback) { - iniLoader.clearCachedFiles(); - this.coalesceRefresh(callback || AWS.util.fn.callback); - }, -}); + preparePostFields: function preparePostFields( + credentials, + region, + bucket, + fields, + conditions, + expiresInSeconds + ) { + var now = this.getSkewCorrectedDate(); + if (!credentials || !region || !bucket) { + throw new Error('Unable to create a POST object policy without a bucket,' + + ' region, and credentials'); + } + fields = AWS.util.copy(fields || {}); + conditions = (conditions || []).slice(0); + expiresInSeconds = expiresInSeconds || 3600; + var signingDate = AWS.util.date.iso8601(now).replace(/[:\-]|\.\d{3}/g, ''); + var shortDate = signingDate.substr(0, 8); + var scope = v4Credentials.createScope(shortDate, region, 's3'); + var credential = credentials.accessKeyId + '/' + scope; -/***/ }), + fields['bucket'] = bucket; + fields['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'; + fields['X-Amz-Credential'] = credential; + fields['X-Amz-Date'] = signingDate; + if (credentials.sessionToken) { + fields['X-Amz-Security-Token'] = credentials.sessionToken; + } + for (var field in fields) { + if (fields.hasOwnProperty(field)) { + var condition = {}; + condition[field] = fields[field]; + conditions.push(condition); + } + } -/***/ 50126: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + fields.Policy = this.preparePostPolicy( + new Date(now.valueOf() + expiresInSeconds * 1000), + conditions + ); + fields['X-Amz-Signature'] = AWS.util.crypto.hmac( + v4Credentials.getSigningKey(credentials, shortDate, region, 's3', true), + fields.Policy, + 'hex' + ); -var AWS = __nccwpck_require__(28437); + return fields; + }, -/** - * Creates a token provider chain that searches for token in a list of - * token providers specified by the {providers} property. - * - * By default, the chain will use the {defaultProviders} to resolve token. - * - * ## Setting Providers - * - * Each provider in the {providers} list should be a function that returns - * a {AWS.Token} object, or a hardcoded token object. The function - * form allows for delayed execution of the Token construction. - * - * ## Resolving Token from a Chain - * - * Call {resolve} to return the first valid token object that can be - * loaded by the provider chain. - * - * For example, to resolve a chain with a custom provider that checks a file - * on disk after the set of {defaultProviders}: - * - * ```javascript - * var diskProvider = new FileTokenProvider('./token.json'); - * var chain = new AWS.TokenProviderChain(); - * chain.providers.push(diskProvider); - * chain.resolve(); - * ``` - * - * The above code will return the `diskProvider` object if the - * file contains token and the `defaultProviders` do not contain - * any token. - * - * @!attribute providers - * @return [Array] - * a list of token objects or functions that return token - * objects. If the provider is a function, the function will be - * executed lazily when the provider needs to be checked for valid - * token. By default, this object will be set to the {defaultProviders}. - * @see defaultProviders - */ -AWS.TokenProviderChain = AWS.util.inherit(AWS.Token, { + /** + * @api private + */ + preparePostPolicy: function preparePostPolicy(expiration, conditions) { + return AWS.util.base64.encode(JSON.stringify({ + expiration: AWS.util.date.iso8601(expiration), + conditions: conditions + })); + }, /** - * Creates a new TokenProviderChain with a default set of providers - * specified by {defaultProviders}. + * @api private */ - constructor: function TokenProviderChain(providers) { - if (providers) { - this.providers = providers; + prepareSignedUrl: function prepareSignedUrl(request) { + request.addListener('validate', request.service.noPresignedContentLength); + request.removeListener('build', request.service.addContentType); + if (!request.params.Body) { + // no Content-MD5/SHA-256 if body is not provided + request.removeListener('build', request.service.computeContentMd5); } else { - this.providers = AWS.TokenProviderChain.defaultProviders.slice(0); + request.addListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); } - this.resolveCallbacks = []; }, /** - * @!method resolvePromise() - * Returns a 'thenable' promise. - * Resolves the provider chain by searching for the first token in {providers}. - * - * Two callbacks can be provided to the `then` method on the returned promise. - * The first callback will be called if the promise is fulfilled, and the second - * callback will be called if the promise is rejected. - * @callback fulfilledCallback function(token) - * Called if the promise is fulfilled and the provider resolves the chain - * to a token object - * @param token [AWS.Token] the token object resolved by the provider chain. - * @callback rejectedCallback function(error) - * Called if the promise is rejected. - * @param err [Error] the error object returned if no token is found. - * @return [Promise] A promise that represents the state of the `resolve` method call. - * @example Calling the `resolvePromise` method. - * var promise = chain.resolvePromise(); - * promise.then(function(token) { ... }, function(err) { ... }); + * @api private + * @param request */ + disableBodySigning: function disableBodySigning(request) { + var headers = request.httpRequest.headers; + // Add the header to anything that isn't a presigned url, unless that presigned url had a body defined + if (!Object.prototype.hasOwnProperty.call(headers, 'presigned-expires')) { + headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; + } + }, /** - * Resolves the provider chain by searching for the first token in {providers}. - * - * @callback callback function(err, token) - * Called when the provider resolves the chain to a token object - * or null if no token can be found. + * @api private + */ + noPresignedContentLength: function noPresignedContentLength(request) { + if (request.params.ContentLength !== undefined) { + throw AWS.util.error(new Error(), {code: 'UnexpectedParameter', + message: 'ContentLength is not supported in pre-signed URLs.'}); + } + }, + + createBucket: function createBucket(params, callback) { + // When creating a bucket *outside* the classic region, the location + // constraint must be set for the bucket and it must match the endpoint. + // This chunk of code will set the location constraint param based + // on the region (when possible), but it will not override a passed-in + // location constraint. + if (typeof params === 'function' || !params) { + callback = callback || params; + params = {}; + } + var hostname = this.endpoint.hostname; + // copy params so that appending keys does not unintentioinallly + // mutate params object argument passed in by user + var copiedParams = AWS.util.copy(params); + + if ( + this.config.region !== 'us-east-1' + && hostname !== this.api.globalEndpoint + && !params.CreateBucketConfiguration + ) { + copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region }; + } + return this.makeRequest('createBucket', copiedParams, callback); + }, + + writeGetObjectResponse: function writeGetObjectResponse(params, callback) { + + var request = this.makeRequest('writeGetObjectResponse', AWS.util.copy(params), callback); + var hostname = this.endpoint.hostname; + if (hostname.indexOf(this.config.region) !== -1) { + // hostname specifies a region already + hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.'); + } else { + // Hostname doesn't have a region. + // Object Lambda requires an explicit region. + hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.' + this.config.region + '.'); + } + + request.httpRequest.endpoint = new AWS.Endpoint(hostname, this.config); + return request; + }, + + /** + * @see AWS.S3.ManagedUpload + * @overload upload(params = {}, [options], [callback]) + * Uploads an arbitrarily sized buffer, blob, or stream, using intelligent + * concurrent handling of parts if the payload is large enough. You can + * configure the concurrent queue size by setting `options`. Note that this + * is the only operation for which the SDK can retry requests with stream + * bodies. * - * @param err [Error] the error object returned if no token is found. - * @param token [AWS.Token] the token object resolved by the provider chain. - * @return [AWS.TokenProviderChain] the provider, for chaining. + * @param (see AWS.S3.putObject) + * @option (see AWS.S3.ManagedUpload.constructor) + * @return [AWS.S3.ManagedUpload] the managed upload object that can call + * `send()` or track progress. + * @example Uploading a stream object + * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; + * s3.upload(params, function(err, data) { + * console.log(err, data); + * }); + * @example Uploading a stream with concurrency of 1 and partSize of 10mb + * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; + * var options = {partSize: 10 * 1024 * 1024, queueSize: 1}; + * s3.upload(params, options, function(err, data) { + * console.log(err, data); + * }); + * @callback callback function(err, data) + * @param err [Error] an error or null if no error occurred. + * @param data [map] The response data from the successful upload: + * @param data.Location [String] the URL of the uploaded object + * @param data.ETag [String] the ETag of the uploaded object + * @param data.Bucket [String] the bucket to which the object was uploaded + * @param data.Key [String] the key to which the object was uploaded */ - resolve: function resolve(callback) { - var self = this; - if (self.providers.length === 0) { - callback(new Error('No providers')); - return self; + upload: function upload(params, options, callback) { + if (typeof options === 'function' && callback === undefined) { + callback = options; + options = null; } - if (self.resolveCallbacks.push(callback) === 1) { - var index = 0; - var providers = self.providers.slice(0); + options = options || {}; + options = AWS.util.merge(options || {}, {service: this, params: params}); - function resolveNext(err, token) { - if ((!err && token) || index === providers.length) { - AWS.util.arrayEach(self.resolveCallbacks, function (callback) { - callback(err, token); - }); - self.resolveCallbacks.length = 0; - return; - } + var uploader = new AWS.S3.ManagedUpload(options); + if (typeof callback === 'function') uploader.send(callback); + return uploader; + }, - var provider = providers[index++]; - if (typeof provider === 'function') { - token = provider.call(); - } else { - token = provider; - } + /** + * @api private + */ + setExpiresString: function setExpiresString(response) { + // Check if response contains Expires value, and populate ExpiresString. + if (response && response.httpResponse && response.httpResponse.headers) { + if ('expires' in response.httpResponse.headers) { + response.httpResponse.headers.expiresstring = response.httpResponse.headers.expires; + } + } - if (token.get) { - token.get(function (getErr) { - resolveNext(getErr, getErr ? null : token); - }); - } else { - resolveNext(null, token); + // Check if value in Expires is not a Date using parseTimestamp. + try { + if (response && response.httpResponse && response.httpResponse.headers) { + if ('expires' in response.httpResponse.headers) { + AWS.util.date.parseTimestamp(response.httpResponse.headers.expires); } } - - resolveNext(); + } catch (e) { + console.log('AWS SDK', '(warning)', e); + delete response.httpResponse.headers.expires; } - - return self; } }); -/** - * The default set of providers used by a vanilla TokenProviderChain. - * - * In the browser: - * - * ```javascript - * AWS.TokenProviderChain.defaultProviders = [] - * ``` - * - * In Node.js: - * - * ```javascript - * AWS.TokenProviderChain.defaultProviders = [ - * function () { return new AWS.SSOTokenProvider(); }, - * ] - * ``` - */ -AWS.TokenProviderChain.defaultProviders = []; - /** * @api private */ -AWS.TokenProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { - this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); +AWS.S3.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.getSignedUrlPromise = AWS.util.promisifyMethod('getSignedUrl', PromiseDependency); }; /** * @api private */ -AWS.TokenProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { - delete this.prototype.resolvePromise; +AWS.S3.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.getSignedUrlPromise; }; -AWS.util.addPromises(AWS.TokenProviderChain); +AWS.util.addPromises(AWS.S3); /***/ }), -/***/ 77985: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 71207: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -/* eslint guard-for-in:0 */ -var AWS; +var AWS = __nccwpck_require__(28437); +var s3util = __nccwpck_require__(35895); +var regionUtil = __nccwpck_require__(18262); -/** - * A set of utility methods for use with the AWS SDK. - * - * @!attribute abort - * Return this value from an iterator function {each} or {arrayEach} - * to break out of the iteration. - * @example Breaking out of an iterator function - * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) { - * if (key == 'b') return AWS.util.abort; - * }); - * @see each - * @see arrayEach - * @api private - */ -var util = { - environment: 'nodejs', - engine: function engine() { - if (util.isBrowser() && typeof navigator !== 'undefined') { - return navigator.userAgent; - } else { - var engine = process.platform + '/' + process.version; - if (process.env.AWS_EXECUTION_ENV) { - engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV; - } - return engine; - } - }, +AWS.util.update(AWS.S3Control.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + request.addListener('extractError', this.extractHostId); + request.addListener('extractData', this.extractHostId); + request.addListener('validate', this.validateAccountId); - userAgent: function userAgent() { - var name = util.environment; - var agent = 'aws-sdk-' + name + '/' + (__nccwpck_require__(28437).VERSION); - if (name === 'nodejs') agent += ' ' + util.engine(); - return agent; - }, + var isArnInBucket = s3util.isArnInParam(request, 'Bucket'); + var isArnInName = s3util.isArnInParam(request, 'Name'); - uriEscape: function uriEscape(string) { - var output = encodeURIComponent(string); - output = output.replace(/[^A-Za-z0-9_.~\-%]+/g, escape); + if (isArnInBucket) { + request._parsedArn = AWS.util.ARN.parse(request.params['Bucket']); + request.addListener('validate', this.validateOutpostsBucketArn); + request.addListener('validate', s3util.validateOutpostsArn); + request.addListener('afterBuild', this.addOutpostIdHeader); + } else if (isArnInName) { + request._parsedArn = AWS.util.ARN.parse(request.params['Name']); + request.addListener('validate', s3util.validateOutpostsAccessPointArn); + request.addListener('validate', s3util.validateOutpostsArn); + request.addListener('afterBuild', this.addOutpostIdHeader); + } - // AWS percent-encodes some extra non-standard characters in a URI - output = output.replace(/[*]/g, function(ch) { - return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); - }); + if (isArnInBucket || isArnInName) { + request.addListener('validate', this.validateArnRegion); + request.addListener('validate', this.validateArnAccountWithParams, true); + request.addListener('validate', s3util.validateArnAccount); + request.addListener('validate', s3util.validateArnService); + request.addListener('build', this.populateParamFromArn, true); + request.addListener('build', this.populateUriFromArn); + request.addListener('build', s3util.validatePopulateUriFromArn); + } - return output; + if (request.params.OutpostId && + (request.operation === 'createBucket' || + request.operation === 'listRegionalBuckets')) { + request.addListener('build', this.populateEndpointForOutpostId); + } }, - uriEscapePath: function uriEscapePath(string) { - var parts = []; - util.arrayEach(string.split('/'), function (part) { - parts.push(util.uriEscape(part)); - }); - return parts.join('/'); + /** + * Adds outpostId header + */ + addOutpostIdHeader: function addOutpostIdHeader(req) { + req.httpRequest.headers['x-amz-outpost-id'] = req._parsedArn.outpostId; }, - urlParse: function urlParse(url) { - return util.url.parse(url); - }, + /** + * Validate Outposts ARN supplied in Bucket parameter is a valid bucket name + */ + validateOutpostsBucketArn: function validateOutpostsBucketArn(req) { + var parsedArn = req._parsedArn; - urlFormat: function urlFormat(url) { - return util.url.format(url); + //can be ':' or '/' + var delimiter = parsedArn.resource['outpost'.length]; + + if (parsedArn.resource.split(delimiter).length !== 4) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'Bucket ARN should have two resources outpost/{outpostId}/bucket/{accesspointName}' + }); + } + + var bucket = parsedArn.resource.split(delimiter)[3]; + if (!s3util.dnsCompatibleBucketName(bucket) || bucket.match(/\./)) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'Bucket ARN is not DNS compatible. Got ' + bucket + }); + } + + //set parsed valid bucket + req._parsedArn.bucket = bucket; }, - queryStringParse: function queryStringParse(qs) { - return util.querystring.parse(qs); + /** + * @api private + */ + populateParamFromArn: function populateParamFromArn(req) { + var parsedArn = req._parsedArn; + if (s3util.isArnInParam(req, 'Bucket')) { + req.params.Bucket = parsedArn.bucket; + } else if (s3util.isArnInParam(req, 'Name')) { + req.params.Name = parsedArn.accessPoint; + } }, - queryParamsToString: function queryParamsToString(params) { - var items = []; - var escape = util.uriEscape; - var sortedKeys = Object.keys(params).sort(); + /** + * Populate URI according to the ARN + */ + populateUriFromArn: function populateUriFromArn(req) { + var parsedArn = req._parsedArn; - util.arrayEach(sortedKeys, function(name) { - var value = params[name]; - var ename = escape(name); - var result = ename + '='; - if (Array.isArray(value)) { - var vals = []; - util.arrayEach(value, function(item) { vals.push(escape(item)); }); - result = ename + '=' + vals.sort().join('&' + ename + '='); - } else if (value !== undefined && value !== null) { - result = ename + '=' + escape(value); - } - items.push(result); - }); + var endpoint = req.httpRequest.endpoint; + var useArnRegion = req.service.config.s3UseArnRegion; + var useFipsEndpoint = req.service.config.useFipsEndpoint; - return items.join('&'); + endpoint.hostname = [ + 's3-outposts' + (useFipsEndpoint ? '-fips': ''), + useArnRegion ? parsedArn.region : req.service.config.region, + 'amazonaws.com' + ].join('.'); + endpoint.host = endpoint.hostname; }, - readFileSync: function readFileSync(path) { - if (util.isBrowser()) return null; - return (__nccwpck_require__(57147).readFileSync)(path, 'utf-8'); + /** + * @api private + */ + populateEndpointForOutpostId: function populateEndpointForOutpostId(req) { + var endpoint = req.httpRequest.endpoint; + var useFipsEndpoint = req.service.config.useFipsEndpoint; + endpoint.hostname = [ + 's3-outposts' + (useFipsEndpoint ? '-fips': ''), + req.service.config.region, + 'amazonaws.com' + ].join('.'); + endpoint.host = endpoint.hostname; }, - base64: { - encode: function encode64(string) { - if (typeof string === 'number') { - throw util.error(new Error('Cannot base64 encode number ' + string)); - } - if (string === null || typeof string === 'undefined') { - return string; - } - var buf = util.buffer.toBuffer(string); - return buf.toString('base64'); - }, - - decode: function decode64(string) { - if (typeof string === 'number') { - throw util.error(new Error('Cannot base64 decode number ' + string)); - } - if (string === null || typeof string === 'undefined') { - return string; - } - return util.buffer.toBuffer(string, 'base64'); + /** + * @api private + */ + extractHostId: function(response) { + var hostId = response.httpResponse.headers ? response.httpResponse.headers['x-amz-id-2'] : null; + response.extendedRequestId = hostId; + if (response.error) { + response.error.extendedRequestId = hostId; } - }, - buffer: { - /** - * Buffer constructor for Node buffer and buffer pollyfill - */ - toBuffer: function(data, encoding) { - return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ? - util.Buffer.from(data, encoding) : new util.Buffer(data, encoding); - }, + /** + * @api private + */ + validateArnRegion: function validateArnRegion(req) { + s3util.validateArnRegion(req, { allowFipsEndpoint: true }); + }, - alloc: function(size, fill, encoding) { - if (typeof size !== 'number') { - throw new Error('size passed to alloc must be a number.'); - } - if (typeof util.Buffer.alloc === 'function') { - return util.Buffer.alloc(size, fill, encoding); - } else { - var buf = new util.Buffer(size); - if (fill !== undefined && typeof buf.fill === 'function') { - buf.fill(fill, undefined, undefined, encoding); + /** + * @api private + */ + validateArnAccountWithParams: function validateArnAccountWithParams(req) { + var params = req.params; + var inputModel = req.service.api.operations[req.operation].input; + if (inputModel.members.AccountId) { + var parsedArn = req._parsedArn; + if (parsedArn.accountId) { + if (params.AccountId) { + if (params.AccountId !== parsedArn.accountId) { + throw AWS.util.error( + new Error(), + {code: 'ValidationError', message: 'AccountId in ARN and request params should be same.'} + ); + } + } else { + // Store accountId from ARN in params + params.AccountId = parsedArn.accountId; } - return buf; } - }, - - toStream: function toStream(buffer) { - if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer); - - var readable = new (util.stream.Readable)(); - var pos = 0; - readable._read = function(size) { - if (pos >= buffer.length) return readable.push(null); + } + }, - var end = pos + size; - if (end > buffer.length) end = buffer.length; - readable.push(buffer.slice(pos, end)); - pos = end; - }; + /** + * @api private + */ + validateAccountId: function(request) { + var params = request.params; + if (!Object.prototype.hasOwnProperty.call(params, 'AccountId')) return; + var accountId = params.AccountId; + //validate type + if (typeof accountId !== 'string') { + throw AWS.util.error( + new Error(), + {code: 'ValidationError', message: 'AccountId must be a string.'} + ); + } + //validate length + if (accountId.length < 1 || accountId.length > 63) { + throw AWS.util.error( + new Error(), + {code: 'ValidationError', message: 'AccountId length should be between 1 to 63 characters, inclusive.'} + ); + } + //validate pattern + var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; + if (!hostPattern.test(accountId)) { + throw AWS.util.error(new Error(), + {code: 'ValidationError', message: 'AccountId should be hostname compatible. AccountId: ' + accountId}); + } + }, - return readable; - }, + /** + * @api private + */ + getSigningName: function getSigningName(req) { + var _super = AWS.Service.prototype.getSigningName; + if (req && req._parsedArn && req._parsedArn.service) { + return req._parsedArn.service; + } else if (req.params.OutpostId && + (req.operation === 'createBucket' || + req.operation === 'listRegionalBuckets')) { + return 's3-outposts'; + } else { + return _super.call(this, req); + } + }, +}); - /** - * Concatenates a list of Buffer objects. - */ - concat: function(buffers) { - var length = 0, - offset = 0, - buffer = null, i; - for (i = 0; i < buffers.length; i++) { - length += buffers[i].length; - } +/***/ }), - buffer = util.buffer.alloc(length); +/***/ 35895: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (i = 0; i < buffers.length; i++) { - buffers[i].copy(buffer, offset); - offset += buffers[i].length; - } +var AWS = __nccwpck_require__(28437); +var regionUtil = __nccwpck_require__(18262); - return buffer; - } +var s3util = { + /** + * @api private + */ + isArnInParam: function isArnInParam(req, paramName) { + var inputShape = (req.service.api.operations[req.operation] || {}).input || {}; + var inputMembers = inputShape.members || {}; + if (!req.params[paramName] || !inputMembers[paramName]) return false; + return AWS.util.ARN.validate(req.params[paramName]); }, - string: { - byteLength: function byteLength(string) { - if (string === null || string === undefined) return 0; - if (typeof string === 'string') string = util.buffer.toBuffer(string); + /** + * Validate service component from ARN supplied in Bucket parameter + */ + validateArnService: function validateArnService(req) { + var parsedArn = req._parsedArn; - if (typeof string.byteLength === 'number') { - return string.byteLength; - } else if (typeof string.length === 'number') { - return string.length; - } else if (typeof string.size === 'number') { - return string.size; - } else if (typeof string.path === 'string') { - return (__nccwpck_require__(57147).lstatSync)(string.path).size; - } else { - throw util.error(new Error('Cannot determine length of ' + string), - { object: string }); - } - }, + if (parsedArn.service !== 's3' + && parsedArn.service !== 's3-outposts' + && parsedArn.service !== 's3-object-lambda') { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'expect \'s3\' or \'s3-outposts\' or \'s3-object-lambda\' in ARN service component' + }); + } + }, - upperFirst: function upperFirst(string) { - return string[0].toUpperCase() + string.substr(1); - }, + /** + * Validate account ID from ARN supplied in Bucket parameter is a valid account + */ + validateArnAccount: function validateArnAccount(req) { + var parsedArn = req._parsedArn; - lowerFirst: function lowerFirst(string) { - return string[0].toLowerCase() + string.substr(1); + if (!/[0-9]{12}/.exec(parsedArn.accountId)) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'ARN accountID does not match regex "[0-9]{12}"' + }); } }, - ini: { - parse: function string(ini) { - var currentSection, map = {}; - util.arrayEach(ini.split(/\r?\n/), function(line) { - line = line.split(/(^|\s)[;#]/)[0].trim(); // remove comments and trim - var isSection = line[0] === '[' && line[line.length - 1] === ']'; - if (isSection) { - currentSection = line.substring(1, line.length - 1); - if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') { - throw util.error( - new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.') - ); - } - } else if (currentSection) { - var indexOfEqualsSign = line.indexOf('='); - var start = 0; - var end = line.length - 1; - var isAssignment = - indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; + /** + * Validate ARN supplied in Bucket parameter is a valid access point ARN + */ + validateS3AccessPointArn: function validateS3AccessPointArn(req) { + var parsedArn = req._parsedArn; - if (isAssignment) { - var name = line.substring(0, indexOfEqualsSign).trim(); - var value = line.substring(indexOfEqualsSign + 1).trim(); + //can be ':' or '/' + var delimiter = parsedArn.resource['accesspoint'.length]; - map[currentSection] = map[currentSection] || {}; - map[currentSection][name] = value; - } - } + if (parsedArn.resource.split(delimiter).length !== 2) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'Access Point ARN should have one resource accesspoint/{accesspointName}' }); + } - return map; + var accessPoint = parsedArn.resource.split(delimiter)[1]; + var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; + if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint + }); } + + //set parsed valid access point + req._parsedArn.accessPoint = accessPoint; }, - fn: { - noop: function() {}, - callback: function (err) { if (err) throw err; }, + /** + * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN + */ + validateOutpostsArn: function validateOutpostsArn(req) { + var parsedArn = req._parsedArn; - /** - * Turn a synchronous function into as "async" function by making it call - * a callback. The underlying function is called with all but the last argument, - * which is treated as the callback. The callback is passed passed a first argument - * of null on success to mimick standard node callbacks. - */ - makeAsync: function makeAsync(fn, expectedArgs) { - if (expectedArgs && expectedArgs <= fn.length) { - return fn; - } + if ( + parsedArn.resource.indexOf('outpost:') !== 0 && + parsedArn.resource.indexOf('outpost/') !== 0 + ) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'ARN resource should begin with \'outpost/\'' + }); + } - return function() { - var args = Array.prototype.slice.call(arguments, 0); - var callback = args.pop(); - var result = fn.apply(null, args); - callback(result); - }; + //can be ':' or '/' + var delimiter = parsedArn.resource['outpost'.length]; + var outpostId = parsedArn.resource.split(delimiter)[1]; + var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!dnsHostRegex.test(outpostId)) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'Outpost resource in ARN is not DNS compatible. Got ' + outpostId + }); } + req._parsedArn.outpostId = outpostId; }, /** - * Date and time utility functions. + * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN */ - date: { - - /** - * @return [Date] the current JavaScript date object. Since all - * AWS services rely on this date object, you can override - * this function to provide a special time value to AWS service - * requests. - */ - getDate: function getDate() { - if (!AWS) AWS = __nccwpck_require__(28437); - if (AWS.config.systemClockOffset) { // use offset when non-zero - return new Date(new Date().getTime() + AWS.config.systemClockOffset); - } else { - return new Date(); - } - }, - - /** - * @return [String] the date in ISO-8601 format - */ - iso8601: function iso8601(date) { - if (date === undefined) { date = util.date.getDate(); } - return date.toISOString().replace(/\.\d{3}Z$/, 'Z'); - }, - - /** - * @return [String] the date in RFC 822 format - */ - rfc822: function rfc822(date) { - if (date === undefined) { date = util.date.getDate(); } - return date.toUTCString(); - }, - - /** - * @return [Integer] the UNIX timestamp value for the current time - */ - unixTimestamp: function unixTimestamp(date) { - if (date === undefined) { date = util.date.getDate(); } - return date.getTime() / 1000; - }, + validateOutpostsAccessPointArn: function validateOutpostsAccessPointArn(req) { + var parsedArn = req._parsedArn; - /** - * @param [String,number,Date] date - * @return [Date] - */ - from: function format(date) { - if (typeof date === 'number') { - return new Date(date * 1000); // unix timestamp - } else { - return new Date(date); - } - }, + //can be ':' or '/' + var delimiter = parsedArn.resource['outpost'.length]; - /** - * Given a Date or date-like value, this function formats the - * date into a string of the requested value. - * @param [String,number,Date] date - * @param [String] formatter Valid formats are: - # * 'iso8601' - # * 'rfc822' - # * 'unixTimestamp' - * @return [String] - */ - format: function format(date, formatter) { - if (!formatter) formatter = 'iso8601'; - return util.date[formatter](util.date.from(date)); - }, + if (parsedArn.resource.split(delimiter).length !== 4) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'Outposts ARN should have two resources outpost/{outpostId}/accesspoint/{accesspointName}' + }); + } - parseTimestamp: function parseTimestamp(value) { - if (typeof value === 'number') { // unix timestamp (number) - return new Date(value * 1000); - } else if (value.match(/^\d+$/)) { // unix timestamp - return new Date(value * 1000); - } else if (value.match(/^\d{4}/)) { // iso8601 - return new Date(value); - } else if (value.match(/^\w{3},/)) { // rfc822 - return new Date(value); - } else { - throw util.error( - new Error('unhandled timestamp format: ' + value), - {code: 'TimestampParserError'}); - } + var accessPoint = parsedArn.resource.split(delimiter)[3]; + var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; + if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint + }); } + //set parsed valid access point + req._parsedArn.accessPoint = accessPoint; }, - crypto: { - crc32Table: [ - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, - 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, - 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, - 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, - 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, - 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, - 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, - 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, - 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, - 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, - 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, - 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, - 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, - 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, - 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, - 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, - 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, - 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, - 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, - 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, - 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, - 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, - 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, - 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, - 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, - 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, - 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, - 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, - 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, - 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, - 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, - 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, - 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, - 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, - 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, - 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, - 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, - 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, - 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, - 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, - 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, - 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, - 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, - 0x2D02EF8D], - - crc32: function crc32(data) { - var tbl = util.crypto.crc32Table; - var crc = 0 ^ -1; + /** + * Validate region field in ARN supplied in Bucket parameter is a valid region + */ + validateArnRegion: function validateArnRegion(req, options) { + if (options === undefined) { + options = {}; + } - if (typeof data === 'string') { - data = util.buffer.toBuffer(data); - } + var useArnRegion = s3util.loadUseArnRegionConfig(req); + var regionFromArn = req._parsedArn.region; + var clientRegion = req.service.config.region; + var useFipsEndpoint = req.service.config.useFipsEndpoint; + var allowFipsEndpoint = options.allowFipsEndpoint || false; - for (var i = 0; i < data.length; i++) { - var code = data.readUInt8(i); - crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF]; + if (!regionFromArn) { + var message = 'ARN region is empty'; + if (req._parsedArn.service === 's3') { + message = message + '\nYou may want to use multi-regional ARN. The feature is not supported in current SDK. ' + + 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).'; } - return (crc ^ -1) >>> 0; - }, - - hmac: function hmac(key, string, digest, fn) { - if (!digest) digest = 'binary'; - if (digest === 'buffer') { digest = undefined; } - if (!fn) fn = 'sha256'; - if (typeof string === 'string') string = util.buffer.toBuffer(string); - return util.crypto.lib.createHmac(fn, key).update(string).digest(digest); - }, + throw AWS.util.error(new Error(), { + code: 'InvalidARN', + message: message + }); + } - md5: function md5(data, digest, callback) { - return util.crypto.hash('md5', data, digest, callback); - }, + if (useFipsEndpoint && !allowFipsEndpoint) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'ARN endpoint is not compatible with FIPS region' + }); + } - sha256: function sha256(data, digest, callback) { - return util.crypto.hash('sha256', data, digest, callback); - }, + if (regionFromArn.indexOf('fips') >= 0) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'FIPS region not allowed in ARN' + }); + } - hash: function(algorithm, data, digest, callback) { - var hash = util.crypto.createHash(algorithm); - if (!digest) { digest = 'binary'; } - if (digest === 'buffer') { digest = undefined; } - if (typeof data === 'string') data = util.buffer.toBuffer(data); - var sliceFn = util.arraySliceFn(data); - var isBuffer = util.Buffer.isBuffer(data); - //Identifying objects with an ArrayBuffer as buffers - if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true; + if (!useArnRegion && regionFromArn !== clientRegion) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'Configured region conflicts with access point region' + }); + } else if ( + useArnRegion && + regionUtil.getEndpointSuffix(regionFromArn) !== regionUtil.getEndpointSuffix(clientRegion) + ) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'Configured region and access point region not in same partition' + }); + } - if (callback && typeof data === 'object' && - typeof data.on === 'function' && !isBuffer) { - data.on('data', function(chunk) { hash.update(chunk); }); - data.on('error', function(err) { callback(err); }); - data.on('end', function() { callback(null, hash.digest(digest)); }); - } else if (callback && sliceFn && !isBuffer && - typeof FileReader !== 'undefined') { - // this might be a File/Blob - var index = 0, size = 1024 * 512; - var reader = new FileReader(); - reader.onerror = function() { - callback(new Error('Failed to read data.')); - }; - reader.onload = function() { - var buf = new util.Buffer(new Uint8Array(reader.result)); - hash.update(buf); - index += buf.length; - reader._continueReading(); - }; - reader._continueReading = function() { - if (index >= data.size) { - callback(null, hash.digest(digest)); - return; - } + if (req.service.config.useAccelerateEndpoint) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'useAccelerateEndpoint config is not supported with access point ARN' + }); + } - var back = index + size; - if (back > data.size) back = data.size; - reader.readAsArrayBuffer(sliceFn.call(data, index, back)); - }; + if (req._parsedArn.service === 's3-outposts' && req.service.config.useDualstackEndpoint) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'Dualstack is not supported with outposts access point ARN' + }); + } + }, - reader._continueReading(); - } else { - if (util.isBrowser() && typeof data === 'object' && !isBuffer) { - data = new util.Buffer(new Uint8Array(data)); + loadUseArnRegionConfig: function loadUseArnRegionConfig(req) { + var envName = 'AWS_S3_USE_ARN_REGION'; + var configName = 's3_use_arn_region'; + var useArnRegion = true; + var originalConfig = req.service._originalConfig || {}; + if (req.service.config.s3UseArnRegion !== undefined) { + return req.service.config.s3UseArnRegion; + } else if (originalConfig.s3UseArnRegion !== undefined) { + useArnRegion = originalConfig.s3UseArnRegion === true; + } else if (AWS.util.isNode()) { + //load from environmental variable AWS_USE_ARN_REGION + if (process.env[envName]) { + var value = process.env[envName].trim().toLowerCase(); + if (['false', 'true'].indexOf(value) < 0) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: envName + ' only accepts true or false. Got ' + process.env[envName], + retryable: false + }); + } + useArnRegion = value === 'true'; + } else { //load from shared config property use_arn_region + var profiles = {}; + var profile = {}; + try { + profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); + profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; + } catch (e) {} + if (profile[configName]) { + if (['false', 'true'].indexOf(profile[configName].trim().toLowerCase()) < 0) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: configName + ' only accepts true or false. Got ' + profile[configName], + retryable: false + }); + } + useArnRegion = profile[configName].trim().toLowerCase() === 'true'; } - var out = hash.update(data).digest(digest); - if (callback) callback(null, out); - return out; - } - }, - - toHex: function toHex(data) { - var out = []; - for (var i = 0; i < data.length; i++) { - out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2)); } - return out.join(''); - }, - - createHash: function createHash(algorithm) { - return util.crypto.lib.createHash(algorithm); } - + req.service.config.s3UseArnRegion = useArnRegion; + return useArnRegion; }, - /** @!ignore */ - - /* Abort constant */ - abort: {}, - - each: function each(object, iterFunction) { - for (var key in object) { - if (Object.prototype.hasOwnProperty.call(object, key)) { - var ret = iterFunction.call(this, key, object[key]); - if (ret === util.abort) break; - } + /** + * Validations before URI can be populated + */ + validatePopulateUriFromArn: function validatePopulateUriFromArn(req) { + if (req.service._originalConfig && req.service._originalConfig.endpoint) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'Custom endpoint is not compatible with access point ARN' + }); } - }, - arrayEach: function arrayEach(array, iterFunction) { - for (var idx in array) { - if (Object.prototype.hasOwnProperty.call(array, idx)) { - var ret = iterFunction.call(this, array[idx], parseInt(idx, 10)); - if (ret === util.abort) break; - } + if (req.service.config.s3ForcePathStyle) { + throw AWS.util.error(new Error(), { + code: 'InvalidConfiguration', + message: 'Cannot construct path-style endpoint with access point' + }); } }, - update: function update(obj1, obj2) { - util.each(obj2, function iterator(key, item) { - obj1[key] = item; - }); - return obj1; + /** + * Returns true if the bucket name is DNS compatible. Buckets created + * outside of the classic region MUST be DNS compatible. + * + * @api private + */ + dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) { + var b = bucketName; + var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/); + var ipAddress = new RegExp(/(\d+\.){3}\d+/); + var dots = new RegExp(/\.\./); + return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false; }, +}; - merge: function merge(obj1, obj2) { - return util.update(util.copy(obj1), obj2); - }, +/** + * @api private + */ +module.exports = s3util; - copy: function copy(object) { - if (object === null || object === undefined) return object; - var dupe = {}; - // jshint forin:false - for (var key in object) { - dupe[key] = object[key]; - } - return dupe; - }, - isEmpty: function isEmpty(obj) { - for (var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return false; - } - } - return true; - }, +/***/ }), - arraySliceFn: function arraySliceFn(obj) { - var fn = obj.slice || obj.webkitSlice || obj.mozSlice; - return typeof fn === 'function' ? fn : null; - }, +/***/ 94571: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - isType: function isType(obj, type) { - // handle cross-"frame" objects - if (typeof type === 'function') type = util.typeName(type); - return Object.prototype.toString.call(obj) === '[object ' + type + ']'; - }, +var AWS = __nccwpck_require__(28437); - typeName: function typeName(type) { - if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name; - var str = type.toString(); - var match = str.match(/^\s*function (.+)\(/); - return match ? match[1] : str; - }, +AWS.util.update(AWS.SQS.prototype, { + /** + * @api private + */ + setupRequestListeners: function setupRequestListeners(request) { + request.addListener('build', this.buildEndpoint); - error: function error(err, options) { - var originalError = null; - if (typeof err.message === 'string' && err.message !== '') { - if (typeof options === 'string' || (options && options.message)) { - originalError = util.copy(err); - originalError.message = err.message; + if (request.service.config.computeChecksums) { + if (request.operation === 'sendMessage') { + request.addListener('extractData', this.verifySendMessageChecksum); + } else if (request.operation === 'sendMessageBatch') { + request.addListener('extractData', this.verifySendMessageBatchChecksum); + } else if (request.operation === 'receiveMessage') { + request.addListener('extractData', this.verifyReceiveMessageChecksum); } } - err.message = err.message || null; - - if (typeof options === 'string') { - err.message = options; - } else if (typeof options === 'object' && options !== null) { - util.update(err, options); - if (options.message) - err.message = options.message; - if (options.code || options.name) - err.code = options.code || options.name; - if (options.stack) - err.stack = options.stack; - } - - if (typeof Object.defineProperty === 'function') { - Object.defineProperty(err, 'name', {writable: true, enumerable: false}); - Object.defineProperty(err, 'message', {enumerable: true}); - } + }, - err.name = String(options && options.name || err.name || err.code || 'Error'); - err.time = new Date(); + /** + * @api private + */ + verifySendMessageChecksum: function verifySendMessageChecksum(response) { + if (!response.data) return; - if (originalError) { - err.originalError = originalError; + var md5 = response.data.MD5OfMessageBody; + var body = this.params.MessageBody; + var calculatedMd5 = this.service.calculateChecksum(body); + if (calculatedMd5 !== md5) { + var msg = 'Got "' + response.data.MD5OfMessageBody + + '", expecting "' + calculatedMd5 + '".'; + this.service.throwInvalidChecksumError(response, + [response.data.MessageId], msg); } + }, + /** + * @api private + */ + verifySendMessageBatchChecksum: function verifySendMessageBatchChecksum(response) { + if (!response.data) return; - for (var key in options || {}) { - if (key[0] === '[' && key[key.length - 1] === ']') { - key = key.slice(1, -1); - if (key === 'code' || key === 'message') { - continue; + var service = this.service; + var entries = {}; + var errors = []; + var messageIds = []; + AWS.util.arrayEach(response.data.Successful, function (entry) { + entries[entry.Id] = entry; + }); + AWS.util.arrayEach(this.params.Entries, function (entry) { + if (entries[entry.Id]) { + var md5 = entries[entry.Id].MD5OfMessageBody; + var body = entry.MessageBody; + if (!service.isChecksumValid(md5, body)) { + errors.push(entry.Id); + messageIds.push(entries[entry.Id].MessageId); } - err['[' + key + ']'] = 'See error.' + key + ' for details.'; - Object.defineProperty(err, key, { - value: err[key] || (options && options[key]) || (originalError && originalError[key]), - enumerable: false, - writable: true - }); } - } + }); - return err; + if (errors.length > 0) { + service.throwInvalidChecksumError(response, messageIds, + 'Invalid messages: ' + errors.join(', ')); + } }, /** * @api private */ - inherit: function inherit(klass, features) { - var newObject = null; - if (features === undefined) { - features = klass; - klass = Object; - newObject = {}; - } else { - var ctor = function ConstructorWrapper() {}; - ctor.prototype = klass.prototype; - newObject = new ctor(); - } + verifyReceiveMessageChecksum: function verifyReceiveMessageChecksum(response) { + if (!response.data) return; - // constructor not supplied, create pass-through ctor - if (features.constructor === Object) { - features.constructor = function() { - if (klass !== Object) { - return klass.apply(this, arguments); - } - }; - } + var service = this.service; + var messageIds = []; + AWS.util.arrayEach(response.data.Messages, function(message) { + var md5 = message.MD5OfBody; + var body = message.Body; + if (!service.isChecksumValid(md5, body)) { + messageIds.push(message.MessageId); + } + }); - features.constructor.prototype = newObject; - util.update(features.constructor.prototype, features); - features.constructor.__super__ = klass; - return features.constructor; + if (messageIds.length > 0) { + service.throwInvalidChecksumError(response, messageIds, + 'Invalid messages: ' + messageIds.join(', ')); + } }, /** * @api private */ - mixin: function mixin() { - var klass = arguments[0]; - for (var i = 1; i < arguments.length; i++) { - // jshint forin:false - for (var prop in arguments[i].prototype) { - var fn = arguments[i].prototype[prop]; - if (prop !== 'constructor') { - klass.prototype[prop] = fn; - } - } - } - return klass; + throwInvalidChecksumError: function throwInvalidChecksumError(response, ids, message) { + response.error = AWS.util.error(new Error(), { + retryable: true, + code: 'InvalidChecksum', + messageIds: ids, + message: response.request.operation + + ' returned an invalid MD5 response. ' + message + }); }, /** * @api private */ - hideProperties: function hideProperties(obj, props) { - if (typeof Object.defineProperty !== 'function') return; + isChecksumValid: function isChecksumValid(checksum, data) { + return this.calculateChecksum(data) === checksum; + }, - util.arrayEach(props, function (key) { - Object.defineProperty(obj, key, { - enumerable: false, writable: true, configurable: true }); - }); + /** + * @api private + */ + calculateChecksum: function calculateChecksum(data) { + return AWS.util.crypto.md5(data, 'hex'); }, /** * @api private */ - property: function property(obj, name, value, enumerable, isValue) { - var opts = { - configurable: true, - enumerable: enumerable !== undefined ? enumerable : true - }; - if (typeof value === 'function' && !isValue) { - opts.get = value; - } - else { - opts.value = value; opts.writable = true; + buildEndpoint: function buildEndpoint(request) { + var url = request.httpRequest.params.QueueUrl; + if (url) { + request.httpRequest.endpoint = new AWS.Endpoint(url); + + // signature version 4 requires the region name to be set, + // sqs queue urls contain the region name + var matches = request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./); + if (matches) request.httpRequest.region = matches[1]; } + } +}); - Object.defineProperty(obj, name, opts); + +/***/ }), + +/***/ 91055: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var resolveRegionalEndpointsFlag = __nccwpck_require__(85566); +var ENV_REGIONAL_ENDPOINT_ENABLED = 'AWS_STS_REGIONAL_ENDPOINTS'; +var CONFIG_REGIONAL_ENDPOINT_ENABLED = 'sts_regional_endpoints'; + +AWS.util.update(AWS.STS.prototype, { + /** + * @overload credentialsFrom(data, credentials = null) + * Creates a credentials object from STS response data containing + * credentials information. Useful for quickly setting AWS credentials. + * + * @note This is a low-level utility function. If you want to load temporary + * credentials into your process for subsequent requests to AWS resources, + * you should use {AWS.TemporaryCredentials} instead. + * @param data [map] data retrieved from a call to {getFederatedToken}, + * {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}. + * @param credentials [AWS.Credentials] an optional credentials object to + * fill instead of creating a new object. Useful when modifying an + * existing credentials object from a refresh call. + * @return [AWS.TemporaryCredentials] the set of temporary credentials + * loaded from a raw STS operation response. + * @example Using credentialsFrom to load global AWS credentials + * var sts = new AWS.STS(); + * sts.getSessionToken(function (err, data) { + * if (err) console.log("Error getting credentials"); + * else { + * AWS.config.credentials = sts.credentialsFrom(data); + * } + * }); + * @see AWS.TemporaryCredentials + */ + credentialsFrom: function credentialsFrom(data, credentials) { + if (!data) return null; + if (!credentials) credentials = new AWS.TemporaryCredentials(); + credentials.expired = false; + credentials.accessKeyId = data.Credentials.AccessKeyId; + credentials.secretAccessKey = data.Credentials.SecretAccessKey; + credentials.sessionToken = data.Credentials.SessionToken; + credentials.expireTime = data.Credentials.Expiration; + return credentials; + }, + + assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) { + return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback); + }, + + assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) { + return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback); }, /** * @api private */ - memoizedProperty: function memoizedProperty(obj, name, get, enumerable) { - var cachedValue = null; - - // build enumerable attribute for each value with lazy accessor. - util.property(obj, name, function() { - if (cachedValue === null) { - cachedValue = get(); - } - return cachedValue; - }, enumerable); + setupRequestListeners: function setupRequestListeners(request) { + request.addListener('validate', this.optInRegionalEndpoint, true); }, /** - * TODO Remove in major version revision - * This backfill populates response data without the - * top-level payload name. - * * @api private */ - hoistPayloadMember: function hoistPayloadMember(resp) { - var req = resp.request; - var operationName = req.operation; - var operation = req.service.api.operations[operationName]; - var output = operation.output; - if (output.payload && !operation.hasEventOutput) { - var payloadMember = output.members[output.payload]; - var responsePayload = resp.data[output.payload]; - if (payloadMember.type === 'structure') { - util.each(responsePayload, function(key, value) { - util.property(resp.data, key, value, false); - }); + optInRegionalEndpoint: function optInRegionalEndpoint(req) { + var service = req.service; + var config = service.config; + config.stsRegionalEndpoints = resolveRegionalEndpointsFlag(service._originalConfig, { + env: ENV_REGIONAL_ENDPOINT_ENABLED, + sharedConfig: CONFIG_REGIONAL_ENDPOINT_ENABLED, + clientConfig: 'stsRegionalEndpoints' + }); + if ( + config.stsRegionalEndpoints === 'regional' && + service.isGlobalEndpoint + ) { + //client will throw if region is not supplied; request will be signed with specified region + if (!config.region) { + throw AWS.util.error(new Error(), + {code: 'ConfigError', message: 'Missing region in config'}); } + var insertPoint = config.endpoint.indexOf('.amazonaws.com'); + var regionalEndpoint = config.endpoint.substring(0, insertPoint) + + '.' + config.region + config.endpoint.substring(insertPoint); + req.httpRequest.updateEndpoint(regionalEndpoint); + req.httpRequest.region = config.region; } + } + +}); + + +/***/ }), + +/***/ 31987: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +AWS.util.hideProperties(AWS, ['SimpleWorkflow']); + +/** + * @constant + * @readonly + * Backwards compatibility for access to the {AWS.SWF} service class. + */ +AWS.SimpleWorkflow = AWS.SWF; + + +/***/ }), + +/***/ 29697: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var IniLoader = (__nccwpck_require__(95417).IniLoader); +/** + * Singleton object to load specified config/credentials files. + * It will cache all the files ever loaded; + */ +module.exports.b = new IniLoader(); + + +/***/ }), + +/***/ 95417: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var os = __nccwpck_require__(22037); +var path = __nccwpck_require__(71017); + +function parseFile(filename) { + return AWS.util.ini.parse(AWS.util.readFileSync(filename)); +} + +function getProfiles(fileContent) { + var tmpContent = {}; + Object.keys(fileContent).forEach(function(sectionName) { + if (/^sso-session\s/.test(sectionName)) return; + Object.defineProperty(tmpContent, sectionName.replace(/^profile\s/, ''), { + value: fileContent[sectionName], + enumerable: true + }); + }); + return tmpContent; +} + +function getSsoSessions(fileContent) { + var tmpContent = {}; + Object.keys(fileContent).forEach(function(sectionName) { + if (!/^sso-session\s/.test(sectionName)) return; + Object.defineProperty(tmpContent, sectionName.replace(/^sso-session\s/, ''), { + value: fileContent[sectionName], + enumerable: true + }); + }); + return tmpContent; +} + +/** + * Ini file loader class the same as that used in the SDK. It loads and + * parses config and credentials files in .ini format and cache the content + * to assure files are only read once. + * Note that calling operations on the instance instantiated from this class + * won't affect the behavior of SDK since SDK uses an internal singleton of + * this class. + * @!macro nobrowser + */ +AWS.IniLoader = AWS.util.inherit({ + constructor: function IniLoader() { + this.resolvedProfiles = {}; + this.resolvedSsoSessions = {}; + }, + + /** Remove all cached files. Used after config files are updated. */ + clearCachedFiles: function clearCachedFiles() { + this.resolvedProfiles = {}; + this.resolvedSsoSessions = {}; }, /** - * Compute SHA-256 checksums of streams + * Load configurations from config/credentials files and cache them + * for later use. If no file is specified it will try to load default files. * - * @api private - */ - computeSha256: function computeSha256(body, done) { - if (util.isNode()) { - var Stream = util.stream.Stream; - var fs = __nccwpck_require__(57147); - if (typeof Stream === 'function' && body instanceof Stream) { - if (typeof body.path === 'string') { // assume file object - var settings = {}; - if (typeof body.start === 'number') { - settings.start = body.start; - } - if (typeof body.end === 'number') { - settings.end = body.end; - } - body = fs.createReadStream(body.path, settings); - } else { // TODO support other stream types - return done(new Error('Non-file stream objects are ' + - 'not supported with SigV4')); - } + * @param options [map] information describing the file + * @option options filename [String] ('~/.aws/credentials' or defined by + * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if + * isConfig is set to true) + * path to the file to be read. + * @option options isConfig [Boolean] (false) True to read config file. + * @return [map] object containing contents from file in key-value + * pairs. + */ + loadFrom: function loadFrom(options) { + options = options || {}; + var isConfig = options.isConfig === true; + var filename = options.filename || this.getDefaultFilePath(isConfig); + if (!this.resolvedProfiles[filename]) { + var fileContent = parseFile(filename); + if (isConfig) { + Object.defineProperty(this.resolvedProfiles, filename, { + value: getProfiles(fileContent) + }); + } else { + Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent }); } } - - util.crypto.sha256(body, 'hex', function(err, sha) { - if (err) done(err); - else done(null, sha); - }); + return this.resolvedProfiles[filename]; }, /** - * @api private + * Load sso sessions from config/credentials files and cache them + * for later use. If no file is specified it will try to load default file. + * + * @param options [map] information describing the file + * @option options filename [String] ('~/.aws/config' or defined by + * AWS_CONFIG_FILE process env var) + * @return [map] object containing contents from file in key-value + * pairs. */ - isClockSkewed: function isClockSkewed(serverTime) { - if (serverTime) { - util.property(AWS.config, 'isClockSkewed', - Math.abs(new Date().getTime() - serverTime) >= 300000, false); - return AWS.config.isClockSkewed; + loadSsoSessionsFrom: function loadSsoSessionsFrom(options) { + options = options || {}; + var filename = options.filename || this.getDefaultFilePath(true); + if (!this.resolvedSsoSessions[filename]) { + var fileContent = parseFile(filename); + Object.defineProperty(this.resolvedSsoSessions, filename, { + value: getSsoSessions(fileContent) + }); } + return this.resolvedSsoSessions[filename]; }, - applyClockOffset: function applyClockOffset(serverTime) { - if (serverTime) - AWS.config.systemClockOffset = serverTime - new Date().getTime(); + getDefaultFilePath: function getDefaultFilePath(isConfig) { + return path.join( + this.getHomeDir(), + '.aws', + isConfig ? 'config' : 'credentials' + ); }, - /** - * @api private - */ - extractRequestId: function extractRequestId(resp) { - var requestId = resp.httpResponse.headers['x-amz-request-id'] || - resp.httpResponse.headers['x-amzn-requestid']; + getHomeDir: function getHomeDir() { + var env = process.env; + var home = env.HOME || + env.USERPROFILE || + (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null); - if (!requestId && resp.data && resp.data.ResponseMetadata) { - requestId = resp.data.ResponseMetadata.RequestId; + if (home) { + return home; } - if (requestId) { - resp.requestId = requestId; + if (typeof os.homedir === 'function') { + return os.homedir(); } - if (resp.error) { - resp.error.requestId = requestId; - } - }, + throw AWS.util.error( + new Error('Cannot load credentials, HOME path not set') + ); + } +}); - /** - * @api private - */ - addPromises: function addPromises(constructors, PromiseDependency) { - var deletePromises = false; - if (PromiseDependency === undefined && AWS && AWS.config) { - PromiseDependency = AWS.config.getPromisesDependency(); - } - if (PromiseDependency === undefined && typeof Promise !== 'undefined') { - PromiseDependency = Promise; - } - if (typeof PromiseDependency !== 'function') deletePromises = true; - if (!Array.isArray(constructors)) constructors = [constructors]; +var IniLoader = AWS.IniLoader; - for (var ind = 0; ind < constructors.length; ind++) { - var constructor = constructors[ind]; - if (deletePromises) { - if (constructor.deletePromisesFromClass) { - constructor.deletePromisesFromClass(); - } - } else if (constructor.addPromisesToClass) { - constructor.addPromisesToClass(PromiseDependency); - } - } - }, +module.exports = { + IniLoader: IniLoader +}; - /** - * @api private - * Return a function that will return a promise whose fate is decided by the - * callback behavior of the given method with `methodName`. The method to be - * promisified should conform to node.js convention of accepting a callback as - * last argument and calling that callback with error as the first argument - * and success value on the second argument. - */ - promisifyMethod: function promisifyMethod(methodName, PromiseDependency) { - return function promise() { - var self = this; - var args = Array.prototype.slice.call(arguments); - return new PromiseDependency(function(resolve, reject) { - args.push(function(err, data) { - if (err) { - reject(err); - } else { - resolve(data); - } - }); - self[methodName].apply(self, args); - }); - }; - }, - /** - * @api private - */ - isDualstackAvailable: function isDualstackAvailable(service) { - if (!service) return false; - var metadata = __nccwpck_require__(17752); - if (typeof service !== 'string') service = service.serviceIdentifier; - if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false; - return !!metadata[service].dualstackAvailable; - }, +/***/ }), - /** - * @api private - */ - calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) { - if (!retryDelayOptions) retryDelayOptions = {}; - var customBackoff = retryDelayOptions.customBackoff || null; - if (typeof customBackoff === 'function') { - return customBackoff(retryCount, err); - } - var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100; - var delay = Math.random() * (Math.pow(2, retryCount) * base); - return delay; +/***/ 98382: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +/** + * @api private + */ +AWS.Signers.Bearer = AWS.util.inherit(AWS.Signers.RequestSigner, { + constructor: function Bearer(request) { + AWS.Signers.RequestSigner.call(this, request); }, - /** - * @api private - */ - handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) { - if (!options) options = {}; - var http = AWS.HttpClient.getInstance(); - var httpOptions = options.httpOptions || {}; - var retryCount = 0; + addAuthorization: function addAuthorization(token) { + this.request.headers['Authorization'] = 'Bearer ' + token.token; + } +}); - var errCallback = function(err) { - var maxRetries = options.maxRetries || 0; - if (err && err.code === 'TimeoutError') err.retryable = true; - // Call `calculateRetryDelay()` only when relevant, see #3401 - if (err && err.retryable && retryCount < maxRetries) { - var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err); - if (delay >= 0) { - retryCount++; - setTimeout(sendRequest, delay + (err.retryAfter || 0)); - return; - } - } - cb(err); - }; +/***/ }), - var sendRequest = function() { - var data = ''; - http.handleRequest(httpRequest, httpOptions, function(httpResponse) { - httpResponse.on('data', function(chunk) { data += chunk.toString(); }); - httpResponse.on('end', function() { - var statusCode = httpResponse.statusCode; - if (statusCode < 300) { - cb(null, data); - } else { - var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0; - var err = util.error(new Error(), - { - statusCode: statusCode, - retryable: statusCode >= 500 || statusCode === 429 - } - ); - if (retryAfter && err.retryable) err.retryAfter = retryAfter; - errCallback(err); - } - }); - }, errCallback); - }; +/***/ 60328: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - AWS.util.defer(sendRequest); - }, +var AWS = __nccwpck_require__(28437); +var inherit = AWS.util.inherit; - /** - * @api private - */ - uuid: { - v4: function uuidV4() { - return (__nccwpck_require__(57821).v4)(); - } - }, +/** + * @api private + */ +var expiresHeader = 'presigned-expires'; - /** - * @api private - */ - convertPayloadToString: function convertPayloadToString(resp) { - var req = resp.request; - var operation = req.operation; - var rules = req.service.api.operations[operation].output || {}; - if (rules.payload && resp.data[rules.payload]) { - resp.data[rules.payload] = resp.data[rules.payload].toString(); +/** + * @api private + */ +function signedUrlBuilder(request) { + var expires = request.httpRequest.headers[expiresHeader]; + var signerClass = request.service.getSignerClass(request); + + delete request.httpRequest.headers['User-Agent']; + delete request.httpRequest.headers['X-Amz-User-Agent']; + + if (signerClass === AWS.Signers.V4) { + if (expires > 604800) { // one week expiry is invalid + var message = 'Presigning does not support expiry time greater ' + + 'than a week with SigV4 signing.'; + throw AWS.util.error(new Error(), { + code: 'InvalidExpiryTime', message: message, retryable: false + }); } - }, + request.httpRequest.headers[expiresHeader] = expires; + } else if (signerClass === AWS.Signers.S3) { + var now = request.service ? request.service.getSkewCorrectedDate() : AWS.util.date.getDate(); + request.httpRequest.headers[expiresHeader] = parseInt( + AWS.util.date.unixTimestamp(now) + expires, 10).toString(); + } else { + throw AWS.util.error(new Error(), { + message: 'Presigning only supports S3 or SigV4 signing.', + code: 'UnsupportedSigner', retryable: false + }); + } +} + +/** + * @api private + */ +function signedUrlSigner(request) { + var endpoint = request.httpRequest.endpoint; + var parsedUrl = AWS.util.urlParse(request.httpRequest.path); + var queryParams = {}; + + if (parsedUrl.search) { + queryParams = AWS.util.queryStringParse(parsedUrl.search.substr(1)); + } + var auth = request.httpRequest.headers['Authorization'].split(' '); + if (auth[0] === 'AWS') { + auth = auth[1].split(':'); + queryParams['Signature'] = auth.pop(); + queryParams['AWSAccessKeyId'] = auth.join(':'); + + AWS.util.each(request.httpRequest.headers, function (key, value) { + if (key === expiresHeader) key = 'Expires'; + if (key.indexOf('x-amz-meta-') === 0) { + // Delete existing, potentially not normalized key + delete queryParams[key]; + key = key.toLowerCase(); + } + queryParams[key] = value; + }); + delete request.httpRequest.headers[expiresHeader]; + delete queryParams['Authorization']; + delete queryParams['Host']; + } else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing + auth.shift(); + var rest = auth.join(' '); + var signature = rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1]; + queryParams['X-Amz-Signature'] = signature; + delete queryParams['Expires']; + } + + // build URL + endpoint.pathname = parsedUrl.pathname; + endpoint.search = AWS.util.queryParamsToString(queryParams); +} + +/** + * @api private + */ +AWS.Signers.Presign = inherit({ /** * @api private */ - defer: function defer(callback) { - if (typeof process === 'object' && typeof process.nextTick === 'function') { - process.nextTick(callback); - } else if (typeof setImmediate === 'function') { - setImmediate(callback); + sign: function sign(request, expireTime, callback) { + request.httpRequest.headers[expiresHeader] = expireTime || 3600; + request.on('build', signedUrlBuilder); + request.on('sign', signedUrlSigner); + request.removeListener('afterBuild', + AWS.EventListeners.Core.SET_CONTENT_LENGTH); + request.removeListener('afterBuild', + AWS.EventListeners.Core.COMPUTE_SHA256); + + request.emit('beforePresign', [request]); + + if (callback) { + request.build(function() { + if (this.response.error) callback(this.response.error); + else { + callback(null, AWS.util.urlFormat(request.httpRequest.endpoint)); + } + }); } else { - setTimeout(callback, 0); + request.build(); + if (request.response.error) throw request.response.error; + return AWS.util.urlFormat(request.httpRequest.endpoint); } + } +}); + +/** + * @api private + */ +module.exports = AWS.Signers.Presign; + + +/***/ }), + +/***/ 9897: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); + +var inherit = AWS.util.inherit; + +/** + * @api private + */ +AWS.Signers.RequestSigner = inherit({ + constructor: function RequestSigner(request) { + this.request = request; }, - /** - * @api private - */ - getRequestPayloadShape: function getRequestPayloadShape(req) { - var operations = req.service.api.operations; - if (!operations) return undefined; - var operation = (operations || {})[req.operation]; - if (!operation || !operation.input || !operation.input.payload) return undefined; - return operation.input.members[operation.input.payload]; + setServiceClientId: function setServiceClientId(id) { + this.serviceClientId = id; }, - getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) { - var profiles = {}; - var profilesFromConfig = {}; - if (process.env[util.configOptInEnv]) { - var profilesFromConfig = iniLoader.loadFrom({ - isConfig: true, - filename: process.env[util.sharedConfigFileEnv] - }); - } - var profilesFromCreds= {}; - try { - var profilesFromCreds = iniLoader.loadFrom({ - filename: filename || - (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]) - }); - } catch (error) { - // if using config, assume it is fully descriptive without a credentials file: - if (!process.env[util.configOptInEnv]) throw error; - } - for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) { - profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromConfig[profileNames[i]]); - } - for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) { - profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromCreds[profileNames[i]]); - } - return profiles; + getServiceClientId: function getServiceClientId() { + return this.serviceClientId; + } +}); - /** - * Roughly the semantics of `Object.assign(target, source)` - */ - function objectAssign(target, source) { - for (var i = 0, keys = Object.keys(source); i < keys.length; i++) { - target[keys[i]] = source[keys[i]]; - } - return target; - } - }, +AWS.Signers.RequestSigner.getVersion = function getVersion(version) { + switch (version) { + case 'v2': return AWS.Signers.V2; + case 'v3': return AWS.Signers.V3; + case 's3v4': return AWS.Signers.V4; + case 'v4': return AWS.Signers.V4; + case 's3': return AWS.Signers.S3; + case 'v3https': return AWS.Signers.V3Https; + case 'bearer': return AWS.Signers.Bearer; + } + throw new Error('Unknown signing version ' + version); +}; + +__nccwpck_require__(28489); +__nccwpck_require__(66458); +__nccwpck_require__(24473); +__nccwpck_require__(26529); +__nccwpck_require__(58616); +__nccwpck_require__(60328); +__nccwpck_require__(98382); + + +/***/ }), +/***/ 58616: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var AWS = __nccwpck_require__(28437); +var inherit = AWS.util.inherit; + +/** + * @api private + */ +AWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, { /** - * @api private + * When building the stringToSign, these sub resource params should be + * part of the canonical resource string with their NON-decoded values */ - ARN: { - validate: function validateARN(str) { - return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6; - }, - parse: function parseARN(arn) { - var matched = arn.split(':'); - return { - partition: matched[1], - service: matched[2], - region: matched[3], - accountId: matched[4], - resource: matched.slice(5).join(':') - }; - }, - build: function buildARN(arnObject) { - if ( - arnObject.service === undefined || - arnObject.region === undefined || - arnObject.accountId === undefined || - arnObject.resource === undefined - ) throw util.error(new Error('Input ARN object is invalid')); - return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service + - ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource; - } + subResources: { + 'acl': 1, + 'accelerate': 1, + 'analytics': 1, + 'cors': 1, + 'lifecycle': 1, + 'delete': 1, + 'inventory': 1, + 'location': 1, + 'logging': 1, + 'metrics': 1, + 'notification': 1, + 'partNumber': 1, + 'policy': 1, + 'requestPayment': 1, + 'replication': 1, + 'restore': 1, + 'tagging': 1, + 'torrent': 1, + 'uploadId': 1, + 'uploads': 1, + 'versionId': 1, + 'versioning': 1, + 'versions': 1, + 'website': 1 + }, + + // when building the stringToSign, these querystring params should be + // part of the canonical resource string with their NON-encoded values + responseHeaders: { + 'response-content-type': 1, + 'response-content-language': 1, + 'response-expires': 1, + 'response-cache-control': 1, + 'response-content-disposition': 1, + 'response-content-encoding': 1 }, - /** - * @api private - */ - defaultProfile: 'default', + addAuthorization: function addAuthorization(credentials, date) { + if (!this.request.headers['presigned-expires']) { + this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date); + } - /** - * @api private - */ - configOptInEnv: 'AWS_SDK_LOAD_CONFIG', + if (credentials.sessionToken) { + // presigned URLs require this header to be lowercased + this.request.headers['x-amz-security-token'] = credentials.sessionToken; + } - /** - * @api private - */ - sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE', + var signature = this.sign(credentials.secretAccessKey, this.stringToSign()); + var auth = 'AWS ' + credentials.accessKeyId + ':' + signature; - /** - * @api private - */ - sharedConfigFileEnv: 'AWS_CONFIG_FILE', + this.request.headers['Authorization'] = auth; + }, - /** - * @api private - */ - imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED' -}; + stringToSign: function stringToSign() { + var r = this.request; -/** - * @api private - */ -module.exports = util; + var parts = []; + parts.push(r.method); + parts.push(r.headers['Content-MD5'] || ''); + parts.push(r.headers['Content-Type'] || ''); + // This is the "Date" header, but we use X-Amz-Date. + // The S3 signing mechanism requires us to pass an empty + // string for this Date header regardless. + parts.push(r.headers['presigned-expires'] || ''); -/***/ }), + var headers = this.canonicalizedAmzHeaders(); + if (headers) parts.push(headers); + parts.push(this.canonicalizedResource()); -/***/ 23546: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return parts.join('\n'); -var util = __nccwpck_require__(77985); -var XmlNode = (__nccwpck_require__(20397).XmlNode); -var XmlText = (__nccwpck_require__(90971).XmlText); + }, -function XmlBuilder() { } + canonicalizedAmzHeaders: function canonicalizedAmzHeaders() { -XmlBuilder.prototype.toXML = function(params, shape, rootElement, noEmpty) { - var xml = new XmlNode(rootElement); - applyNamespaces(xml, shape, true); - serialize(xml, params, shape); - return xml.children.length > 0 || noEmpty ? xml.toString() : ''; -}; + var amzHeaders = []; -function serialize(xml, value, shape) { - switch (shape.type) { - case 'structure': return serializeStructure(xml, value, shape); - case 'map': return serializeMap(xml, value, shape); - case 'list': return serializeList(xml, value, shape); - default: return serializeScalar(xml, value, shape); - } -} + AWS.util.each(this.request.headers, function (name) { + if (name.match(/^x-amz-/i)) + amzHeaders.push(name); + }); -function serializeStructure(xml, params, shape) { - util.arrayEach(shape.memberNames, function(memberName) { - var memberShape = shape.members[memberName]; - if (memberShape.location !== 'body') return; + amzHeaders.sort(function (a, b) { + return a.toLowerCase() < b.toLowerCase() ? -1 : 1; + }); - var value = params[memberName]; - var name = memberShape.name; - if (value !== undefined && value !== null) { - if (memberShape.isXmlAttribute) { - xml.addAttribute(name, value); - } else if (memberShape.flattened) { - serialize(xml, value, memberShape); - } else { - var element = new XmlNode(name); - xml.addChildNode(element); - applyNamespaces(element, memberShape); - serialize(element, value, memberShape); - } - } - }); -} + var parts = []; + AWS.util.arrayEach.call(this, amzHeaders, function (name) { + parts.push(name.toLowerCase() + ':' + String(this.request.headers[name])); + }); -function serializeMap(xml, map, shape) { - var xmlKey = shape.key.name || 'key'; - var xmlValue = shape.value.name || 'value'; + return parts.join('\n'); - util.each(map, function(key, value) { - var entry = new XmlNode(shape.flattened ? shape.name : 'entry'); - xml.addChildNode(entry); + }, - var entryKey = new XmlNode(xmlKey); - var entryValue = new XmlNode(xmlValue); - entry.addChildNode(entryKey); - entry.addChildNode(entryValue); + canonicalizedResource: function canonicalizedResource() { - serialize(entryKey, key, shape.key); - serialize(entryValue, value, shape.value); - }); -} + var r = this.request; -function serializeList(xml, list, shape) { - if (shape.flattened) { - util.arrayEach(list, function(value) { - var name = shape.member.name || shape.name; - var element = new XmlNode(name); - xml.addChildNode(element); - serialize(element, value, shape.member); - }); - } else { - util.arrayEach(list, function(value) { - var name = shape.member.name || 'member'; - var element = new XmlNode(name); - xml.addChildNode(element); - serialize(element, value, shape.member); - }); - } -} + var parts = r.path.split('?'); + var path = parts[0]; + var querystring = parts[1]; -function serializeScalar(xml, value, shape) { - xml.addChildNode( - new XmlText(shape.toWireFormat(value)) - ); -} + var resource = ''; -function applyNamespaces(xml, shape, isRoot) { - var uri, prefix = 'xmlns'; - if (shape.xmlNamespaceUri) { - uri = shape.xmlNamespaceUri; - if (shape.xmlNamespacePrefix) prefix += ':' + shape.xmlNamespacePrefix; - } else if (isRoot && shape.api.xmlNamespaceUri) { - uri = shape.api.xmlNamespaceUri; - } + if (r.virtualHostedBucket) + resource += '/' + r.virtualHostedBucket; - if (uri) xml.addAttribute(prefix, uri); -} + resource += path; -/** - * @api private - */ -module.exports = XmlBuilder; + if (querystring) { + // collect a list of sub resources and query params that need to be signed + var resources = []; -/***/ }), + AWS.util.arrayEach.call(this, querystring.split('&'), function (param) { + var name = param.split('=')[0]; + var value = param.split('=')[1]; + if (this.subResources[name] || this.responseHeaders[name]) { + var subresource = { name: name }; + if (value !== undefined) { + if (this.subResources[name]) { + subresource.value = value; + } else { + subresource.value = decodeURIComponent(value); + } + } + resources.push(subresource); + } + }); -/***/ 98241: -/***/ ((module) => { + resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; }); -/** - * Escapes characters that can not be in an XML attribute. - */ -function escapeAttribute(value) { - return value.replace(/&/g, '&').replace(/'/g, ''').replace(//g, '>').replace(/"/g, '"'); -} + if (resources.length) { -/** - * @api private - */ -module.exports = { - escapeAttribute: escapeAttribute -}; + querystring = []; + AWS.util.arrayEach(resources, function (res) { + if (res.value === undefined) { + querystring.push(res.name); + } else { + querystring.push(res.name + '=' + res.value); + } + }); + resource += '?' + querystring.join('&'); + } -/***/ }), + } -/***/ 98464: -/***/ ((module) => { + return resource; -/** - * Escapes characters that can not be in an XML element. - */ -function escapeElement(value) { - return value.replace(/&/g, '&') - .replace(//g, '>') - .replace(/\r/g, ' ') - .replace(/\n/g, ' ') - .replace(/\u0085/g, '…') - .replace(/\u2028/, '
'); -} + }, + + sign: function sign(secret, string) { + return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1'); + } +}); /** * @api private */ -module.exports = { - escapeElement: escapeElement -}; +module.exports = AWS.Signers.S3; /***/ }), -/***/ 96752: +/***/ 28489: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var AWS = __nccwpck_require__(28437); -var util = AWS.util; -var Shape = AWS.Model.Shape; - -var xml2js = __nccwpck_require__(66189); +var inherit = AWS.util.inherit; /** * @api private */ -var options = { // options passed to xml2js parser - explicitCharkey: false, // undocumented - trim: false, // trim the leading/trailing whitespace from text nodes - normalize: false, // trim interior whitespace inside text nodes - explicitRoot: false, // return the root node in the resulting object? - emptyTag: null, // the default value for empty nodes - explicitArray: true, // always put child nodes in an array - ignoreAttrs: false, // ignore attributes, only create text nodes - mergeAttrs: false, // merge attributes and child elements - validator: null // a callable validator -}; - -function NodeXmlParser() { } +AWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, { + addAuthorization: function addAuthorization(credentials, date) { -NodeXmlParser.prototype.parse = function(xml, shape) { - shape = shape || {}; + if (!date) date = AWS.util.date.getDate(); - var result = null; - var error = null; + var r = this.request; - var parser = new xml2js.Parser(options); - parser.parseString(xml, function (e, r) { - error = e; - result = r; - }); + r.params.Timestamp = AWS.util.date.iso8601(date); + r.params.SignatureVersion = '2'; + r.params.SignatureMethod = 'HmacSHA256'; + r.params.AWSAccessKeyId = credentials.accessKeyId; - if (result) { - var data = parseXml(result, shape); - if (result.ResponseMetadata) { - data.ResponseMetadata = parseXml(result.ResponseMetadata[0], {}); + if (credentials.sessionToken) { + r.params.SecurityToken = credentials.sessionToken; } - return data; - } else if (error) { - throw util.error(error, {code: 'XMLParserError', retryable: true}); - } else { // empty xml document - return parseXml({}, shape); - } -}; - -function parseXml(xml, shape) { - switch (shape.type) { - case 'structure': return parseStructure(xml, shape); - case 'map': return parseMap(xml, shape); - case 'list': return parseList(xml, shape); - case undefined: case null: return parseUnknown(xml); - default: return parseScalar(xml, shape); - } -} -function parseStructure(xml, shape) { - var data = {}; - if (xml === null) return data; + delete r.params.Signature; // delete old Signature for re-signing + r.params.Signature = this.signature(credentials); - util.each(shape.members, function(memberName, memberShape) { - var xmlName = memberShape.name; - if (Object.prototype.hasOwnProperty.call(xml, xmlName) && Array.isArray(xml[xmlName])) { - var xmlChild = xml[xmlName]; - if (!memberShape.flattened) xmlChild = xmlChild[0]; + r.body = AWS.util.queryParamsToString(r.params); + r.headers['Content-Length'] = r.body.length; + }, - data[memberName] = parseXml(xmlChild, memberShape); - } else if (memberShape.isXmlAttribute && - xml.$ && Object.prototype.hasOwnProperty.call(xml.$, xmlName)) { - data[memberName] = parseScalar(xml.$[xmlName], memberShape); - } else if (memberShape.type === 'list' && !shape.api.xmlNoDefaultLists) { - data[memberName] = memberShape.defaultValue; - } - }); + signature: function signature(credentials) { + return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); + }, - return data; -} + stringToSign: function stringToSign() { + var parts = []; + parts.push(this.request.method); + parts.push(this.request.endpoint.host.toLowerCase()); + parts.push(this.request.pathname()); + parts.push(AWS.util.queryParamsToString(this.request.params)); + return parts.join('\n'); + } -function parseMap(xml, shape) { - var data = {}; - if (xml === null) return data; +}); - var xmlKey = shape.key.name || 'key'; - var xmlValue = shape.value.name || 'value'; - var iterable = shape.flattened ? xml : xml.entry; +/** + * @api private + */ +module.exports = AWS.Signers.V2; - if (Array.isArray(iterable)) { - util.arrayEach(iterable, function(child) { - data[child[xmlKey][0]] = parseXml(child[xmlValue][0], shape.value); - }); - } - return data; -} +/***/ }), -function parseList(xml, shape) { - var data = []; - var name = shape.member.name || 'member'; - if (shape.flattened) { - util.arrayEach(xml, function(xmlChild) { - data.push(parseXml(xmlChild, shape.member)); - }); - } else if (xml && Array.isArray(xml[name])) { - util.arrayEach(xml[name], function(child) { - data.push(parseXml(child, shape.member)); - }); - } +/***/ 66458: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return data; -} +var AWS = __nccwpck_require__(28437); +var inherit = AWS.util.inherit; -function parseScalar(text, shape) { - if (text && text.$ && text.$.encoding === 'base64') { - shape = new Shape.create({type: text.$.encoding}); - } - if (text && text._) text = text._; +/** + * @api private + */ +AWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, { + addAuthorization: function addAuthorization(credentials, date) { - if (typeof shape.toType === 'function') { - return shape.toType(text); - } else { - return text; - } -} + var datetime = AWS.util.date.rfc822(date); -function parseUnknown(xml) { - if (xml === undefined || xml === null) return ''; - if (typeof xml === 'string') return xml; + this.request.headers['X-Amz-Date'] = datetime; - // parse a list - if (Array.isArray(xml)) { - var arr = []; - for (i = 0; i < xml.length; i++) { - arr.push(parseXml(xml[i], {})); + if (credentials.sessionToken) { + this.request.headers['x-amz-security-token'] = credentials.sessionToken; } - return arr; - } - // empty object - var keys = Object.keys(xml), i; - if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) { - return {}; - } + this.request.headers['X-Amzn-Authorization'] = + this.authorization(credentials, datetime); - // object, parse as structure - var data = {}; - for (i = 0; i < keys.length; i++) { - var key = keys[i], value = xml[key]; - if (key === '$') continue; - if (value.length > 1) { // this member is a list - data[key] = parseList(value, {member: {}}); - } else { // this member is a single item - data[key] = parseXml(value[0], {}); - } - } - return data; -} + }, -/** - * @api private - */ -module.exports = NodeXmlParser; + authorization: function authorization(credentials) { + return 'AWS3 ' + + 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + + 'Algorithm=HmacSHA256,' + + 'SignedHeaders=' + this.signedHeaders() + ',' + + 'Signature=' + this.signature(credentials); + }, + signedHeaders: function signedHeaders() { + var headers = []; + AWS.util.arrayEach(this.headersToSign(), function iterator(h) { + headers.push(h.toLowerCase()); + }); + return headers.sort().join(';'); + }, -/***/ }), + canonicalHeaders: function canonicalHeaders() { + var headers = this.request.headers; + var parts = []; + AWS.util.arrayEach(this.headersToSign(), function iterator(h) { + parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim()); + }); + return parts.sort().join('\n') + '\n'; + }, -/***/ 20397: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + headersToSign: function headersToSign() { + var headers = []; + AWS.util.each(this.request.headers, function iterator(k) { + if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) { + headers.push(k); + } + }); + return headers; + }, -var escapeAttribute = (__nccwpck_require__(98241).escapeAttribute); + signature: function signature(credentials) { + return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); + }, -/** - * Represents an XML node. - * @api private - */ -function XmlNode(name, children) { - if (children === void 0) { children = []; } - this.name = name; - this.children = children; - this.attributes = {}; -} -XmlNode.prototype.addAttribute = function (name, value) { - this.attributes[name] = value; - return this; -}; -XmlNode.prototype.addChildNode = function (child) { - this.children.push(child); - return this; -}; -XmlNode.prototype.removeAttribute = function (name) { - delete this.attributes[name]; - return this; -}; -XmlNode.prototype.toString = function () { - var hasChildren = Boolean(this.children.length); - var xmlText = '<' + this.name; - // add attributes - var attributes = this.attributes; - for (var i = 0, attributeNames = Object.keys(attributes); i < attributeNames.length; i++) { - var attributeName = attributeNames[i]; - var attribute = attributes[attributeName]; - if (typeof attribute !== 'undefined' && attribute !== null) { - xmlText += ' ' + attributeName + '=\"' + escapeAttribute('' + attribute) + '\"'; - } - } - return xmlText += !hasChildren ? '/>' : '>' + this.children.map(function (c) { return c.toString(); }).join('') + ''; -}; + stringToSign: function stringToSign() { + var parts = []; + parts.push(this.request.method); + parts.push('/'); + parts.push(''); + parts.push(this.canonicalHeaders()); + parts.push(this.request.body); + return AWS.util.crypto.sha256(parts.join('\n')); + } + +}); /** * @api private */ -module.exports = { - XmlNode: XmlNode -}; +module.exports = AWS.Signers.V3; /***/ }), -/***/ 90971: +/***/ 24473: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var escapeElement = (__nccwpck_require__(98464).escapeElement); +var AWS = __nccwpck_require__(28437); +var inherit = AWS.util.inherit; + +__nccwpck_require__(66458); /** - * Represents an XML text value. * @api private */ -function XmlText(value) { - this.value = value; -} +AWS.Signers.V3Https = inherit(AWS.Signers.V3, { + authorization: function authorization(credentials) { + return 'AWS3-HTTPS ' + + 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + + 'Algorithm=HmacSHA256,' + + 'Signature=' + this.signature(credentials); + }, -XmlText.prototype.toString = function () { - return escapeElement('' + this.value); -}; + stringToSign: function stringToSign() { + return this.request.headers['X-Amz-Date']; + } +}); /** * @api private */ -module.exports = { - XmlText: XmlText -}; +module.exports = AWS.Signers.V3Https; /***/ }), -/***/ 35827: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ 26529: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var AWS = __nccwpck_require__(28437); +var v4Credentials = __nccwpck_require__(62660); +var inherit = AWS.util.inherit; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +/** + * @api private + */ +var expiresHeader = 'presigned-expires'; /** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + * @api private */ -var byteToHex = []; +AWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, { + constructor: function V4(request, serviceName, options) { + AWS.Signers.RequestSigner.call(this, request); + this.serviceName = serviceName; + options = options || {}; + this.signatureCache = typeof options.signatureCache === 'boolean' ? options.signatureCache : true; + this.operation = options.operation; + this.signatureVersion = options.signatureVersion; + }, -for (var i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1); -} + algorithm: 'AWS4-HMAC-SHA256', -function bytesToUuid(buf, offset) { - var i = offset || 0; - var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + addAuthorization: function addAuthorization(credentials, date) { + var datetime = AWS.util.date.iso8601(date).replace(/[:\-]|\.\d{3}/g, ''); - return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join(''); -} + if (this.isPresigned()) { + this.updateForPresigned(credentials, datetime); + } else { + this.addHeaders(credentials, datetime); + } -var _default = bytesToUuid; -exports["default"] = _default; + this.request.headers['Authorization'] = + this.authorization(credentials, datetime); + }, -/***/ }), + addHeaders: function addHeaders(credentials, datetime) { + this.request.headers['X-Amz-Date'] = datetime; + if (credentials.sessionToken) { + this.request.headers['x-amz-security-token'] = credentials.sessionToken; + } + }, -/***/ 57821: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + updateForPresigned: function updateForPresigned(credentials, datetime) { + var credString = this.credentialString(datetime); + var qs = { + 'X-Amz-Date': datetime, + 'X-Amz-Algorithm': this.algorithm, + 'X-Amz-Credential': credentials.accessKeyId + '/' + credString, + 'X-Amz-Expires': this.request.headers[expiresHeader], + 'X-Amz-SignedHeaders': this.signedHeaders() + }; -"use strict"; -var __webpack_unused_export__; + if (credentials.sessionToken) { + qs['X-Amz-Security-Token'] = credentials.sessionToken; + } + if (this.request.headers['Content-Type']) { + qs['Content-Type'] = this.request.headers['Content-Type']; + } + if (this.request.headers['Content-MD5']) { + qs['Content-MD5'] = this.request.headers['Content-MD5']; + } + if (this.request.headers['Cache-Control']) { + qs['Cache-Control'] = this.request.headers['Cache-Control']; + } -__webpack_unused_export__ = ({ - value: true -}); -__webpack_unused_export__ = ({ - enumerable: true, - get: function () { - return _v.default; - } -}); -__webpack_unused_export__ = ({ - enumerable: true, - get: function () { - return _v2.default; - } -}); -Object.defineProperty(exports, "v4", ({ - enumerable: true, - get: function () { - return _v3.default; - } -})); -__webpack_unused_export__ = ({ - enumerable: true, - get: function () { - return _v4.default; - } -}); + // need to pull in any other X-Amz-* headers + AWS.util.each.call(this, this.request.headers, function(key, value) { + if (key === expiresHeader) return; + if (this.isSignableHeader(key)) { + var lowerKey = key.toLowerCase(); + // Metadata should be normalized + if (lowerKey.indexOf('x-amz-meta-') === 0) { + qs[lowerKey] = value; + } else if (lowerKey.indexOf('x-amz-') === 0) { + qs[key] = value; + } + } + }); -var _v = _interopRequireDefault(__nccwpck_require__(67668)); + var sep = this.request.path.indexOf('?') >= 0 ? '&' : '?'; + this.request.path += sep + AWS.util.queryParamsToString(qs); + }, -var _v2 = _interopRequireDefault(__nccwpck_require__(98573)); + authorization: function authorization(credentials, datetime) { + var parts = []; + var credString = this.credentialString(datetime); + parts.push(this.algorithm + ' Credential=' + + credentials.accessKeyId + '/' + credString); + parts.push('SignedHeaders=' + this.signedHeaders()); + parts.push('Signature=' + this.signature(credentials, datetime)); + return parts.join(', '); + }, -var _v3 = _interopRequireDefault(__nccwpck_require__(7811)); + signature: function signature(credentials, datetime) { + var signingKey = v4Credentials.getSigningKey( + credentials, + datetime.substr(0, 8), + this.request.region, + this.serviceName, + this.signatureCache + ); + return AWS.util.crypto.hmac(signingKey, this.stringToSign(datetime), 'hex'); + }, -var _v4 = _interopRequireDefault(__nccwpck_require__(46508)); + stringToSign: function stringToSign(datetime) { + var parts = []; + parts.push('AWS4-HMAC-SHA256'); + parts.push(datetime); + parts.push(this.credentialString(datetime)); + parts.push(this.hexEncodedHash(this.canonicalString())); + return parts.join('\n'); + }, -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + canonicalString: function canonicalString() { + var parts = [], pathname = this.request.pathname(); + if (this.serviceName !== 's3' && this.signatureVersion !== 's3v4') pathname = AWS.util.uriEscapePath(pathname); -/***/ }), + parts.push(this.request.method); + parts.push(pathname); + parts.push(this.request.search()); + parts.push(this.canonicalHeaders() + '\n'); + parts.push(this.signedHeaders()); + parts.push(this.hexEncodedBodyHash()); + return parts.join('\n'); + }, -/***/ 93525: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + canonicalHeaders: function canonicalHeaders() { + var headers = []; + AWS.util.each.call(this, this.request.headers, function (key, item) { + headers.push([key, item]); + }); + headers.sort(function (a, b) { + return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1; + }); + var parts = []; + AWS.util.arrayEach.call(this, headers, function (item) { + var key = item[0].toLowerCase(); + if (this.isSignableHeader(key)) { + var value = item[1]; + if (typeof value === 'undefined' || value === null || typeof value.toString !== 'function') { + throw AWS.util.error(new Error('Header ' + key + ' contains invalid value'), { + code: 'InvalidHeader' + }); + } + parts.push(key + ':' + + this.canonicalHeaderValues(value.toString())); + } + }); + return parts.join('\n'); + }, -"use strict"; + canonicalHeaderValues: function canonicalHeaderValues(values) { + return values.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, ''); + }, + signedHeaders: function signedHeaders() { + var keys = []; + AWS.util.each.call(this, this.request.headers, function (key) { + key = key.toLowerCase(); + if (this.isSignableHeader(key)) keys.push(key); + }); + return keys.sort().join(';'); + }, -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + credentialString: function credentialString(datetime) { + return v4Credentials.createScope( + datetime.substr(0, 8), + this.request.region, + this.serviceName + ); + }, -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + hexEncodedHash: function hash(string) { + return AWS.util.crypto.sha256(string, 'hex'); + }, -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + hexEncodedBodyHash: function hexEncodedBodyHash() { + var request = this.request; + if (this.isPresigned() && (['s3', 's3-object-lambda'].indexOf(this.serviceName) > -1) && !request.body) { + return 'UNSIGNED-PAYLOAD'; + } else if (request.headers['X-Amz-Content-Sha256']) { + return request.headers['X-Amz-Content-Sha256']; + } else { + return this.hexEncodedHash(this.request.body || ''); + } + }, -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } + unsignableHeaders: [ + 'authorization', + 'content-type', + 'content-length', + 'user-agent', + expiresHeader, + 'expect', + 'x-amzn-trace-id' + ], - return _crypto.default.createHash('md5').update(bytes).digest(); -} + isSignableHeader: function isSignableHeader(key) { + if (key.toLowerCase().indexOf('x-amz-') === 0) return true; + return this.unsignableHeaders.indexOf(key) < 0; + }, -var _default = md5; -exports["default"] = _default; + isPresigned: function isPresigned() { + return this.request.headers[expiresHeader] ? true : false; + } -/***/ }), +}); -/***/ 49788: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * @api private + */ +module.exports = AWS.Signers.V4; -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = rng; +/***/ 62660: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); +var AWS = __nccwpck_require__(28437); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * @api private + */ +var cachedSecret = {}; -function rng() { - return _crypto.default.randomBytes(16); -} +/** + * @api private + */ +var cacheQueue = []; -/***/ }), +/** + * @api private + */ +var maxCacheEntries = 50; -/***/ 7387: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * @api private + */ +var v4Identifier = 'aws4_request'; -"use strict"; +/** + * @api private + */ +module.exports = { + /** + * @api private + * + * @param date [String] + * @param region [String] + * @param serviceName [String] + * @return [String] + */ + createScope: function createScope(date, region, serviceName) { + return [ + date.substr(0, 8), + region, + serviceName, + v4Identifier + ].join('/'); + }, + /** + * @api private + * + * @param credentials [Credentials] + * @param date [String] + * @param region [String] + * @param service [String] + * @param shouldCache [Boolean] + * @return [String] + */ + getSigningKey: function getSigningKey( + credentials, + date, + region, + service, + shouldCache + ) { + var credsIdentifier = AWS.util.crypto + .hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64'); + var cacheKey = [credsIdentifier, date, region, service].join('_'); + shouldCache = shouldCache !== false; + if (shouldCache && (cacheKey in cachedSecret)) { + return cachedSecret[cacheKey]; + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + var kDate = AWS.util.crypto.hmac( + 'AWS4' + credentials.secretAccessKey, + date, + 'buffer' + ); + var kRegion = AWS.util.crypto.hmac(kDate, region, 'buffer'); + var kService = AWS.util.crypto.hmac(kRegion, service, 'buffer'); -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + var signingKey = AWS.util.crypto.hmac(kService, v4Identifier, 'buffer'); + if (shouldCache) { + cachedSecret[cacheKey] = signingKey; + cacheQueue.push(cacheKey); + if (cacheQueue.length > maxCacheEntries) { + // remove the oldest entry (not the least recently used) + delete cachedSecret[cacheQueue.shift()]; + } + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return signingKey; + }, -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); + /** + * @api private + * + * Empties the derived signing key cache. Made available for testing purposes + * only. + */ + emptyCache: function emptyCache() { + cachedSecret = {}; + cacheQueue = []; } +}; - return _crypto.default.createHash('sha1').update(bytes).digest(); -} - -var _default = sha1; -exports["default"] = _default; /***/ }), -/***/ 67668: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _rng = _interopRequireDefault(__nccwpck_require__(49788)); - -var _bytesToUuid = _interopRequireDefault(__nccwpck_require__(35827)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -var _nodeId; +/***/ 68118: +/***/ ((module) => { -var _clockseq; // Previous uuid creation time +function AcceptorStateMachine(states, state) { + this.currentState = state || null; + this.states = states || {}; +} +AcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) { + if (typeof finalState === 'function') { + inputError = bindObject; bindObject = done; + done = finalState; finalState = null; + } -var _lastMSecs = 0; -var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + var self = this; + var state = self.states[self.currentState]; + state.fn.call(bindObject || self, inputError, function(err) { + if (err) { + if (state.fail) self.currentState = state.fail; + else return done ? done.call(bindObject, err) : null; + } else { + if (state.accept) self.currentState = state.accept; + else return done ? done.call(bindObject) : null; + } + if (self.currentState === finalState) { + return done ? done.call(bindObject, err) : null; + } -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - options = options || {}; - var node = options.node || _nodeId; - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 + self.runTo(finalState, done, bindObject, err); + }); +}; - if (node == null || clockseq == null) { - var seedBytes = options.random || (options.rng || _rng.default)(); +AcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) { + if (typeof acceptState === 'function') { + fn = acceptState; acceptState = null; failState = null; + } else if (typeof failState === 'function') { + fn = failState; failState = null; + } - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } + if (!this.currentState) this.currentState = name; + this.states[name] = { accept: acceptState, fail: failState, fn: fn }; + return this; +}; - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. +/** + * @api private + */ +module.exports = AcceptorStateMachine; - var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock +/***/ }), - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) +/***/ 82647: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression +var AWS = __nccwpck_require__(28437); - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval +/** + * Represents AWS token object, which contains {token}, and optional + * {expireTime}. + * Creating a `Token` object allows you to pass around your + * token to configuration and service objects. + * + * Note that this class typically does not need to be constructed manually, + * as the {AWS.Config} and {AWS.Service} classes both accept simple + * options hashes with the two keys. The token from this object will be used + * automatically in operations which require them. + * + * ## Expiring and Refreshing Token + * + * Occasionally token can expire in the middle of a long-running + * application. In this case, the SDK will automatically attempt to + * refresh the token from the storage location if the Token + * class implements the {refresh} method. + * + * If you are implementing a token storage location, you + * will want to create a subclass of the `Token` class and + * override the {refresh} method. This method allows token to be + * retrieved from the backing store, be it a file system, database, or + * some network storage. The method should reset the token attributes + * on the object. + * + * @!attribute token + * @return [String] represents the literal token string. This will typically + * be a base64 encoded string. + * @!attribute expireTime + * @return [Date] a time when token should be considered expired. Used + * in conjunction with {expired}. + * @!attribute expired + * @return [Boolean] whether the token is expired and require a refresh. Used + * in conjunction with {expireTime}. + */ +AWS.Token = AWS.util.inherit({ + /** + * Creates a Token object with a given set of information in options hash. + * @option options token [String] represents the literal token string. + * @option options expireTime [Date] field representing the time at which + * the token expires. + * @example Create a token object + * var token = new AWS.Token({ token: 'token' }); + */ + constructor: function Token(options) { + // hide token from being displayed with util.inspect + AWS.util.hideProperties(this, ['token']); + this.expired = false; + this.expireTime = null; + this.refreshCallbacks = []; + if (arguments.length === 1) { + var options = arguments[0]; + this.token = options.token; + this.expireTime = options.expireTime; + } + }, - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested + /** + * @return [Integer] the number of seconds before {expireTime} during which + * the token will be considered expired. + */ + expiryWindow: 15, + /** + * @return [Boolean] whether the Token object should call {refresh} + * @note Subclasses should override this method to provide custom refresh + * logic. + */ + needsRefresh: function needsRefresh() { + var currentTime = AWS.util.date.getDate().getTime(); + var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } + if (this.expireTime && adjustedTime > this.expireTime) + return true; - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + return this.expired || !this.token; + }, - msecs += 12219292800000; // `time_low` + /** + * Gets the existing token, refreshing them if they are not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload token when they are already + * loaded into the object. + * + * @callback callback function(err) + * When this callback is called with no error, it means either token + * do not need to be refreshed or refreshed token information has + * been loaded into the object (as the `token` property). + * @param err [Error] if an error occurred, this value will be filled + */ + get: function get(callback) { + var self = this; + if (this.needsRefresh()) { + this.refresh(function(err) { + if (!err) self.expired = false; // reset expired flag + if (callback) callback(err); + }); + } else if (callback) { + callback(); + } + }, - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` + /** + * @!method getPromise() + * Returns a 'thenable' promise. + * Gets the existing token, refreshing it if it's not yet loaded + * or have expired. Users should call this method before using {refresh}, + * as this will not attempt to reload token when it's already + * loaded into the object. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it means + * either token does not need to be refreshed or refreshed token information + * has been loaded into the object (as the `token` property). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled. + * @return [Promise] A promise that represents the state of the `get` call. + * @example Calling the `getPromise` method. + * var promise = tokenProvider.getPromise(); + * promise.then(function() { ... }, function(err) { ... }); + */ - var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` + /** + * @!method refreshPromise() + * Returns a 'thenable' promise. + * Refreshes the token. Users should call {get} before attempting + * to forcibly refresh token. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function() + * Called if the promise is fulfilled. When this callback is called, it + * means refreshed token information has been loaded into the object + * (as the `token` property). + * @callback rejectedCallback function(err) + * Called if the promise is rejected. + * @param err [Error] if an error occurred, this value will be filled. + * @return [Promise] A promise that represents the state of the `refresh` call. + * @example Calling the `refreshPromise` method. + * var promise = tokenProvider.refreshPromise(); + * promise.then(function() { ... }, function(err) { ... }); + */ - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + /** + * Refreshes the token. Users should call {get} before attempting + * to forcibly refresh token. + * + * @callback callback function(err) + * When this callback is called with no error, it means refreshed + * token information has been loaded into the object (as the + * `token` property). + * @param err [Error] if an error occurred, this value will be filled + * @note Subclasses should override this class to reset the + * {token} on the token object and then call the callback with + * any error information. + * @see get + */ + refresh: function refresh(callback) { + this.expired = false; + callback(); + }, - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + /** + * @api private + * @param callback + */ + coalesceRefresh: function coalesceRefresh(callback, sync) { + var self = this; + if (self.refreshCallbacks.push(callback) === 1) { + self.load(function onLoad(err) { + AWS.util.arrayEach(self.refreshCallbacks, function(callback) { + if (sync) { + callback(err); + } else { + // callback could throw, so defer to ensure all callbacks are notified + AWS.util.defer(function () { + callback(err); + }); + } + }); + self.refreshCallbacks.length = 0; + }); + } + }, - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + /** + * @api private + * @param callback + */ + load: function load(callback) { + callback(); + } +}); - b[i++] = clockseq & 0xff; // `node` +/** + * @api private + */ +AWS.Token.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); + this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); +}; - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } +/** + * @api private + */ +AWS.Token.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.getPromise; + delete this.prototype.refreshPromise; +}; - return buf ? buf : (0, _bytesToUuid.default)(b); -} +AWS.util.addPromises(AWS.Token); -var _default = v1; -exports["default"] = _default; /***/ }), -/***/ 98573: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 90327: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var AWS = __nccwpck_require__(28437); +var crypto = __nccwpck_require__(6113); +var fs = __nccwpck_require__(57147); +var path = __nccwpck_require__(71017); +var iniLoader = AWS.util.iniLoader; +// Tracking refresh attempt to ensure refresh is not attempted more than once every 30 seconds. +var lastRefreshAttemptTime = 0; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +/** + * Throws error is key is not present in token object. + * + * @param token [Object] Object to be validated. + * @param key [String] The key to be validated on the object. + */ +var validateTokenKey = function validateTokenKey(token, key) { + if (!token[key]) { + throw AWS.util.error( + new Error('Key "' + key + '" not present in SSO Token'), + { code: 'SSOTokenProviderFailure' } + ); + } +}; -var _v = _interopRequireDefault(__nccwpck_require__(36097)); +/** + * Calls callback function with or without error based on provided times in case + * of unsuccessful refresh. + * + * @param currentTime [number] current time in milliseconds since ECMAScript epoch. + * @param tokenExpireTime [number] token expire time in milliseconds since ECMAScript epoch. + * @param callback [Function] Callback to call in case of error. + */ +var refreshUnsuccessful = function refreshUnsuccessful( + currentTime, + tokenExpireTime, + callback +) { + if (tokenExpireTime > currentTime) { + // Cached token is still valid, return. + callback(null); + } else { + // Token invalid, throw error requesting user to sso login. + throw AWS.util.error( + new Error('SSO Token refresh failed. Please log in using "aws sso login"'), + { code: 'SSOTokenProviderFailure' } + ); + } +}; -var _md = _interopRequireDefault(__nccwpck_require__(93525)); +/** + * Represents token loaded from disk derived from the AWS SSO device grant authorication flow. + * + * ## Using SSO Token Provider + * + * This provider is checked by default in the Node.js environment in TokenProviderChain. + * To use the SSO Token Provider, simply add your SSO Start URL and Region to the + * ~/.aws/config file in the following format: + * + * [default] + * sso_start_url = https://d-abc123.awsapps.com/start + * sso_region = us-east-1 + * + * ## Using custom profiles + * + * The SDK supports loading token for separate profiles. This can be done in two ways: + * + * 1. Set the `AWS_PROFILE` environment variable in your process prior to loading the SDK. + * 2. Directly load the AWS.SSOTokenProvider: + * + * ```javascript + * var ssoTokenProvider = new AWS.SSOTokenProvider({profile: 'myprofile'}); + * ``` + * + * @!macro nobrowser + */ +AWS.SSOTokenProvider = AWS.util.inherit(AWS.Token, { + /** + * Expiry window of five minutes. + */ + expiryWindow: 5 * 60, -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * Creates a new token object from cached access token. + * + * @param options [map] a set of options + * @option options profile [String] (AWS_PROFILE env var or 'default') + * the name of the profile to load. + * @option options callback [Function] (err) Token is eagerly loaded + * by the constructor. When the callback is called with no error, the + * token has been loaded successfully. + */ + constructor: function SSOTokenProvider(options) { + AWS.Token.call(this); -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports["default"] = _default; + options = options || {}; -/***/ }), + this.expired = true; + this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; + this.get(options.callback || AWS.util.fn.noop); + }, -/***/ 36097: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /** + * Reads sso_start_url from provided profile, and reads token from + * ~/.aws/sso/cache/.json + * + * Throws an error if required fields token and expiresAt are missing. + * Throws an error if token has expired and metadata to perform refresh is + * not available. + * Attempts to refresh the token if it's within 5 minutes before expiry time. + * + * @api private + */ + load: function load(callback) { + var self = this; + var profiles = iniLoader.loadFrom({ isConfig: true }); + var profile = profiles[this.profile] || {}; -"use strict"; + if (Object.keys(profile).length === 0) { + throw AWS.util.error( + new Error('Profile "' + this.profile + '" not found'), + { code: 'SSOTokenProviderFailure' } + ); + } else if (!profile['sso_session']) { + throw AWS.util.error( + new Error('Profile "' + this.profile + '" is missing required property "sso_session".'), + { code: 'SSOTokenProviderFailure' } + ); + } + var ssoSessionName = profile['sso_session']; + var ssoSessions = iniLoader.loadSsoSessionsFrom(); + var ssoSession = ssoSessions[ssoSessionName]; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -exports.URL = exports.DNS = void 0; + if (!ssoSession) { + throw AWS.util.error( + new Error('Sso session "' + ssoSessionName + '" not found'), + { code: 'SSOTokenProviderFailure' } + ); + } else if (!ssoSession['sso_start_url']) { + throw AWS.util.error( + new Error('Sso session "' + this.profile + '" is missing required property "sso_start_url".'), + { code: 'SSOTokenProviderFailure' } + ); + } else if (!ssoSession['sso_region']) { + throw AWS.util.error( + new Error('Sso session "' + this.profile + '" is missing required property "sso_region".'), + { code: 'SSOTokenProviderFailure' } + ); + } -var _bytesToUuid = _interopRequireDefault(__nccwpck_require__(35827)); + var hasher = crypto.createHash('sha1'); + var fileName = hasher.update(ssoSessionName).digest('hex') + '.json'; + var cachePath = path.join(iniLoader.getHomeDir(), '.aws', 'sso', 'cache', fileName); + var tokenFromCache = JSON.parse(fs.readFileSync(cachePath)); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (!tokenFromCache) { + throw AWS.util.error( + new Error('Cached token not found. Please log in using "aws sso login"' + + ' for profile "' + this.profile + '".'), + { code: 'SSOTokenProviderFailure' } + ); + } -function uuidToBytes(uuid) { - // Note: We assume we're being passed a valid uuid string - var bytes = []; - uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) { - bytes.push(parseInt(hex, 16)); - }); - return bytes; -} + validateTokenKey(tokenFromCache, 'accessToken'); + validateTokenKey(tokenFromCache, 'expiresAt'); -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape + var currentTime = AWS.util.date.getDate().getTime(); + var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); + var tokenExpireTime = new Date(tokenFromCache['expiresAt']); - var bytes = new Array(str.length); + if (tokenExpireTime > adjustedTime) { + // Token is valid and not expired. + self.token = tokenFromCache.accessToken; + self.expireTime = tokenExpireTime; + self.expired = false; + callback(null); + return; + } - for (var i = 0; i < str.length; i++) { - bytes[i] = str.charCodeAt(i); - } + // Skip new refresh, if last refresh was done within 30 seconds. + if (currentTime - lastRefreshAttemptTime < 30 * 1000) { + refreshUnsuccessful(currentTime, tokenExpireTime, callback); + return; + } - return bytes; -} + // Token is in expiry window, refresh from SSOOIDC.createToken() call. + validateTokenKey(tokenFromCache, 'clientId'); + validateTokenKey(tokenFromCache, 'clientSecret'); + validateTokenKey(tokenFromCache, 'refreshToken'); -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; + if (!self.service || self.service.config.region !== ssoSession.sso_region) { + self.service = new AWS.SSOOIDC({ region: ssoSession.sso_region }); + } -function _default(name, version, hashfunc) { - var generateUUID = function (value, namespace, buf, offset) { - var off = buf && offset || 0; - if (typeof value == 'string') value = stringToBytes(value); - if (typeof namespace == 'string') namespace = uuidToBytes(namespace); - if (!Array.isArray(value)) throw TypeError('value must be an array of bytes'); - if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values'); // Per 4.3 + var params = { + clientId: tokenFromCache.clientId, + clientSecret: tokenFromCache.clientSecret, + refreshToken: tokenFromCache.refreshToken, + grantType: 'refresh_token', + }; - var bytes = hashfunc(namespace.concat(value)); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; + lastRefreshAttemptTime = AWS.util.date.getDate().getTime(); + self.service.createToken(params, function(err, data) { + if (err || !data) { + refreshUnsuccessful(currentTime, tokenExpireTime, callback); + } else { + try { + validateTokenKey(data, 'accessToken'); + validateTokenKey(data, 'expiresIn'); + self.expired = false; + self.token = data.accessToken; + self.expireTime = new Date(Date.now() + data.expiresIn * 1000); + callback(null); - if (buf) { - for (var idx = 0; idx < 16; ++idx) { - buf[off + idx] = bytes[idx]; + try { + // Write updated token data to disk. + tokenFromCache.accessToken = data.accessToken; + tokenFromCache.expiresAt = self.expireTime.toISOString(); + tokenFromCache.refreshToken = data.refreshToken; + fs.writeFileSync(cachePath, JSON.stringify(tokenFromCache, null, 2)); + } catch (error) { + // Swallow error if unable to write token to file. + } + } catch (error) { + refreshUnsuccessful(currentTime, tokenExpireTime, callback); + } } - } + }); + }, - return buf || (0, _bytesToUuid.default)(bytes); - }; // Function#name is not settable on some platforms (#270) + /** + * Loads the cached access token from disk. + * + * @callback callback function(err) + * Called after the AWS SSO process has been executed. When this + * callback is called with no error, it means that the token information + * has been loaded into the object (as the `token` property). + * @param err [Error] if an error occurred, this value will be filled. + * @see get + */ + refresh: function refresh(callback) { + iniLoader.clearCachedFiles(); + this.coalesceRefresh(callback || AWS.util.fn.callback); + }, +}); - try { - generateUUID.name = name; - } catch (err) {} // For CommonJS default export support +/***/ }), +/***/ 50126: +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} +var AWS = __nccwpck_require__(28437); -/***/ }), +/** + * Creates a token provider chain that searches for token in a list of + * token providers specified by the {providers} property. + * + * By default, the chain will use the {defaultProviders} to resolve token. + * + * ## Setting Providers + * + * Each provider in the {providers} list should be a function that returns + * a {AWS.Token} object, or a hardcoded token object. The function + * form allows for delayed execution of the Token construction. + * + * ## Resolving Token from a Chain + * + * Call {resolve} to return the first valid token object that can be + * loaded by the provider chain. + * + * For example, to resolve a chain with a custom provider that checks a file + * on disk after the set of {defaultProviders}: + * + * ```javascript + * var diskProvider = new FileTokenProvider('./token.json'); + * var chain = new AWS.TokenProviderChain(); + * chain.providers.push(diskProvider); + * chain.resolve(); + * ``` + * + * The above code will return the `diskProvider` object if the + * file contains token and the `defaultProviders` do not contain + * any token. + * + * @!attribute providers + * @return [Array] + * a list of token objects or functions that return token + * objects. If the provider is a function, the function will be + * executed lazily when the provider needs to be checked for valid + * token. By default, this object will be set to the {defaultProviders}. + * @see defaultProviders + */ +AWS.TokenProviderChain = AWS.util.inherit(AWS.Token, { -/***/ 7811: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + /** + * Creates a new TokenProviderChain with a default set of providers + * specified by {defaultProviders}. + */ + constructor: function TokenProviderChain(providers) { + if (providers) { + this.providers = providers; + } else { + this.providers = AWS.TokenProviderChain.defaultProviders.slice(0); + } + this.resolveCallbacks = []; + }, -"use strict"; + /** + * @!method resolvePromise() + * Returns a 'thenable' promise. + * Resolves the provider chain by searching for the first token in {providers}. + * + * Two callbacks can be provided to the `then` method on the returned promise. + * The first callback will be called if the promise is fulfilled, and the second + * callback will be called if the promise is rejected. + * @callback fulfilledCallback function(token) + * Called if the promise is fulfilled and the provider resolves the chain + * to a token object + * @param token [AWS.Token] the token object resolved by the provider chain. + * @callback rejectedCallback function(error) + * Called if the promise is rejected. + * @param err [Error] the error object returned if no token is found. + * @return [Promise] A promise that represents the state of the `resolve` method call. + * @example Calling the `resolvePromise` method. + * var promise = chain.resolvePromise(); + * promise.then(function(token) { ... }, function(err) { ... }); + */ + /** + * Resolves the provider chain by searching for the first token in {providers}. + * + * @callback callback function(err, token) + * Called when the provider resolves the chain to a token object + * or null if no token can be found. + * + * @param err [Error] the error object returned if no token is found. + * @param token [AWS.Token] the token object resolved by the provider chain. + * @return [AWS.TokenProviderChain] the provider, for chaining. + */ + resolve: function resolve(callback) { + var self = this; + if (self.providers.length === 0) { + callback(new Error('No providers')); + return self; + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + if (self.resolveCallbacks.push(callback) === 1) { + var index = 0; + var providers = self.providers.slice(0); -var _rng = _interopRequireDefault(__nccwpck_require__(49788)); + function resolveNext(err, token) { + if ((!err && token) || index === providers.length) { + AWS.util.arrayEach(self.resolveCallbacks, function (callback) { + callback(err, token); + }); + self.resolveCallbacks.length = 0; + return; + } -var _bytesToUuid = _interopRequireDefault(__nccwpck_require__(35827)); + var provider = providers[index++]; + if (typeof provider === 'function') { + token = provider.call(); + } else { + token = provider; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (token.get) { + token.get(function (getErr) { + resolveNext(getErr, getErr ? null : token); + }); + } else { + resolveNext(null, token); + } + } -function v4(options, buf, offset) { - var i = buf && offset || 0; + resolveNext(); + } - if (typeof options == 'string') { - buf = options === 'binary' ? new Array(16) : null; - options = null; + return self; } +}); - options = options || {}; - - var rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - +/** + * The default set of providers used by a vanilla TokenProviderChain. + * + * In the browser: + * + * ```javascript + * AWS.TokenProviderChain.defaultProviders = [] + * ``` + * + * In Node.js: + * + * ```javascript + * AWS.TokenProviderChain.defaultProviders = [ + * function () { return new AWS.SSOTokenProvider(); }, + * ] + * ``` + */ +AWS.TokenProviderChain.defaultProviders = []; - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided +/** + * @api private + */ +AWS.TokenProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { + this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); +}; - if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i + ii] = rnds[ii]; - } - } +/** + * @api private + */ +AWS.TokenProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { + delete this.prototype.resolvePromise; +}; - return buf || (0, _bytesToUuid.default)(rnds); -} +AWS.util.addPromises(AWS.TokenProviderChain); -var _default = v4; -exports["default"] = _default; /***/ }), -/***/ 46508: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 77985: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/* eslint guard-for-in:0 */ +var AWS; +/** + * A set of utility methods for use with the AWS SDK. + * + * @!attribute abort + * Return this value from an iterator function {each} or {arrayEach} + * to break out of the iteration. + * @example Breaking out of an iterator function + * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) { + * if (key == 'b') return AWS.util.abort; + * }); + * @see each + * @see arrayEach + * @api private + */ +var util = { + environment: 'nodejs', + engine: function engine() { + if (util.isBrowser() && typeof navigator !== 'undefined') { + return navigator.userAgent; + } else { + var engine = process.platform + '/' + process.version; + if (process.env.AWS_EXECUTION_ENV) { + engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV; + } + return engine; + } + }, -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + userAgent: function userAgent() { + var name = util.environment; + var agent = 'aws-sdk-' + name + '/' + (__nccwpck_require__(28437).VERSION); + if (name === 'nodejs') agent += ' ' + util.engine(); + return agent; + }, -var _v = _interopRequireDefault(__nccwpck_require__(36097)); + uriEscape: function uriEscape(string) { + var output = encodeURIComponent(string); + output = output.replace(/[^A-Za-z0-9_.~\-%]+/g, escape); -var _sha = _interopRequireDefault(__nccwpck_require__(7387)); + // AWS percent-encodes some extra non-standard characters in a URI + output = output.replace(/[*]/g, function(ch) { + return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); + }); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + return output; + }, -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports["default"] = _default; + uriEscapePath: function uriEscapePath(string) { + var parts = []; + util.arrayEach(string.split('/'), function (part) { + parts.push(util.uriEscape(part)); + }); + return parts.join('/'); + }, -/***/ }), + urlParse: function urlParse(url) { + return util.url.parse(url); + }, -/***/ 96323: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + urlFormat: function urlFormat(url) { + return util.url.format(url); + }, -"use strict"; -var __webpack_unused_export__; + queryStringParse: function queryStringParse(qs) { + return util.querystring.parse(qs); + }, -__webpack_unused_export__ = ({ value: true }); -var LRU_1 = __nccwpck_require__(77710); -var CACHE_SIZE = 1000; -/** - * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache] - */ -var EndpointCache = /** @class */ (function () { - function EndpointCache(maxSize) { - if (maxSize === void 0) { maxSize = CACHE_SIZE; } - this.maxSize = maxSize; - this.cache = new LRU_1.LRUCache(maxSize); - } - ; - Object.defineProperty(EndpointCache.prototype, "size", { - get: function () { - return this.cache.length; - }, - enumerable: true, - configurable: true + queryParamsToString: function queryParamsToString(params) { + var items = []; + var escape = util.uriEscape; + var sortedKeys = Object.keys(params).sort(); + + util.arrayEach(sortedKeys, function(name) { + var value = params[name]; + var ename = escape(name); + var result = ename + '='; + if (Array.isArray(value)) { + var vals = []; + util.arrayEach(value, function(item) { vals.push(escape(item)); }); + result = ename + '=' + vals.sort().join('&' + ename + '='); + } else if (value !== undefined && value !== null) { + result = ename + '=' + escape(value); + } + items.push(result); }); - EndpointCache.prototype.put = function (key, value) { - var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; - var endpointRecord = this.populateValue(value); - this.cache.put(keyString, endpointRecord); - }; - EndpointCache.prototype.get = function (key) { - var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; - var now = Date.now(); - var records = this.cache.get(keyString); - if (records) { - for (var i = records.length-1; i >= 0; i--) { - var record = records[i]; - if (record.Expire < now) { - records.splice(i, 1); - } - } - if (records.length === 0) { - this.cache.remove(keyString); - return undefined; - } - } - return records; - }; - EndpointCache.getKeyString = function (key) { - var identifiers = []; - var identifierNames = Object.keys(key).sort(); - for (var i = 0; i < identifierNames.length; i++) { - var identifierName = identifierNames[i]; - if (key[identifierName] === undefined) - continue; - identifiers.push(key[identifierName]); - } - return identifiers.join(' '); - }; - EndpointCache.prototype.populateValue = function (endpoints) { - var now = Date.now(); - return endpoints.map(function (endpoint) { return ({ - Address: endpoint.Address || '', - Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000 - }); }); - }; - EndpointCache.prototype.empty = function () { - this.cache.empty(); - }; - EndpointCache.prototype.remove = function (key) { - var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; - this.cache.remove(keyString); - }; - return EndpointCache; -}()); -exports.$ = EndpointCache; -/***/ }), + return items.join('&'); + }, -/***/ 77710: -/***/ ((__unused_webpack_module, exports) => { + readFileSync: function readFileSync(path) { + if (util.isBrowser()) return null; + return (__nccwpck_require__(57147).readFileSync)(path, 'utf-8'); + }, -"use strict"; + base64: { + encode: function encode64(string) { + if (typeof string === 'number') { + throw util.error(new Error('Cannot base64 encode number ' + string)); + } + if (string === null || typeof string === 'undefined') { + return string; + } + var buf = util.buffer.toBuffer(string); + return buf.toString('base64'); + }, -Object.defineProperty(exports, "__esModule", ({ value: true })); -var LinkedListNode = /** @class */ (function () { - function LinkedListNode(key, value) { - this.key = key; - this.value = value; - } - return LinkedListNode; -}()); -var LRUCache = /** @class */ (function () { - function LRUCache(size) { - this.nodeMap = {}; - this.size = 0; - if (typeof size !== 'number' || size < 1) { - throw new Error('Cache size can only be positive number'); - } - this.sizeLimit = size; + decode: function decode64(string) { + if (typeof string === 'number') { + throw util.error(new Error('Cannot base64 decode number ' + string)); + } + if (string === null || typeof string === 'undefined') { + return string; + } + return util.buffer.toBuffer(string, 'base64'); } - Object.defineProperty(LRUCache.prototype, "length", { - get: function () { - return this.size; - }, - enumerable: true, - configurable: true - }); - LRUCache.prototype.prependToList = function (node) { - if (!this.headerNode) { - this.tailNode = node; - } - else { - this.headerNode.prev = node; - node.next = this.headerNode; - } - this.headerNode = node; - this.size++; - }; - LRUCache.prototype.removeFromTail = function () { - if (!this.tailNode) { - return undefined; - } - var node = this.tailNode; - var prevNode = node.prev; - if (prevNode) { - prevNode.next = undefined; - } - node.prev = undefined; - this.tailNode = prevNode; - this.size--; - return node; - }; - LRUCache.prototype.detachFromList = function (node) { - if (this.headerNode === node) { - this.headerNode = node.next; - } - if (this.tailNode === node) { - this.tailNode = node.prev; - } - if (node.prev) { - node.prev.next = node.next; - } - if (node.next) { - node.next.prev = node.prev; - } - node.next = undefined; - node.prev = undefined; - this.size--; - }; - LRUCache.prototype.get = function (key) { - if (this.nodeMap[key]) { - var node = this.nodeMap[key]; - this.detachFromList(node); - this.prependToList(node); - return node.value; - } - }; - LRUCache.prototype.remove = function (key) { - if (this.nodeMap[key]) { - var node = this.nodeMap[key]; - this.detachFromList(node); - delete this.nodeMap[key]; - } - }; - LRUCache.prototype.put = function (key, value) { - if (this.nodeMap[key]) { - this.remove(key); - } - else if (this.size === this.sizeLimit) { - var tailNode = this.removeFromTail(); - var key_1 = tailNode.key; - delete this.nodeMap[key_1]; - } - var newNode = new LinkedListNode(key, value); - this.nodeMap[key] = newNode; - this.prependToList(newNode); - }; - LRUCache.prototype.empty = function () { - var keys = Object.keys(this.nodeMap); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var node = this.nodeMap[key]; - this.detachFromList(node); - delete this.nodeMap[key]; - } - }; - return LRUCache; -}()); -exports.LRUCache = LRUCache; -/***/ }), + }, + + buffer: { + /** + * Buffer constructor for Node buffer and buffer pollyfill + */ + toBuffer: function(data, encoding) { + return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ? + util.Buffer.from(data, encoding) : new util.Buffer(data, encoding); + }, + + alloc: function(size, fill, encoding) { + if (typeof size !== 'number') { + throw new Error('size passed to alloc must be a number.'); + } + if (typeof util.Buffer.alloc === 'function') { + return util.Buffer.alloc(size, fill, encoding); + } else { + var buf = new util.Buffer(size); + if (fill !== undefined && typeof buf.fill === 'function') { + buf.fill(fill, undefined, undefined, encoding); + } + return buf; + } + }, -/***/ 83682: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + toStream: function toStream(buffer) { + if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer); -var register = __nccwpck_require__(44670); -var addHook = __nccwpck_require__(5549); -var removeHook = __nccwpck_require__(6819); + var readable = new (util.stream.Readable)(); + var pos = 0; + readable._read = function(size) { + if (pos >= buffer.length) return readable.push(null); -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind; -var bindable = bind.bind(bind); + var end = pos + size; + if (end > buffer.length) end = buffer.length; + readable.push(buffer.slice(pos, end)); + pos = end; + }; -function bindApi(hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply( - null, - name ? [state, name] : [state] - ); - hook.api = { remove: removeHookRef }; - hook.remove = removeHookRef; - ["before", "error", "after", "wrap"].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind]; - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); - }); -} + return readable; + }, -function HookSingular() { - var singularHookName = "h"; - var singularHookState = { - registry: {}, - }; - var singularHook = register.bind(null, singularHookState, singularHookName); - bindApi(singularHook, singularHookState, singularHookName); - return singularHook; -} + /** + * Concatenates a list of Buffer objects. + */ + concat: function(buffers) { + var length = 0, + offset = 0, + buffer = null, i; -function HookCollection() { - var state = { - registry: {}, - }; + for (i = 0; i < buffers.length; i++) { + length += buffers[i].length; + } - var hook = register.bind(null, state); - bindApi(hook, state); + buffer = util.buffer.alloc(length); - return hook; -} + for (i = 0; i < buffers.length; i++) { + buffers[i].copy(buffer, offset); + offset += buffers[i].length; + } -var collectionHookDeprecationMessageDisplayed = false; -function Hook() { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn( - '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' - ); - collectionHookDeprecationMessageDisplayed = true; - } - return HookCollection(); -} + return buffer; + } + }, -Hook.Singular = HookSingular.bind(); -Hook.Collection = HookCollection.bind(); + string: { + byteLength: function byteLength(string) { + if (string === null || string === undefined) return 0; + if (typeof string === 'string') string = util.buffer.toBuffer(string); -module.exports = Hook; -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook; -module.exports.Singular = Hook.Singular; -module.exports.Collection = Hook.Collection; + if (typeof string.byteLength === 'number') { + return string.byteLength; + } else if (typeof string.length === 'number') { + return string.length; + } else if (typeof string.size === 'number') { + return string.size; + } else if (typeof string.path === 'string') { + return (__nccwpck_require__(57147).lstatSync)(string.path).size; + } else { + throw util.error(new Error('Cannot determine length of ' + string), + { object: string }); + } + }, + upperFirst: function upperFirst(string) { + return string[0].toUpperCase() + string.substr(1); + }, -/***/ }), + lowerFirst: function lowerFirst(string) { + return string[0].toLowerCase() + string.substr(1); + } + }, -/***/ 5549: -/***/ ((module) => { + ini: { + parse: function string(ini) { + var currentSection, map = {}; + util.arrayEach(ini.split(/\r?\n/), function(line) { + line = line.split(/(^|\s)[;#]/)[0].trim(); // remove comments and trim + var isSection = line[0] === '[' && line[line.length - 1] === ']'; + if (isSection) { + currentSection = line.substring(1, line.length - 1); + if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') { + throw util.error( + new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.') + ); + } + } else if (currentSection) { + var indexOfEqualsSign = line.indexOf('='); + var start = 0; + var end = line.length - 1; + var isAssignment = + indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; -module.exports = addHook; + if (isAssignment) { + var name = line.substring(0, indexOfEqualsSign).trim(); + var value = line.substring(indexOfEqualsSign + 1).trim(); -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } + map[currentSection] = map[currentSection] || {}; + map[currentSection][name] = value; + } + } + }); - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; - } + return map; + } + }, - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; - }); - }; - } + fn: { + noop: function() {}, + callback: function (err) { if (err) throw err; }, - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; - } + /** + * Turn a synchronous function into as "async" function by making it call + * a callback. The underlying function is called with all but the last argument, + * which is treated as the callback. The callback is passed passed a first argument + * of null on success to mimick standard node callbacks. + */ + makeAsync: function makeAsync(fn, expectedArgs) { + if (expectedArgs && expectedArgs <= fn.length) { + return fn; + } - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} + return function() { + var args = Array.prototype.slice.call(arguments, 0); + var callback = args.pop(); + var result = fn.apply(null, args); + callback(result); + }; + } + }, + /** + * Date and time utility functions. + */ + date: { -/***/ }), + /** + * @return [Date] the current JavaScript date object. Since all + * AWS services rely on this date object, you can override + * this function to provide a special time value to AWS service + * requests. + */ + getDate: function getDate() { + if (!AWS) AWS = __nccwpck_require__(28437); + if (AWS.config.systemClockOffset) { // use offset when non-zero + return new Date(new Date().getTime() + AWS.config.systemClockOffset); + } else { + return new Date(); + } + }, -/***/ 44670: -/***/ ((module) => { + /** + * @return [String] the date in ISO-8601 format + */ + iso8601: function iso8601(date) { + if (date === undefined) { date = util.date.getDate(); } + return date.toISOString().replace(/\.\d{3}Z$/, 'Z'); + }, -module.exports = register; + /** + * @return [String] the date in RFC 822 format + */ + rfc822: function rfc822(date) { + if (date === undefined) { date = util.date.getDate(); } + return date.toUTCString(); + }, -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } + /** + * @return [Integer] the UNIX timestamp value for the current time + */ + unixTimestamp: function unixTimestamp(date) { + if (date === undefined) { date = util.date.getDate(); } + return date.getTime() / 1000; + }, - if (!options) { - options = {}; - } + /** + * @param [String,number,Date] date + * @return [Date] + */ + from: function format(date) { + if (typeof date === 'number') { + return new Date(date * 1000); // unix timestamp + } else { + return new Date(date); + } + }, - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); - } + /** + * Given a Date or date-like value, this function formats the + * date into a string of the requested value. + * @param [String,number,Date] date + * @param [String] formatter Valid formats are: + # * 'iso8601' + # * 'rfc822' + # * 'unixTimestamp' + * @return [String] + */ + format: function format(date, formatter) { + if (!formatter) formatter = 'iso8601'; + return util.date[formatter](util.date.from(date)); + }, - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); + parseTimestamp: function parseTimestamp(value) { + if (typeof value === 'number') { // unix timestamp (number) + return new Date(value * 1000); + } else if (value.match(/^\d+$/)) { // unix timestamp + return new Date(value * 1000); + } else if (value.match(/^\d{4}/)) { // iso8601 + return new Date(value); + } else if (value.match(/^\w{3},/)) { // rfc822 + return new Date(value); + } else { + throw util.error( + new Error('unhandled timestamp format: ' + value), + {code: 'TimestampParserError'}); + } } - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); -} + }, + crypto: { + crc32Table: [ + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, + 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, + 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, + 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, + 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, + 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, + 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, + 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, + 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, + 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, + 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, + 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, + 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, + 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, + 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, + 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, + 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, + 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, + 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, + 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, + 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, + 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, + 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, + 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, + 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, + 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, + 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, + 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, + 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, + 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, + 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, + 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, + 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, + 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, + 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, + 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, + 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, + 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, + 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, + 0x2D02EF8D], -/***/ }), + crc32: function crc32(data) { + var tbl = util.crypto.crc32Table; + var crc = 0 ^ -1; -/***/ 6819: -/***/ ((module) => { + if (typeof data === 'string') { + data = util.buffer.toBuffer(data); + } -module.exports = removeHook; + for (var i = 0; i < data.length; i++) { + var code = data.readUInt8(i); + crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF]; + } + return (crc ^ -1) >>> 0; + }, -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } + hmac: function hmac(key, string, digest, fn) { + if (!digest) digest = 'binary'; + if (digest === 'buffer') { digest = undefined; } + if (!fn) fn = 'sha256'; + if (typeof string === 'string') string = util.buffer.toBuffer(string); + return util.crypto.lib.createHmac(fn, key).update(string).digest(digest); + }, - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); + md5: function md5(data, digest, callback) { + return util.crypto.hash('md5', data, digest, callback); + }, - if (index === -1) { - return; - } + sha256: function sha256(data, digest, callback) { + return util.crypto.hash('sha256', data, digest, callback); + }, - state.registry[name].splice(index, 1); -} + hash: function(algorithm, data, digest, callback) { + var hash = util.crypto.createHash(algorithm); + if (!digest) { digest = 'binary'; } + if (digest === 'buffer') { digest = undefined; } + if (typeof data === 'string') data = util.buffer.toBuffer(data); + var sliceFn = util.arraySliceFn(data); + var isBuffer = util.Buffer.isBuffer(data); + //Identifying objects with an ArrayBuffer as buffers + if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true; + if (callback && typeof data === 'object' && + typeof data.on === 'function' && !isBuffer) { + data.on('data', function(chunk) { hash.update(chunk); }); + data.on('error', function(err) { callback(err); }); + data.on('end', function() { callback(null, hash.digest(digest)); }); + } else if (callback && sliceFn && !isBuffer && + typeof FileReader !== 'undefined') { + // this might be a File/Blob + var index = 0, size = 1024 * 512; + var reader = new FileReader(); + reader.onerror = function() { + callback(new Error('Failed to read data.')); + }; + reader.onload = function() { + var buf = new util.Buffer(new Uint8Array(reader.result)); + hash.update(buf); + index += buf.length; + reader._continueReading(); + }; + reader._continueReading = function() { + if (index >= data.size) { + callback(null, hash.digest(digest)); + return; + } -/***/ }), + var back = index + size; + if (back > data.size) back = data.size; + reader.readAsArrayBuffer(sliceFn.call(data, index, back)); + }; -/***/ 58932: -/***/ ((__unused_webpack_module, exports) => { + reader._continueReading(); + } else { + if (util.isBrowser() && typeof data === 'object' && !isBuffer) { + data = new util.Buffer(new Uint8Array(data)); + } + var out = hash.update(data).digest(digest); + if (callback) callback(null, out); + return out; + } + }, -"use strict"; + toHex: function toHex(data) { + var out = []; + for (var i = 0; i < data.length; i++) { + out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2)); + } + return out.join(''); + }, + createHash: function createHash(algorithm) { + return util.crypto.lib.createHash(algorithm); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + }, -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) + /** @!ignore */ - /* istanbul ignore next */ + /* Abort constant */ + abort: {}, - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); + each: function each(object, iterFunction) { + for (var key in object) { + if (Object.prototype.hasOwnProperty.call(object, key)) { + var ret = iterFunction.call(this, key, object[key]); + if (ret === util.abort) break; + } } + }, - this.name = 'Deprecation'; - } + arrayEach: function arrayEach(array, iterFunction) { + for (var idx in array) { + if (Object.prototype.hasOwnProperty.call(array, idx)) { + var ret = iterFunction.call(this, array[idx], parseInt(idx, 10)); + if (ret === util.abort) break; + } + } + }, -} + update: function update(obj1, obj2) { + util.each(obj2, function iterator(key, item) { + obj1[key] = item; + }); + return obj1; + }, -exports.Deprecation = Deprecation; + merge: function merge(obj1, obj2) { + return util.update(util.copy(obj1), obj2); + }, + + copy: function copy(object) { + if (object === null || object === undefined) return object; + var dupe = {}; + // jshint forin:false + for (var key in object) { + dupe[key] = object[key]; + } + return dupe; + }, + isEmpty: function isEmpty(obj) { + for (var prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + return false; + } + } + return true; + }, -/***/ }), + arraySliceFn: function arraySliceFn(obj) { + var fn = obj.slice || obj.webkitSlice || obj.mozSlice; + return typeof fn === 'function' ? fn : null; + }, -/***/ 87783: -/***/ ((__unused_webpack_module, exports) => { + isType: function isType(obj, type) { + // handle cross-"frame" objects + if (typeof type === 'function') type = util.typeName(type); + return Object.prototype.toString.call(obj) === '[object ' + type + ']'; + }, -(function(exports) { - "use strict"; + typeName: function typeName(type) { + if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name; + var str = type.toString(); + var match = str.match(/^\s*function (.+)\(/); + return match ? match[1] : str; + }, - function isArray(obj) { - if (obj !== null) { - return Object.prototype.toString.call(obj) === "[object Array]"; - } else { - return false; + error: function error(err, options) { + var originalError = null; + if (typeof err.message === 'string' && err.message !== '') { + if (typeof options === 'string' || (options && options.message)) { + originalError = util.copy(err); + originalError.message = err.message; + } } - } + err.message = err.message || null; - function isObject(obj) { - if (obj !== null) { - return Object.prototype.toString.call(obj) === "[object Object]"; - } else { - return false; + if (typeof options === 'string') { + err.message = options; + } else if (typeof options === 'object' && options !== null) { + util.update(err, options); + if (options.message) + err.message = options.message; + if (options.code || options.name) + err.code = options.code || options.name; + if (options.stack) + err.stack = options.stack; } - } - function strictDeepEqual(first, second) { - // Check the scalar case first. - if (first === second) { - return true; + if (typeof Object.defineProperty === 'function') { + Object.defineProperty(err, 'name', {writable: true, enumerable: false}); + Object.defineProperty(err, 'message', {enumerable: true}); } - // Check if they are the same type. - var firstType = Object.prototype.toString.call(first); - if (firstType !== Object.prototype.toString.call(second)) { - return false; - } - // We know that first and second have the same type so we can just check the - // first type from now on. - if (isArray(first) === true) { - // Short circuit if they're not the same length; - if (first.length !== second.length) { - return false; - } - for (var i = 0; i < first.length; i++) { - if (strictDeepEqual(first[i], second[i]) === false) { - return false; - } - } - return true; + err.name = String(options && options.name || err.name || err.code || 'Error'); + err.time = new Date(); + + if (originalError) { + err.originalError = originalError; } - if (isObject(first) === true) { - // An object is equal if it has the same key/value pairs. - var keysSeen = {}; - for (var key in first) { - if (hasOwnProperty.call(first, key)) { - if (strictDeepEqual(first[key], second[key]) === false) { - return false; - } - keysSeen[key] = true; - } - } - // Now check that there aren't any keys in second that weren't - // in first. - for (var key2 in second) { - if (hasOwnProperty.call(second, key2)) { - if (keysSeen[key2] !== true) { - return false; - } + + + for (var key in options || {}) { + if (key[0] === '[' && key[key.length - 1] === ']') { + key = key.slice(1, -1); + if (key === 'code' || key === 'message') { + continue; } + err['[' + key + ']'] = 'See error.' + key + ' for details.'; + Object.defineProperty(err, key, { + value: err[key] || (options && options[key]) || (originalError && originalError[key]), + enumerable: false, + writable: true + }); } - return true; } - return false; - } - function isFalse(obj) { - // From the spec: - // A false value corresponds to the following values: - // Empty list - // Empty object - // Empty string - // False boolean - // null value + return err; + }, - // First check the scalar values. - if (obj === "" || obj === false || obj === null) { - return true; - } else if (isArray(obj) && obj.length === 0) { - // Check for an empty array. - return true; - } else if (isObject(obj)) { - // Check for an empty object. - for (var key in obj) { - // If there are any keys, then - // the object is not empty so the object - // is not false. - if (obj.hasOwnProperty(key)) { - return false; - } - } - return true; + /** + * @api private + */ + inherit: function inherit(klass, features) { + var newObject = null; + if (features === undefined) { + features = klass; + klass = Object; + newObject = {}; } else { - return false; + var ctor = function ConstructorWrapper() {}; + ctor.prototype = klass.prototype; + newObject = new ctor(); } - } - function objValues(obj) { - var keys = Object.keys(obj); - var values = []; - for (var i = 0; i < keys.length; i++) { - values.push(obj[keys[i]]); + // constructor not supplied, create pass-through ctor + if (features.constructor === Object) { + features.constructor = function() { + if (klass !== Object) { + return klass.apply(this, arguments); + } + }; } - return values; - } - - function merge(a, b) { - var merged = {}; - for (var key in a) { - merged[key] = a[key]; - } - for (var key2 in b) { - merged[key2] = b[key2]; - } - return merged; - } - - var trimLeft; - if (typeof String.prototype.trimLeft === "function") { - trimLeft = function(str) { - return str.trimLeft(); - }; - } else { - trimLeft = function(str) { - return str.match(/^\s*(.*)/)[1]; - }; - } - - // Type constants used to define functions. - var TYPE_NUMBER = 0; - var TYPE_ANY = 1; - var TYPE_STRING = 2; - var TYPE_ARRAY = 3; - var TYPE_OBJECT = 4; - var TYPE_BOOLEAN = 5; - var TYPE_EXPREF = 6; - var TYPE_NULL = 7; - var TYPE_ARRAY_NUMBER = 8; - var TYPE_ARRAY_STRING = 9; - var TYPE_NAME_TABLE = { - 0: 'number', - 1: 'any', - 2: 'string', - 3: 'array', - 4: 'object', - 5: 'boolean', - 6: 'expression', - 7: 'null', - 8: 'Array', - 9: 'Array' - }; - - var TOK_EOF = "EOF"; - var TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier"; - var TOK_QUOTEDIDENTIFIER = "QuotedIdentifier"; - var TOK_RBRACKET = "Rbracket"; - var TOK_RPAREN = "Rparen"; - var TOK_COMMA = "Comma"; - var TOK_COLON = "Colon"; - var TOK_RBRACE = "Rbrace"; - var TOK_NUMBER = "Number"; - var TOK_CURRENT = "Current"; - var TOK_EXPREF = "Expref"; - var TOK_PIPE = "Pipe"; - var TOK_OR = "Or"; - var TOK_AND = "And"; - var TOK_EQ = "EQ"; - var TOK_GT = "GT"; - var TOK_LT = "LT"; - var TOK_GTE = "GTE"; - var TOK_LTE = "LTE"; - var TOK_NE = "NE"; - var TOK_FLATTEN = "Flatten"; - var TOK_STAR = "Star"; - var TOK_FILTER = "Filter"; - var TOK_DOT = "Dot"; - var TOK_NOT = "Not"; - var TOK_LBRACE = "Lbrace"; - var TOK_LBRACKET = "Lbracket"; - var TOK_LPAREN= "Lparen"; - var TOK_LITERAL= "Literal"; - - // The "&", "[", "<", ">" tokens - // are not in basicToken because - // there are two token variants - // ("&&", "[?", "<=", ">="). This is specially handled - // below. - var basicTokens = { - ".": TOK_DOT, - "*": TOK_STAR, - ",": TOK_COMMA, - ":": TOK_COLON, - "{": TOK_LBRACE, - "}": TOK_RBRACE, - "]": TOK_RBRACKET, - "(": TOK_LPAREN, - ")": TOK_RPAREN, - "@": TOK_CURRENT - }; + features.constructor.prototype = newObject; + util.update(features.constructor.prototype, features); + features.constructor.__super__ = klass; + return features.constructor; + }, - var operatorStartToken = { - "<": true, - ">": true, - "=": true, - "!": true - }; + /** + * @api private + */ + mixin: function mixin() { + var klass = arguments[0]; + for (var i = 1; i < arguments.length; i++) { + // jshint forin:false + for (var prop in arguments[i].prototype) { + var fn = arguments[i].prototype[prop]; + if (prop !== 'constructor') { + klass.prototype[prop] = fn; + } + } + } + return klass; + }, - var skipChars = { - " ": true, - "\t": true, - "\n": true - }; + /** + * @api private + */ + hideProperties: function hideProperties(obj, props) { + if (typeof Object.defineProperty !== 'function') return; + util.arrayEach(props, function (key) { + Object.defineProperty(obj, key, { + enumerable: false, writable: true, configurable: true }); + }); + }, - function isAlpha(ch) { - return (ch >= "a" && ch <= "z") || - (ch >= "A" && ch <= "Z") || - ch === "_"; - } + /** + * @api private + */ + property: function property(obj, name, value, enumerable, isValue) { + var opts = { + configurable: true, + enumerable: enumerable !== undefined ? enumerable : true + }; + if (typeof value === 'function' && !isValue) { + opts.get = value; + } + else { + opts.value = value; opts.writable = true; + } - function isNum(ch) { - return (ch >= "0" && ch <= "9") || - ch === "-"; - } - function isAlphaNum(ch) { - return (ch >= "a" && ch <= "z") || - (ch >= "A" && ch <= "Z") || - (ch >= "0" && ch <= "9") || - ch === "_"; - } + Object.defineProperty(obj, name, opts); + }, - function Lexer() { - } - Lexer.prototype = { - tokenize: function(stream) { - var tokens = []; - this._current = 0; - var start; - var identifier; - var token; - while (this._current < stream.length) { - if (isAlpha(stream[this._current])) { - start = this._current; - identifier = this._consumeUnquotedIdentifier(stream); - tokens.push({type: TOK_UNQUOTEDIDENTIFIER, - value: identifier, - start: start}); - } else if (basicTokens[stream[this._current]] !== undefined) { - tokens.push({type: basicTokens[stream[this._current]], - value: stream[this._current], - start: this._current}); - this._current++; - } else if (isNum(stream[this._current])) { - token = this._consumeNumber(stream); - tokens.push(token); - } else if (stream[this._current] === "[") { - // No need to increment this._current. This happens - // in _consumeLBracket - token = this._consumeLBracket(stream); - tokens.push(token); - } else if (stream[this._current] === "\"") { - start = this._current; - identifier = this._consumeQuotedIdentifier(stream); - tokens.push({type: TOK_QUOTEDIDENTIFIER, - value: identifier, - start: start}); - } else if (stream[this._current] === "'") { - start = this._current; - identifier = this._consumeRawStringLiteral(stream); - tokens.push({type: TOK_LITERAL, - value: identifier, - start: start}); - } else if (stream[this._current] === "`") { - start = this._current; - var literal = this._consumeLiteral(stream); - tokens.push({type: TOK_LITERAL, - value: literal, - start: start}); - } else if (operatorStartToken[stream[this._current]] !== undefined) { - tokens.push(this._consumeOperator(stream)); - } else if (skipChars[stream[this._current]] !== undefined) { - // Ignore whitespace. - this._current++; - } else if (stream[this._current] === "&") { - start = this._current; - this._current++; - if (stream[this._current] === "&") { - this._current++; - tokens.push({type: TOK_AND, value: "&&", start: start}); - } else { - tokens.push({type: TOK_EXPREF, value: "&", start: start}); - } - } else if (stream[this._current] === "|") { - start = this._current; - this._current++; - if (stream[this._current] === "|") { - this._current++; - tokens.push({type: TOK_OR, value: "||", start: start}); - } else { - tokens.push({type: TOK_PIPE, value: "|", start: start}); - } - } else { - var error = new Error("Unknown character:" + stream[this._current]); - error.name = "LexerError"; - throw error; - } - } - return tokens; - }, + /** + * @api private + */ + memoizedProperty: function memoizedProperty(obj, name, get, enumerable) { + var cachedValue = null; - _consumeUnquotedIdentifier: function(stream) { - var start = this._current; - this._current++; - while (this._current < stream.length && isAlphaNum(stream[this._current])) { - this._current++; - } - return stream.slice(start, this._current); - }, + // build enumerable attribute for each value with lazy accessor. + util.property(obj, name, function() { + if (cachedValue === null) { + cachedValue = get(); + } + return cachedValue; + }, enumerable); + }, - _consumeQuotedIdentifier: function(stream) { - var start = this._current; - this._current++; - var maxLength = stream.length; - while (stream[this._current] !== "\"" && this._current < maxLength) { - // You can escape a double quote and you can escape an escape. - var current = this._current; - if (stream[current] === "\\" && (stream[current + 1] === "\\" || - stream[current + 1] === "\"")) { - current += 2; - } else { - current++; - } - this._current = current; - } - this._current++; - return JSON.parse(stream.slice(start, this._current)); - }, + /** + * TODO Remove in major version revision + * This backfill populates response data without the + * top-level payload name. + * + * @api private + */ + hoistPayloadMember: function hoistPayloadMember(resp) { + var req = resp.request; + var operationName = req.operation; + var operation = req.service.api.operations[operationName]; + var output = operation.output; + if (output.payload && !operation.hasEventOutput) { + var payloadMember = output.members[output.payload]; + var responsePayload = resp.data[output.payload]; + if (payloadMember.type === 'structure') { + util.each(responsePayload, function(key, value) { + util.property(resp.data, key, value, false); + }); + } + } + }, - _consumeRawStringLiteral: function(stream) { - var start = this._current; - this._current++; - var maxLength = stream.length; - while (stream[this._current] !== "'" && this._current < maxLength) { - // You can escape a single quote and you can escape an escape. - var current = this._current; - if (stream[current] === "\\" && (stream[current + 1] === "\\" || - stream[current + 1] === "'")) { - current += 2; - } else { - current++; - } - this._current = current; + /** + * Compute SHA-256 checksums of streams + * + * @api private + */ + computeSha256: function computeSha256(body, done) { + if (util.isNode()) { + var Stream = util.stream.Stream; + var fs = __nccwpck_require__(57147); + if (typeof Stream === 'function' && body instanceof Stream) { + if (typeof body.path === 'string') { // assume file object + var settings = {}; + if (typeof body.start === 'number') { + settings.start = body.start; } - this._current++; - var literal = stream.slice(start + 1, this._current - 1); - return literal.replace("\\'", "'"); - }, - - _consumeNumber: function(stream) { - var start = this._current; - this._current++; - var maxLength = stream.length; - while (isNum(stream[this._current]) && this._current < maxLength) { - this._current++; + if (typeof body.end === 'number') { + settings.end = body.end; } - var value = parseInt(stream.slice(start, this._current)); - return {type: TOK_NUMBER, value: value, start: start}; - }, + body = fs.createReadStream(body.path, settings); + } else { // TODO support other stream types + return done(new Error('Non-file stream objects are ' + + 'not supported with SigV4')); + } + } + } - _consumeLBracket: function(stream) { - var start = this._current; - this._current++; - if (stream[this._current] === "?") { - this._current++; - return {type: TOK_FILTER, value: "[?", start: start}; - } else if (stream[this._current] === "]") { - this._current++; - return {type: TOK_FLATTEN, value: "[]", start: start}; - } else { - return {type: TOK_LBRACKET, value: "[", start: start}; - } - }, + util.crypto.sha256(body, 'hex', function(err, sha) { + if (err) done(err); + else done(null, sha); + }); + }, - _consumeOperator: function(stream) { - var start = this._current; - var startingChar = stream[start]; - this._current++; - if (startingChar === "!") { - if (stream[this._current] === "=") { - this._current++; - return {type: TOK_NE, value: "!=", start: start}; - } else { - return {type: TOK_NOT, value: "!", start: start}; - } - } else if (startingChar === "<") { - if (stream[this._current] === "=") { - this._current++; - return {type: TOK_LTE, value: "<=", start: start}; - } else { - return {type: TOK_LT, value: "<", start: start}; - } - } else if (startingChar === ">") { - if (stream[this._current] === "=") { - this._current++; - return {type: TOK_GTE, value: ">=", start: start}; - } else { - return {type: TOK_GT, value: ">", start: start}; - } - } else if (startingChar === "=") { - if (stream[this._current] === "=") { - this._current++; - return {type: TOK_EQ, value: "==", start: start}; - } - } - }, + /** + * @api private + */ + isClockSkewed: function isClockSkewed(serverTime) { + if (serverTime) { + util.property(AWS.config, 'isClockSkewed', + Math.abs(new Date().getTime() - serverTime) >= 300000, false); + return AWS.config.isClockSkewed; + } + }, - _consumeLiteral: function(stream) { - this._current++; - var start = this._current; - var maxLength = stream.length; - var literal; - while(stream[this._current] !== "`" && this._current < maxLength) { - // You can escape a literal char or you can escape the escape. - var current = this._current; - if (stream[current] === "\\" && (stream[current + 1] === "\\" || - stream[current + 1] === "`")) { - current += 2; - } else { - current++; - } - this._current = current; - } - var literalString = trimLeft(stream.slice(start, this._current)); - literalString = literalString.replace("\\`", "`"); - if (this._looksLikeJSON(literalString)) { - literal = JSON.parse(literalString); - } else { - // Try to JSON parse it as "" - literal = JSON.parse("\"" + literalString + "\""); - } - // +1 gets us to the ending "`", +1 to move on to the next char. - this._current++; - return literal; - }, + applyClockOffset: function applyClockOffset(serverTime) { + if (serverTime) + AWS.config.systemClockOffset = serverTime - new Date().getTime(); + }, - _looksLikeJSON: function(literalString) { - var startingChars = "[{\""; - var jsonLiterals = ["true", "false", "null"]; - var numberLooking = "-0123456789"; + /** + * @api private + */ + extractRequestId: function extractRequestId(resp) { + var requestId = resp.httpResponse.headers['x-amz-request-id'] || + resp.httpResponse.headers['x-amzn-requestid']; - if (literalString === "") { - return false; - } else if (startingChars.indexOf(literalString[0]) >= 0) { - return true; - } else if (jsonLiterals.indexOf(literalString) >= 0) { - return true; - } else if (numberLooking.indexOf(literalString[0]) >= 0) { - try { - JSON.parse(literalString); - return true; - } catch (ex) { - return false; - } - } else { - return false; - } - } - }; + if (!requestId && resp.data && resp.data.ResponseMetadata) { + requestId = resp.data.ResponseMetadata.RequestId; + } - var bindingPower = {}; - bindingPower[TOK_EOF] = 0; - bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0; - bindingPower[TOK_QUOTEDIDENTIFIER] = 0; - bindingPower[TOK_RBRACKET] = 0; - bindingPower[TOK_RPAREN] = 0; - bindingPower[TOK_COMMA] = 0; - bindingPower[TOK_RBRACE] = 0; - bindingPower[TOK_NUMBER] = 0; - bindingPower[TOK_CURRENT] = 0; - bindingPower[TOK_EXPREF] = 0; - bindingPower[TOK_PIPE] = 1; - bindingPower[TOK_OR] = 2; - bindingPower[TOK_AND] = 3; - bindingPower[TOK_EQ] = 5; - bindingPower[TOK_GT] = 5; - bindingPower[TOK_LT] = 5; - bindingPower[TOK_GTE] = 5; - bindingPower[TOK_LTE] = 5; - bindingPower[TOK_NE] = 5; - bindingPower[TOK_FLATTEN] = 9; - bindingPower[TOK_STAR] = 20; - bindingPower[TOK_FILTER] = 21; - bindingPower[TOK_DOT] = 40; - bindingPower[TOK_NOT] = 45; - bindingPower[TOK_LBRACE] = 50; - bindingPower[TOK_LBRACKET] = 55; - bindingPower[TOK_LPAREN] = 60; + if (requestId) { + resp.requestId = requestId; + } - function Parser() { - } + if (resp.error) { + resp.error.requestId = requestId; + } + }, - Parser.prototype = { - parse: function(expression) { - this._loadTokens(expression); - this.index = 0; - var ast = this.expression(0); - if (this._lookahead(0) !== TOK_EOF) { - var t = this._lookaheadToken(0); - var error = new Error( - "Unexpected token type: " + t.type + ", value: " + t.value); - error.name = "ParserError"; - throw error; - } - return ast; - }, + /** + * @api private + */ + addPromises: function addPromises(constructors, PromiseDependency) { + var deletePromises = false; + if (PromiseDependency === undefined && AWS && AWS.config) { + PromiseDependency = AWS.config.getPromisesDependency(); + } + if (PromiseDependency === undefined && typeof Promise !== 'undefined') { + PromiseDependency = Promise; + } + if (typeof PromiseDependency !== 'function') deletePromises = true; + if (!Array.isArray(constructors)) constructors = [constructors]; - _loadTokens: function(expression) { - var lexer = new Lexer(); - var tokens = lexer.tokenize(expression); - tokens.push({type: TOK_EOF, value: "", start: expression.length}); - this.tokens = tokens; - }, + for (var ind = 0; ind < constructors.length; ind++) { + var constructor = constructors[ind]; + if (deletePromises) { + if (constructor.deletePromisesFromClass) { + constructor.deletePromisesFromClass(); + } + } else if (constructor.addPromisesToClass) { + constructor.addPromisesToClass(PromiseDependency); + } + } + }, - expression: function(rbp) { - var leftToken = this._lookaheadToken(0); - this._advance(); - var left = this.nud(leftToken); - var currentToken = this._lookahead(0); - while (rbp < bindingPower[currentToken]) { - this._advance(); - left = this.led(currentToken, left); - currentToken = this._lookahead(0); + /** + * @api private + * Return a function that will return a promise whose fate is decided by the + * callback behavior of the given method with `methodName`. The method to be + * promisified should conform to node.js convention of accepting a callback as + * last argument and calling that callback with error as the first argument + * and success value on the second argument. + */ + promisifyMethod: function promisifyMethod(methodName, PromiseDependency) { + return function promise() { + var self = this; + var args = Array.prototype.slice.call(arguments); + return new PromiseDependency(function(resolve, reject) { + args.push(function(err, data) { + if (err) { + reject(err); + } else { + resolve(data); } - return left; - }, + }); + self[methodName].apply(self, args); + }); + }; + }, - _lookahead: function(number) { - return this.tokens[this.index + number].type; - }, + /** + * @api private + */ + isDualstackAvailable: function isDualstackAvailable(service) { + if (!service) return false; + var metadata = __nccwpck_require__(17752); + if (typeof service !== 'string') service = service.serviceIdentifier; + if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false; + return !!metadata[service].dualstackAvailable; + }, - _lookaheadToken: function(number) { - return this.tokens[this.index + number]; - }, + /** + * @api private + */ + calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) { + if (!retryDelayOptions) retryDelayOptions = {}; + var customBackoff = retryDelayOptions.customBackoff || null; + if (typeof customBackoff === 'function') { + return customBackoff(retryCount, err); + } + var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100; + var delay = Math.random() * (Math.pow(2, retryCount) * base); + return delay; + }, - _advance: function() { - this.index++; - }, + /** + * @api private + */ + handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) { + if (!options) options = {}; + var http = AWS.HttpClient.getInstance(); + var httpOptions = options.httpOptions || {}; + var retryCount = 0; - nud: function(token) { - var left; - var right; - var expression; - switch (token.type) { - case TOK_LITERAL: - return {type: "Literal", value: token.value}; - case TOK_UNQUOTEDIDENTIFIER: - return {type: "Field", name: token.value}; - case TOK_QUOTEDIDENTIFIER: - var node = {type: "Field", name: token.value}; - if (this._lookahead(0) === TOK_LPAREN) { - throw new Error("Quoted identifier not allowed for function names."); - } - return node; - case TOK_NOT: - right = this.expression(bindingPower.Not); - return {type: "NotExpression", children: [right]}; - case TOK_STAR: - left = {type: "Identity"}; - right = null; - if (this._lookahead(0) === TOK_RBRACKET) { - // This can happen in a multiselect, - // [a, b, *] - right = {type: "Identity"}; - } else { - right = this._parseProjectionRHS(bindingPower.Star); - } - return {type: "ValueProjection", children: [left, right]}; - case TOK_FILTER: - return this.led(token.type, {type: "Identity"}); - case TOK_LBRACE: - return this._parseMultiselectHash(); - case TOK_FLATTEN: - left = {type: TOK_FLATTEN, children: [{type: "Identity"}]}; - right = this._parseProjectionRHS(bindingPower.Flatten); - return {type: "Projection", children: [left, right]}; - case TOK_LBRACKET: - if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) { - right = this._parseIndexExpression(); - return this._projectIfSlice({type: "Identity"}, right); - } else if (this._lookahead(0) === TOK_STAR && - this._lookahead(1) === TOK_RBRACKET) { - this._advance(); - this._advance(); - right = this._parseProjectionRHS(bindingPower.Star); - return {type: "Projection", - children: [{type: "Identity"}, right]}; - } - return this._parseMultiselectList(); - case TOK_CURRENT: - return {type: TOK_CURRENT}; - case TOK_EXPREF: - expression = this.expression(bindingPower.Expref); - return {type: "ExpressionReference", children: [expression]}; - case TOK_LPAREN: - var args = []; - while (this._lookahead(0) !== TOK_RPAREN) { - if (this._lookahead(0) === TOK_CURRENT) { - expression = {type: TOK_CURRENT}; - this._advance(); - } else { - expression = this.expression(0); - } - args.push(expression); - } - this._match(TOK_RPAREN); - return args[0]; - default: - this._errorToken(token); + var errCallback = function(err) { + var maxRetries = options.maxRetries || 0; + if (err && err.code === 'TimeoutError') err.retryable = true; + + // Call `calculateRetryDelay()` only when relevant, see #3401 + if (err && err.retryable && retryCount < maxRetries) { + var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err); + if (delay >= 0) { + retryCount++; + setTimeout(sendRequest, delay + (err.retryAfter || 0)); + return; } - }, + } + cb(err); + }; - led: function(tokenName, left) { - var right; - switch(tokenName) { - case TOK_DOT: - var rbp = bindingPower.Dot; - if (this._lookahead(0) !== TOK_STAR) { - right = this._parseDotRHS(rbp); - return {type: "Subexpression", children: [left, right]}; - } - // Creating a projection. - this._advance(); - right = this._parseProjectionRHS(rbp); - return {type: "ValueProjection", children: [left, right]}; - case TOK_PIPE: - right = this.expression(bindingPower.Pipe); - return {type: TOK_PIPE, children: [left, right]}; - case TOK_OR: - right = this.expression(bindingPower.Or); - return {type: "OrExpression", children: [left, right]}; - case TOK_AND: - right = this.expression(bindingPower.And); - return {type: "AndExpression", children: [left, right]}; - case TOK_LPAREN: - var name = left.name; - var args = []; - var expression, node; - while (this._lookahead(0) !== TOK_RPAREN) { - if (this._lookahead(0) === TOK_CURRENT) { - expression = {type: TOK_CURRENT}; - this._advance(); - } else { - expression = this.expression(0); - } - if (this._lookahead(0) === TOK_COMMA) { - this._match(TOK_COMMA); + var sendRequest = function() { + var data = ''; + http.handleRequest(httpRequest, httpOptions, function(httpResponse) { + httpResponse.on('data', function(chunk) { data += chunk.toString(); }); + httpResponse.on('end', function() { + var statusCode = httpResponse.statusCode; + if (statusCode < 300) { + cb(null, data); + } else { + var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0; + var err = util.error(new Error(), + { + statusCode: statusCode, + retryable: statusCode >= 500 || statusCode === 429 } - args.push(expression); - } - this._match(TOK_RPAREN); - node = {type: "Function", name: name, children: args}; - return node; - case TOK_FILTER: - var condition = this.expression(0); - this._match(TOK_RBRACKET); - if (this._lookahead(0) === TOK_FLATTEN) { - right = {type: "Identity"}; - } else { - right = this._parseProjectionRHS(bindingPower.Filter); - } - return {type: "FilterProjection", children: [left, right, condition]}; - case TOK_FLATTEN: - var leftNode = {type: TOK_FLATTEN, children: [left]}; - var rightNode = this._parseProjectionRHS(bindingPower.Flatten); - return {type: "Projection", children: [leftNode, rightNode]}; - case TOK_EQ: - case TOK_NE: - case TOK_GT: - case TOK_GTE: - case TOK_LT: - case TOK_LTE: - return this._parseComparator(left, tokenName); - case TOK_LBRACKET: - var token = this._lookaheadToken(0); - if (token.type === TOK_NUMBER || token.type === TOK_COLON) { - right = this._parseIndexExpression(); - return this._projectIfSlice(left, right); - } - this._match(TOK_STAR); - this._match(TOK_RBRACKET); - right = this._parseProjectionRHS(bindingPower.Star); - return {type: "Projection", children: [left, right]}; - default: - this._errorToken(this._lookaheadToken(0)); - } - }, + ); + if (retryAfter && err.retryable) err.retryAfter = retryAfter; + errCallback(err); + } + }); + }, errCallback); + }; + + AWS.util.defer(sendRequest); + }, + + /** + * @api private + */ + uuid: { + v4: function uuidV4() { + return (__nccwpck_require__(75840).v4)(); + } + }, + + /** + * @api private + */ + convertPayloadToString: function convertPayloadToString(resp) { + var req = resp.request; + var operation = req.operation; + var rules = req.service.api.operations[operation].output || {}; + if (rules.payload && resp.data[rules.payload]) { + resp.data[rules.payload] = resp.data[rules.payload].toString(); + } + }, + + /** + * @api private + */ + defer: function defer(callback) { + if (typeof process === 'object' && typeof process.nextTick === 'function') { + process.nextTick(callback); + } else if (typeof setImmediate === 'function') { + setImmediate(callback); + } else { + setTimeout(callback, 0); + } + }, - _match: function(tokenType) { - if (this._lookahead(0) === tokenType) { - this._advance(); - } else { - var t = this._lookaheadToken(0); - var error = new Error("Expected " + tokenType + ", got: " + t.type); - error.name = "ParserError"; - throw error; - } - }, + /** + * @api private + */ + getRequestPayloadShape: function getRequestPayloadShape(req) { + var operations = req.service.api.operations; + if (!operations) return undefined; + var operation = (operations || {})[req.operation]; + if (!operation || !operation.input || !operation.input.payload) return undefined; + return operation.input.members[operation.input.payload]; + }, - _errorToken: function(token) { - var error = new Error("Invalid token (" + - token.type + "): \"" + - token.value + "\""); - error.name = "ParserError"; - throw error; - }, + getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) { + var profiles = {}; + var profilesFromConfig = {}; + if (process.env[util.configOptInEnv]) { + var profilesFromConfig = iniLoader.loadFrom({ + isConfig: true, + filename: process.env[util.sharedConfigFileEnv] + }); + } + var profilesFromCreds= {}; + try { + var profilesFromCreds = iniLoader.loadFrom({ + filename: filename || + (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]) + }); + } catch (error) { + // if using config, assume it is fully descriptive without a credentials file: + if (!process.env[util.configOptInEnv]) throw error; + } + for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) { + profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromConfig[profileNames[i]]); + } + for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) { + profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromCreds[profileNames[i]]); + } + return profiles; + /** + * Roughly the semantics of `Object.assign(target, source)` + */ + function objectAssign(target, source) { + for (var i = 0, keys = Object.keys(source); i < keys.length; i++) { + target[keys[i]] = source[keys[i]]; + } + return target; + } + }, - _parseIndexExpression: function() { - if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) { - return this._parseSliceExpression(); - } else { - var node = { - type: "Index", - value: this._lookaheadToken(0).value}; - this._advance(); - this._match(TOK_RBRACKET); - return node; - } - }, + /** + * @api private + */ + ARN: { + validate: function validateARN(str) { + return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6; + }, + parse: function parseARN(arn) { + var matched = arn.split(':'); + return { + partition: matched[1], + service: matched[2], + region: matched[3], + accountId: matched[4], + resource: matched.slice(5).join(':') + }; + }, + build: function buildARN(arnObject) { + if ( + arnObject.service === undefined || + arnObject.region === undefined || + arnObject.accountId === undefined || + arnObject.resource === undefined + ) throw util.error(new Error('Input ARN object is invalid')); + return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service + + ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource; + } + }, - _projectIfSlice: function(left, right) { - var indexExpr = {type: "IndexExpression", children: [left, right]}; - if (right.type === "Slice") { - return { - type: "Projection", - children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)] - }; - } else { - return indexExpr; - } - }, + /** + * @api private + */ + defaultProfile: 'default', - _parseSliceExpression: function() { - // [start:end:step] where each part is optional, as well as the last - // colon. - var parts = [null, null, null]; - var index = 0; - var currentToken = this._lookahead(0); - while (currentToken !== TOK_RBRACKET && index < 3) { - if (currentToken === TOK_COLON) { - index++; - this._advance(); - } else if (currentToken === TOK_NUMBER) { - parts[index] = this._lookaheadToken(0).value; - this._advance(); - } else { - var t = this._lookahead(0); - var error = new Error("Syntax error, unexpected token: " + - t.value + "(" + t.type + ")"); - error.name = "Parsererror"; - throw error; - } - currentToken = this._lookahead(0); - } - this._match(TOK_RBRACKET); - return { - type: "Slice", - children: parts - }; - }, + /** + * @api private + */ + configOptInEnv: 'AWS_SDK_LOAD_CONFIG', - _parseComparator: function(left, comparator) { - var right = this.expression(bindingPower[comparator]); - return {type: "Comparator", name: comparator, children: [left, right]}; - }, + /** + * @api private + */ + sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE', - _parseDotRHS: function(rbp) { - var lookahead = this._lookahead(0); - var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR]; - if (exprTokens.indexOf(lookahead) >= 0) { - return this.expression(rbp); - } else if (lookahead === TOK_LBRACKET) { - this._match(TOK_LBRACKET); - return this._parseMultiselectList(); - } else if (lookahead === TOK_LBRACE) { - this._match(TOK_LBRACE); - return this._parseMultiselectHash(); - } - }, + /** + * @api private + */ + sharedConfigFileEnv: 'AWS_CONFIG_FILE', - _parseProjectionRHS: function(rbp) { - var right; - if (bindingPower[this._lookahead(0)] < 10) { - right = {type: "Identity"}; - } else if (this._lookahead(0) === TOK_LBRACKET) { - right = this.expression(rbp); - } else if (this._lookahead(0) === TOK_FILTER) { - right = this.expression(rbp); - } else if (this._lookahead(0) === TOK_DOT) { - this._match(TOK_DOT); - right = this._parseDotRHS(rbp); - } else { - var t = this._lookaheadToken(0); - var error = new Error("Sytanx error, unexpected token: " + - t.value + "(" + t.type + ")"); - error.name = "ParserError"; - throw error; - } - return right; - }, + /** + * @api private + */ + imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED' +}; - _parseMultiselectList: function() { - var expressions = []; - while (this._lookahead(0) !== TOK_RBRACKET) { - var expression = this.expression(0); - expressions.push(expression); - if (this._lookahead(0) === TOK_COMMA) { - this._match(TOK_COMMA); - if (this._lookahead(0) === TOK_RBRACKET) { - throw new Error("Unexpected token Rbracket"); - } - } - } - this._match(TOK_RBRACKET); - return {type: "MultiSelectList", children: expressions}; - }, +/** + * @api private + */ +module.exports = util; - _parseMultiselectHash: function() { - var pairs = []; - var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER]; - var keyToken, keyName, value, node; - for (;;) { - keyToken = this._lookaheadToken(0); - if (identifierTypes.indexOf(keyToken.type) < 0) { - throw new Error("Expecting an identifier token, got: " + - keyToken.type); - } - keyName = keyToken.value; - this._advance(); - this._match(TOK_COLON); - value = this.expression(0); - node = {type: "KeyValuePair", name: keyName, value: value}; - pairs.push(node); - if (this._lookahead(0) === TOK_COMMA) { - this._match(TOK_COMMA); - } else if (this._lookahead(0) === TOK_RBRACE) { - this._match(TOK_RBRACE); - break; - } - } - return {type: "MultiSelectHash", children: pairs}; - } - }; +/***/ }), + +/***/ 23546: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function TreeInterpreter(runtime) { - this.runtime = runtime; - } +var util = __nccwpck_require__(77985); +var XmlNode = (__nccwpck_require__(20397).XmlNode); +var XmlText = (__nccwpck_require__(90971).XmlText); - TreeInterpreter.prototype = { - search: function(node, value) { - return this.visit(node, value); - }, +function XmlBuilder() { } - visit: function(node, value) { - var matched, current, result, first, second, field, left, right, collected, i; - switch (node.type) { - case "Field": - if (value !== null && isObject(value)) { - field = value[node.name]; - if (field === undefined) { - return null; - } else { - return field; - } - } - return null; - case "Subexpression": - result = this.visit(node.children[0], value); - for (i = 1; i < node.children.length; i++) { - result = this.visit(node.children[1], result); - if (result === null) { - return null; - } - } - return result; - case "IndexExpression": - left = this.visit(node.children[0], value); - right = this.visit(node.children[1], left); - return right; - case "Index": - if (!isArray(value)) { - return null; - } - var index = node.value; - if (index < 0) { - index = value.length + index; - } - result = value[index]; - if (result === undefined) { - result = null; - } - return result; - case "Slice": - if (!isArray(value)) { - return null; - } - var sliceParams = node.children.slice(0); - var computed = this.computeSliceParams(value.length, sliceParams); - var start = computed[0]; - var stop = computed[1]; - var step = computed[2]; - result = []; - if (step > 0) { - for (i = start; i < stop; i += step) { - result.push(value[i]); - } - } else { - for (i = start; i > stop; i += step) { - result.push(value[i]); - } - } - return result; - case "Projection": - // Evaluate left child. - var base = this.visit(node.children[0], value); - if (!isArray(base)) { - return null; - } - collected = []; - for (i = 0; i < base.length; i++) { - current = this.visit(node.children[1], base[i]); - if (current !== null) { - collected.push(current); - } - } - return collected; - case "ValueProjection": - // Evaluate left child. - base = this.visit(node.children[0], value); - if (!isObject(base)) { - return null; - } - collected = []; - var values = objValues(base); - for (i = 0; i < values.length; i++) { - current = this.visit(node.children[1], values[i]); - if (current !== null) { - collected.push(current); - } - } - return collected; - case "FilterProjection": - base = this.visit(node.children[0], value); - if (!isArray(base)) { - return null; - } - var filtered = []; - var finalResults = []; - for (i = 0; i < base.length; i++) { - matched = this.visit(node.children[2], base[i]); - if (!isFalse(matched)) { - filtered.push(base[i]); - } - } - for (var j = 0; j < filtered.length; j++) { - current = this.visit(node.children[1], filtered[j]); - if (current !== null) { - finalResults.push(current); - } - } - return finalResults; - case "Comparator": - first = this.visit(node.children[0], value); - second = this.visit(node.children[1], value); - switch(node.name) { - case TOK_EQ: - result = strictDeepEqual(first, second); - break; - case TOK_NE: - result = !strictDeepEqual(first, second); - break; - case TOK_GT: - result = first > second; - break; - case TOK_GTE: - result = first >= second; - break; - case TOK_LT: - result = first < second; - break; - case TOK_LTE: - result = first <= second; - break; - default: - throw new Error("Unknown comparator: " + node.name); - } - return result; - case TOK_FLATTEN: - var original = this.visit(node.children[0], value); - if (!isArray(original)) { - return null; - } - var merged = []; - for (i = 0; i < original.length; i++) { - current = original[i]; - if (isArray(current)) { - merged.push.apply(merged, current); - } else { - merged.push(current); - } - } - return merged; - case "Identity": - return value; - case "MultiSelectList": - if (value === null) { - return null; - } - collected = []; - for (i = 0; i < node.children.length; i++) { - collected.push(this.visit(node.children[i], value)); - } - return collected; - case "MultiSelectHash": - if (value === null) { - return null; - } - collected = {}; - var child; - for (i = 0; i < node.children.length; i++) { - child = node.children[i]; - collected[child.name] = this.visit(child.value, value); - } - return collected; - case "OrExpression": - matched = this.visit(node.children[0], value); - if (isFalse(matched)) { - matched = this.visit(node.children[1], value); - } - return matched; - case "AndExpression": - first = this.visit(node.children[0], value); +XmlBuilder.prototype.toXML = function(params, shape, rootElement, noEmpty) { + var xml = new XmlNode(rootElement); + applyNamespaces(xml, shape, true); + serialize(xml, params, shape); + return xml.children.length > 0 || noEmpty ? xml.toString() : ''; +}; - if (isFalse(first) === true) { - return first; - } - return this.visit(node.children[1], value); - case "NotExpression": - first = this.visit(node.children[0], value); - return isFalse(first); - case "Literal": - return node.value; - case TOK_PIPE: - left = this.visit(node.children[0], value); - return this.visit(node.children[1], left); - case TOK_CURRENT: - return value; - case "Function": - var resolvedArgs = []; - for (i = 0; i < node.children.length; i++) { - resolvedArgs.push(this.visit(node.children[i], value)); - } - return this.runtime.callFunction(node.name, resolvedArgs); - case "ExpressionReference": - var refNode = node.children[0]; - // Tag the node with a specific attribute so the type - // checker verify the type. - refNode.jmespathType = TOK_EXPREF; - return refNode; - default: - throw new Error("Unknown node type: " + node.type); - } - }, +function serialize(xml, value, shape) { + switch (shape.type) { + case 'structure': return serializeStructure(xml, value, shape); + case 'map': return serializeMap(xml, value, shape); + case 'list': return serializeList(xml, value, shape); + default: return serializeScalar(xml, value, shape); + } +} + +function serializeStructure(xml, params, shape) { + util.arrayEach(shape.memberNames, function(memberName) { + var memberShape = shape.members[memberName]; + if (memberShape.location !== 'body') return; + + var value = params[memberName]; + var name = memberShape.name; + if (value !== undefined && value !== null) { + if (memberShape.isXmlAttribute) { + xml.addAttribute(name, value); + } else if (memberShape.flattened) { + serialize(xml, value, memberShape); + } else { + var element = new XmlNode(name); + xml.addChildNode(element); + applyNamespaces(element, memberShape); + serialize(element, value, memberShape); + } + } + }); +} - computeSliceParams: function(arrayLength, sliceParams) { - var start = sliceParams[0]; - var stop = sliceParams[1]; - var step = sliceParams[2]; - var computed = [null, null, null]; - if (step === null) { - step = 1; - } else if (step === 0) { - var error = new Error("Invalid slice, step cannot be 0"); - error.name = "RuntimeError"; - throw error; - } - var stepValueNegative = step < 0 ? true : false; +function serializeMap(xml, map, shape) { + var xmlKey = shape.key.name || 'key'; + var xmlValue = shape.value.name || 'value'; - if (start === null) { - start = stepValueNegative ? arrayLength - 1 : 0; - } else { - start = this.capSliceRange(arrayLength, start, step); - } + util.each(map, function(key, value) { + var entry = new XmlNode(shape.flattened ? shape.name : 'entry'); + xml.addChildNode(entry); - if (stop === null) { - stop = stepValueNegative ? -1 : arrayLength; - } else { - stop = this.capSliceRange(arrayLength, stop, step); - } - computed[0] = start; - computed[1] = stop; - computed[2] = step; - return computed; - }, + var entryKey = new XmlNode(xmlKey); + var entryValue = new XmlNode(xmlValue); + entry.addChildNode(entryKey); + entry.addChildNode(entryValue); - capSliceRange: function(arrayLength, actualValue, step) { - if (actualValue < 0) { - actualValue += arrayLength; - if (actualValue < 0) { - actualValue = step < 0 ? -1 : 0; - } - } else if (actualValue >= arrayLength) { - actualValue = step < 0 ? arrayLength - 1 : arrayLength; - } - return actualValue; - } + serialize(entryKey, key, shape.key); + serialize(entryValue, value, shape.value); + }); +} - }; +function serializeList(xml, list, shape) { + if (shape.flattened) { + util.arrayEach(list, function(value) { + var name = shape.member.name || shape.name; + var element = new XmlNode(name); + xml.addChildNode(element); + serialize(element, value, shape.member); + }); + } else { + util.arrayEach(list, function(value) { + var name = shape.member.name || 'member'; + var element = new XmlNode(name); + xml.addChildNode(element); + serialize(element, value, shape.member); + }); + } +} - function Runtime(interpreter) { - this._interpreter = interpreter; - this.functionTable = { - // name: [function, ] - // The can be: - // - // { - // args: [[type1, type2], [type1, type2]], - // variadic: true|false - // } - // - // Each arg in the arg list is a list of valid types - // (if the function is overloaded and supports multiple - // types. If the type is "any" then no type checking - // occurs on the argument. Variadic is optional - // and if not provided is assumed to be false. - abs: {_func: this._functionAbs, _signature: [{types: [TYPE_NUMBER]}]}, - avg: {_func: this._functionAvg, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, - ceil: {_func: this._functionCeil, _signature: [{types: [TYPE_NUMBER]}]}, - contains: { - _func: this._functionContains, - _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}, - {types: [TYPE_ANY]}]}, - "ends_with": { - _func: this._functionEndsWith, - _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, - floor: {_func: this._functionFloor, _signature: [{types: [TYPE_NUMBER]}]}, - length: { - _func: this._functionLength, - _signature: [{types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]}]}, - map: { - _func: this._functionMap, - _signature: [{types: [TYPE_EXPREF]}, {types: [TYPE_ARRAY]}]}, - max: { - _func: this._functionMax, - _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, - "merge": { - _func: this._functionMerge, - _signature: [{types: [TYPE_OBJECT], variadic: true}] - }, - "max_by": { - _func: this._functionMaxBy, - _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] - }, - sum: {_func: this._functionSum, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, - "starts_with": { - _func: this._functionStartsWith, - _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, - min: { - _func: this._functionMin, - _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, - "min_by": { - _func: this._functionMinBy, - _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] - }, - type: {_func: this._functionType, _signature: [{types: [TYPE_ANY]}]}, - keys: {_func: this._functionKeys, _signature: [{types: [TYPE_OBJECT]}]}, - values: {_func: this._functionValues, _signature: [{types: [TYPE_OBJECT]}]}, - sort: {_func: this._functionSort, _signature: [{types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]}]}, - "sort_by": { - _func: this._functionSortBy, - _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] - }, - join: { - _func: this._functionJoin, - _signature: [ - {types: [TYPE_STRING]}, - {types: [TYPE_ARRAY_STRING]} - ] - }, - reverse: { - _func: this._functionReverse, - _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}]}, - "to_array": {_func: this._functionToArray, _signature: [{types: [TYPE_ANY]}]}, - "to_string": {_func: this._functionToString, _signature: [{types: [TYPE_ANY]}]}, - "to_number": {_func: this._functionToNumber, _signature: [{types: [TYPE_ANY]}]}, - "not_null": { - _func: this._functionNotNull, - _signature: [{types: [TYPE_ANY], variadic: true}] - } - }; +function serializeScalar(xml, value, shape) { + xml.addChildNode( + new XmlText(shape.toWireFormat(value)) + ); +} + +function applyNamespaces(xml, shape, isRoot) { + var uri, prefix = 'xmlns'; + if (shape.xmlNamespaceUri) { + uri = shape.xmlNamespaceUri; + if (shape.xmlNamespacePrefix) prefix += ':' + shape.xmlNamespacePrefix; + } else if (isRoot && shape.api.xmlNamespaceUri) { + uri = shape.api.xmlNamespaceUri; } - Runtime.prototype = { - callFunction: function(name, resolvedArgs) { - var functionEntry = this.functionTable[name]; - if (functionEntry === undefined) { - throw new Error("Unknown function: " + name + "()"); - } - this._validateArgs(name, resolvedArgs, functionEntry._signature); - return functionEntry._func.call(this, resolvedArgs); - }, + if (uri) xml.addAttribute(prefix, uri); +} - _validateArgs: function(name, args, signature) { - // Validating the args requires validating - // the correct arity and the correct type of each arg. - // If the last argument is declared as variadic, then we need - // a minimum number of args to be required. Otherwise it has to - // be an exact amount. - var pluralized; - if (signature[signature.length - 1].variadic) { - if (args.length < signature.length) { - pluralized = signature.length === 1 ? " argument" : " arguments"; - throw new Error("ArgumentError: " + name + "() " + - "takes at least" + signature.length + pluralized + - " but received " + args.length); - } - } else if (args.length !== signature.length) { - pluralized = signature.length === 1 ? " argument" : " arguments"; - throw new Error("ArgumentError: " + name + "() " + - "takes " + signature.length + pluralized + - " but received " + args.length); - } - var currentSpec; - var actualType; - var typeMatched; - for (var i = 0; i < signature.length; i++) { - typeMatched = false; - currentSpec = signature[i].types; - actualType = this._getTypeName(args[i]); - for (var j = 0; j < currentSpec.length; j++) { - if (this._typeMatches(actualType, currentSpec[j], args[i])) { - typeMatched = true; - break; - } - } - if (!typeMatched) { - var expected = currentSpec - .map(function(typeIdentifier) { - return TYPE_NAME_TABLE[typeIdentifier]; - }) - .join(','); - throw new Error("TypeError: " + name + "() " + - "expected argument " + (i + 1) + - " to be type " + expected + - " but received type " + - TYPE_NAME_TABLE[actualType] + " instead."); - } - } - }, +/** + * @api private + */ +module.exports = XmlBuilder; - _typeMatches: function(actual, expected, argValue) { - if (expected === TYPE_ANY) { - return true; - } - if (expected === TYPE_ARRAY_STRING || - expected === TYPE_ARRAY_NUMBER || - expected === TYPE_ARRAY) { - // The expected type can either just be array, - // or it can require a specific subtype (array of numbers). - // - // The simplest case is if "array" with no subtype is specified. - if (expected === TYPE_ARRAY) { - return actual === TYPE_ARRAY; - } else if (actual === TYPE_ARRAY) { - // Otherwise we need to check subtypes. - // I think this has potential to be improved. - var subtype; - if (expected === TYPE_ARRAY_NUMBER) { - subtype = TYPE_NUMBER; - } else if (expected === TYPE_ARRAY_STRING) { - subtype = TYPE_STRING; - } - for (var i = 0; i < argValue.length; i++) { - if (!this._typeMatches( - this._getTypeName(argValue[i]), subtype, - argValue[i])) { - return false; - } - } - return true; - } - } else { - return actual === expected; - } - }, - _getTypeName: function(obj) { - switch (Object.prototype.toString.call(obj)) { - case "[object String]": - return TYPE_STRING; - case "[object Number]": - return TYPE_NUMBER; - case "[object Array]": - return TYPE_ARRAY; - case "[object Boolean]": - return TYPE_BOOLEAN; - case "[object Null]": - return TYPE_NULL; - case "[object Object]": - // Check if it's an expref. If it has, it's been - // tagged with a jmespathType attr of 'Expref'; - if (obj.jmespathType === TOK_EXPREF) { - return TYPE_EXPREF; - } else { - return TYPE_OBJECT; - } - } - }, - _functionStartsWith: function(resolvedArgs) { - return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0; - }, +/***/ }), - _functionEndsWith: function(resolvedArgs) { - var searchStr = resolvedArgs[0]; - var suffix = resolvedArgs[1]; - return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1; - }, +/***/ 98241: +/***/ ((module) => { - _functionReverse: function(resolvedArgs) { - var typeName = this._getTypeName(resolvedArgs[0]); - if (typeName === TYPE_STRING) { - var originalStr = resolvedArgs[0]; - var reversedStr = ""; - for (var i = originalStr.length - 1; i >= 0; i--) { - reversedStr += originalStr[i]; - } - return reversedStr; - } else { - var reversedArray = resolvedArgs[0].slice(0); - reversedArray.reverse(); - return reversedArray; - } - }, +/** + * Escapes characters that can not be in an XML attribute. + */ +function escapeAttribute(value) { + return value.replace(/&/g, '&').replace(/'/g, ''').replace(//g, '>').replace(/"/g, '"'); +} - _functionAbs: function(resolvedArgs) { - return Math.abs(resolvedArgs[0]); - }, +/** + * @api private + */ +module.exports = { + escapeAttribute: escapeAttribute +}; - _functionCeil: function(resolvedArgs) { - return Math.ceil(resolvedArgs[0]); - }, - _functionAvg: function(resolvedArgs) { - var sum = 0; - var inputArray = resolvedArgs[0]; - for (var i = 0; i < inputArray.length; i++) { - sum += inputArray[i]; - } - return sum / inputArray.length; - }, +/***/ }), - _functionContains: function(resolvedArgs) { - return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0; - }, +/***/ 98464: +/***/ ((module) => { - _functionFloor: function(resolvedArgs) { - return Math.floor(resolvedArgs[0]); - }, +/** + * Escapes characters that can not be in an XML element. + */ +function escapeElement(value) { + return value.replace(/&/g, '&') + .replace(//g, '>') + .replace(/\r/g, ' ') + .replace(/\n/g, ' ') + .replace(/\u0085/g, '…') + .replace(/\u2028/, '
'); +} - _functionLength: function(resolvedArgs) { - if (!isObject(resolvedArgs[0])) { - return resolvedArgs[0].length; - } else { - // As far as I can tell, there's no way to get the length - // of an object without O(n) iteration through the object. - return Object.keys(resolvedArgs[0]).length; - } - }, +/** + * @api private + */ +module.exports = { + escapeElement: escapeElement +}; - _functionMap: function(resolvedArgs) { - var mapped = []; - var interpreter = this._interpreter; - var exprefNode = resolvedArgs[0]; - var elements = resolvedArgs[1]; - for (var i = 0; i < elements.length; i++) { - mapped.push(interpreter.visit(exprefNode, elements[i])); - } - return mapped; - }, - _functionMerge: function(resolvedArgs) { - var merged = {}; - for (var i = 0; i < resolvedArgs.length; i++) { - var current = resolvedArgs[i]; - for (var key in current) { - merged[key] = current[key]; - } - } - return merged; - }, +/***/ }), - _functionMax: function(resolvedArgs) { - if (resolvedArgs[0].length > 0) { - var typeName = this._getTypeName(resolvedArgs[0][0]); - if (typeName === TYPE_NUMBER) { - return Math.max.apply(Math, resolvedArgs[0]); - } else { - var elements = resolvedArgs[0]; - var maxElement = elements[0]; - for (var i = 1; i < elements.length; i++) { - if (maxElement.localeCompare(elements[i]) < 0) { - maxElement = elements[i]; - } - } - return maxElement; - } - } else { - return null; - } - }, +/***/ 96752: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - _functionMin: function(resolvedArgs) { - if (resolvedArgs[0].length > 0) { - var typeName = this._getTypeName(resolvedArgs[0][0]); - if (typeName === TYPE_NUMBER) { - return Math.min.apply(Math, resolvedArgs[0]); - } else { - var elements = resolvedArgs[0]; - var minElement = elements[0]; - for (var i = 1; i < elements.length; i++) { - if (elements[i].localeCompare(minElement) < 0) { - minElement = elements[i]; - } - } - return minElement; - } - } else { - return null; - } - }, +var AWS = __nccwpck_require__(28437); +var util = AWS.util; +var Shape = AWS.Model.Shape; - _functionSum: function(resolvedArgs) { - var sum = 0; - var listToSum = resolvedArgs[0]; - for (var i = 0; i < listToSum.length; i++) { - sum += listToSum[i]; - } - return sum; - }, +var xml2js = __nccwpck_require__(66189); - _functionType: function(resolvedArgs) { - switch (this._getTypeName(resolvedArgs[0])) { - case TYPE_NUMBER: - return "number"; - case TYPE_STRING: - return "string"; - case TYPE_ARRAY: - return "array"; - case TYPE_OBJECT: - return "object"; - case TYPE_BOOLEAN: - return "boolean"; - case TYPE_EXPREF: - return "expref"; - case TYPE_NULL: - return "null"; - } - }, +/** + * @api private + */ +var options = { // options passed to xml2js parser + explicitCharkey: false, // undocumented + trim: false, // trim the leading/trailing whitespace from text nodes + normalize: false, // trim interior whitespace inside text nodes + explicitRoot: false, // return the root node in the resulting object? + emptyTag: null, // the default value for empty nodes + explicitArray: true, // always put child nodes in an array + ignoreAttrs: false, // ignore attributes, only create text nodes + mergeAttrs: false, // merge attributes and child elements + validator: null // a callable validator +}; + +function NodeXmlParser() { } + +NodeXmlParser.prototype.parse = function(xml, shape) { + shape = shape || {}; + + var result = null; + var error = null; + + var parser = new xml2js.Parser(options); + parser.parseString(xml, function (e, r) { + error = e; + result = r; + }); + + if (result) { + var data = parseXml(result, shape); + if (result.ResponseMetadata) { + data.ResponseMetadata = parseXml(result.ResponseMetadata[0], {}); + } + return data; + } else if (error) { + throw util.error(error, {code: 'XMLParserError', retryable: true}); + } else { // empty xml document + return parseXml({}, shape); + } +}; + +function parseXml(xml, shape) { + switch (shape.type) { + case 'structure': return parseStructure(xml, shape); + case 'map': return parseMap(xml, shape); + case 'list': return parseList(xml, shape); + case undefined: case null: return parseUnknown(xml); + default: return parseScalar(xml, shape); + } +} - _functionKeys: function(resolvedArgs) { - return Object.keys(resolvedArgs[0]); - }, +function parseStructure(xml, shape) { + var data = {}; + if (xml === null) return data; - _functionValues: function(resolvedArgs) { - var obj = resolvedArgs[0]; - var keys = Object.keys(obj); - var values = []; - for (var i = 0; i < keys.length; i++) { - values.push(obj[keys[i]]); - } - return values; - }, + util.each(shape.members, function(memberName, memberShape) { + var xmlName = memberShape.name; + if (Object.prototype.hasOwnProperty.call(xml, xmlName) && Array.isArray(xml[xmlName])) { + var xmlChild = xml[xmlName]; + if (!memberShape.flattened) xmlChild = xmlChild[0]; - _functionJoin: function(resolvedArgs) { - var joinChar = resolvedArgs[0]; - var listJoin = resolvedArgs[1]; - return listJoin.join(joinChar); - }, + data[memberName] = parseXml(xmlChild, memberShape); + } else if (memberShape.isXmlAttribute && + xml.$ && Object.prototype.hasOwnProperty.call(xml.$, xmlName)) { + data[memberName] = parseScalar(xml.$[xmlName], memberShape); + } else if (memberShape.type === 'list' && !shape.api.xmlNoDefaultLists) { + data[memberName] = memberShape.defaultValue; + } + }); - _functionToArray: function(resolvedArgs) { - if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) { - return resolvedArgs[0]; - } else { - return [resolvedArgs[0]]; - } - }, + return data; +} - _functionToString: function(resolvedArgs) { - if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) { - return resolvedArgs[0]; - } else { - return JSON.stringify(resolvedArgs[0]); - } - }, +function parseMap(xml, shape) { + var data = {}; + if (xml === null) return data; - _functionToNumber: function(resolvedArgs) { - var typeName = this._getTypeName(resolvedArgs[0]); - var convertedValue; - if (typeName === TYPE_NUMBER) { - return resolvedArgs[0]; - } else if (typeName === TYPE_STRING) { - convertedValue = +resolvedArgs[0]; - if (!isNaN(convertedValue)) { - return convertedValue; - } - } - return null; - }, + var xmlKey = shape.key.name || 'key'; + var xmlValue = shape.value.name || 'value'; + var iterable = shape.flattened ? xml : xml.entry; - _functionNotNull: function(resolvedArgs) { - for (var i = 0; i < resolvedArgs.length; i++) { - if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) { - return resolvedArgs[i]; - } - } - return null; - }, + if (Array.isArray(iterable)) { + util.arrayEach(iterable, function(child) { + data[child[xmlKey][0]] = parseXml(child[xmlValue][0], shape.value); + }); + } - _functionSort: function(resolvedArgs) { - var sortedArray = resolvedArgs[0].slice(0); - sortedArray.sort(); - return sortedArray; - }, + return data; +} - _functionSortBy: function(resolvedArgs) { - var sortedArray = resolvedArgs[0].slice(0); - if (sortedArray.length === 0) { - return sortedArray; - } - var interpreter = this._interpreter; - var exprefNode = resolvedArgs[1]; - var requiredType = this._getTypeName( - interpreter.visit(exprefNode, sortedArray[0])); - if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) { - throw new Error("TypeError"); - } - var that = this; - // In order to get a stable sort out of an unstable - // sort algorithm, we decorate/sort/undecorate (DSU) - // by creating a new list of [index, element] pairs. - // In the cmp function, if the evaluated elements are - // equal, then the index will be used as the tiebreaker. - // After the decorated list has been sorted, it will be - // undecorated to extract the original elements. - var decorated = []; - for (var i = 0; i < sortedArray.length; i++) { - decorated.push([i, sortedArray[i]]); - } - decorated.sort(function(a, b) { - var exprA = interpreter.visit(exprefNode, a[1]); - var exprB = interpreter.visit(exprefNode, b[1]); - if (that._getTypeName(exprA) !== requiredType) { - throw new Error( - "TypeError: expected " + requiredType + ", received " + - that._getTypeName(exprA)); - } else if (that._getTypeName(exprB) !== requiredType) { - throw new Error( - "TypeError: expected " + requiredType + ", received " + - that._getTypeName(exprB)); - } - if (exprA > exprB) { - return 1; - } else if (exprA < exprB) { - return -1; - } else { - // If they're equal compare the items by their - // order to maintain relative order of equal keys - // (i.e. to get a stable sort). - return a[0] - b[0]; - } - }); - // Undecorate: extract out the original list elements. - for (var j = 0; j < decorated.length; j++) { - sortedArray[j] = decorated[j][1]; - } - return sortedArray; - }, +function parseList(xml, shape) { + var data = []; + var name = shape.member.name || 'member'; + if (shape.flattened) { + util.arrayEach(xml, function(xmlChild) { + data.push(parseXml(xmlChild, shape.member)); + }); + } else if (xml && Array.isArray(xml[name])) { + util.arrayEach(xml[name], function(child) { + data.push(parseXml(child, shape.member)); + }); + } - _functionMaxBy: function(resolvedArgs) { - var exprefNode = resolvedArgs[1]; - var resolvedArray = resolvedArgs[0]; - var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); - var maxNumber = -Infinity; - var maxRecord; - var current; - for (var i = 0; i < resolvedArray.length; i++) { - current = keyFunction(resolvedArray[i]); - if (current > maxNumber) { - maxNumber = current; - maxRecord = resolvedArray[i]; - } - } - return maxRecord; - }, + return data; +} - _functionMinBy: function(resolvedArgs) { - var exprefNode = resolvedArgs[1]; - var resolvedArray = resolvedArgs[0]; - var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); - var minNumber = Infinity; - var minRecord; - var current; - for (var i = 0; i < resolvedArray.length; i++) { - current = keyFunction(resolvedArray[i]); - if (current < minNumber) { - minNumber = current; - minRecord = resolvedArray[i]; - } - } - return minRecord; - }, +function parseScalar(text, shape) { + if (text && text.$ && text.$.encoding === 'base64') { + shape = new Shape.create({type: text.$.encoding}); + } + if (text && text._) text = text._; - createKeyFunction: function(exprefNode, allowedTypes) { - var that = this; - var interpreter = this._interpreter; - var keyFunc = function(x) { - var current = interpreter.visit(exprefNode, x); - if (allowedTypes.indexOf(that._getTypeName(current)) < 0) { - var msg = "TypeError: expected one of " + allowedTypes + - ", received " + that._getTypeName(current); - throw new Error(msg); - } - return current; - }; - return keyFunc; - } + if (typeof shape.toType === 'function') { + return shape.toType(text); + } else { + return text; + } +} - }; +function parseUnknown(xml) { + if (xml === undefined || xml === null) return ''; + if (typeof xml === 'string') return xml; - function compile(stream) { - var parser = new Parser(); - var ast = parser.parse(stream); - return ast; + // parse a list + if (Array.isArray(xml)) { + var arr = []; + for (i = 0; i < xml.length; i++) { + arr.push(parseXml(xml[i], {})); + } + return arr; } - function tokenize(stream) { - var lexer = new Lexer(); - return lexer.tokenize(stream); + // empty object + var keys = Object.keys(xml), i; + if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) { + return {}; } - function search(data, expression) { - var parser = new Parser(); - // This needs to be improved. Both the interpreter and runtime depend on - // each other. The runtime needs the interpreter to support exprefs. - // There's likely a clean way to avoid the cyclic dependency. - var runtime = new Runtime(); - var interpreter = new TreeInterpreter(runtime); - runtime._interpreter = interpreter; - var node = parser.parse(expression); - return interpreter.search(node, data); + // object, parse as structure + var data = {}; + for (i = 0; i < keys.length; i++) { + var key = keys[i], value = xml[key]; + if (key === '$') continue; + if (value.length > 1) { // this member is a list + data[key] = parseList(value, {member: {}}); + } else { // this member is a single item + data[key] = parseXml(value[0], {}); + } } + return data; +} - exports.tokenize = tokenize; - exports.compile = compile; - exports.search = search; - exports.strictDeepEqual = strictDeepEqual; -})( false ? 0 : exports); +/** + * @api private + */ +module.exports = NodeXmlParser; /***/ }), -/***/ 90250: -/***/ (function(module, exports, __nccwpck_require__) { +/***/ 20397: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var escapeAttribute = (__nccwpck_require__(98241).escapeAttribute); -/* module decorator */ module = __nccwpck_require__.nmd(module); /** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Represents an XML node. + * @api private */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.17.21'; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; +function XmlNode(name, children) { + if (children === void 0) { children = []; } + this.name = name; + this.children = children; + this.attributes = {}; +} +XmlNode.prototype.addAttribute = function (name, value) { + this.attributes[name] = value; + return this; +}; +XmlNode.prototype.addChildNode = function (child) { + this.children.push(child); + return this; +}; +XmlNode.prototype.removeAttribute = function (name) { + delete this.attributes[name]; + return this; +}; +XmlNode.prototype.toString = function () { + var hasChildren = Boolean(this.children.length); + var xmlText = '<' + this.name; + // add attributes + var attributes = this.attributes; + for (var i = 0, attributeNames = Object.keys(attributes); i < attributeNames.length; i++) { + var attributeName = attributeNames[i]; + var attribute = attributes[attributeName]; + if (typeof attribute !== 'undefined' && attribute !== null) { + xmlText += ' ' + attributeName + '=\"' + escapeAttribute('' + attribute) + '\"'; + } + } + return xmlText += !hasChildren ? '/>' : '>' + this.children.map(function (c) { return c.toString(); }).join('') + ''; +}; - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function', - INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; +/** + * @api private + */ +module.exports = { + XmlNode: XmlNode +}; - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; +/***/ }), - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; +/***/ 90971: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; +var escapeElement = (__nccwpck_require__(98464).escapeElement); - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; +/** + * Represents an XML text value. + * @api private + */ +function XmlText(value) { + this.value = value; +} - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; +XmlText.prototype.toString = function () { + return escapeElement('' + this.value); +}; - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; +/** + * @api private + */ +module.exports = { + XmlText: XmlText +}; - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; +/***/ }), - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; +/***/ 96323: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; +"use strict"; +var __webpack_unused_export__; - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; +__webpack_unused_export__ = ({ value: true }); +var LRU_1 = __nccwpck_require__(77710); +var CACHE_SIZE = 1000; +/** + * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache] + */ +var EndpointCache = /** @class */ (function () { + function EndpointCache(maxSize) { + if (maxSize === void 0) { maxSize = CACHE_SIZE; } + this.maxSize = maxSize; + this.cache = new LRU_1.LRUCache(maxSize); + } + ; + Object.defineProperty(EndpointCache.prototype, "size", { + get: function () { + return this.cache.length; + }, + enumerable: true, + configurable: true + }); + EndpointCache.prototype.put = function (key, value) { + var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; + var endpointRecord = this.populateValue(value); + this.cache.put(keyString, endpointRecord); + }; + EndpointCache.prototype.get = function (key) { + var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; + var now = Date.now(); + var records = this.cache.get(keyString); + if (records) { + for (var i = records.length-1; i >= 0; i--) { + var record = records[i]; + if (record.Expire < now) { + records.splice(i, 1); + } + } + if (records.length === 0) { + this.cache.remove(keyString); + return undefined; + } + } + return records; + }; + EndpointCache.getKeyString = function (key) { + var identifiers = []; + var identifierNames = Object.keys(key).sort(); + for (var i = 0; i < identifierNames.length; i++) { + var identifierName = identifierNames[i]; + if (key[identifierName] === undefined) + continue; + identifiers.push(key[identifierName]); + } + return identifiers.join(' '); + }; + EndpointCache.prototype.populateValue = function (endpoints) { + var now = Date.now(); + return endpoints.map(function (endpoint) { return ({ + Address: endpoint.Address || '', + Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000 + }); }); + }; + EndpointCache.prototype.empty = function () { + this.cache.empty(); + }; + EndpointCache.prototype.remove = function (key) { + var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; + this.cache.remove(keyString); + }; + return EndpointCache; +}()); +exports.$ = EndpointCache; - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; +/***/ }), - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +/***/ 77710: +/***/ ((__unused_webpack_module, exports) => { - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; +"use strict"; - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); +Object.defineProperty(exports, "__esModule", ({ value: true })); +var LinkedListNode = /** @class */ (function () { + function LinkedListNode(key, value) { + this.key = key; + this.value = value; + } + return LinkedListNode; +}()); +var LRUCache = /** @class */ (function () { + function LRUCache(size) { + this.nodeMap = {}; + this.size = 0; + if (typeof size !== 'number' || size < 1) { + throw new Error('Cache size can only be positive number'); + } + this.sizeLimit = size; + } + Object.defineProperty(LRUCache.prototype, "length", { + get: function () { + return this.size; + }, + enumerable: true, + configurable: true + }); + LRUCache.prototype.prependToList = function (node) { + if (!this.headerNode) { + this.tailNode = node; + } + else { + this.headerNode.prev = node; + node.next = this.headerNode; + } + this.headerNode = node; + this.size++; + }; + LRUCache.prototype.removeFromTail = function () { + if (!this.tailNode) { + return undefined; + } + var node = this.tailNode; + var prevNode = node.prev; + if (prevNode) { + prevNode.next = undefined; + } + node.prev = undefined; + this.tailNode = prevNode; + this.size--; + return node; + }; + LRUCache.prototype.detachFromList = function (node) { + if (this.headerNode === node) { + this.headerNode = node.next; + } + if (this.tailNode === node) { + this.tailNode = node.prev; + } + if (node.prev) { + node.prev.next = node.next; + } + if (node.next) { + node.next.prev = node.prev; + } + node.next = undefined; + node.prev = undefined; + this.size--; + }; + LRUCache.prototype.get = function (key) { + if (this.nodeMap[key]) { + var node = this.nodeMap[key]; + this.detachFromList(node); + this.prependToList(node); + return node.value; + } + }; + LRUCache.prototype.remove = function (key) { + if (this.nodeMap[key]) { + var node = this.nodeMap[key]; + this.detachFromList(node); + delete this.nodeMap[key]; + } + }; + LRUCache.prototype.put = function (key, value) { + if (this.nodeMap[key]) { + this.remove(key); + } + else if (this.size === this.sizeLimit) { + var tailNode = this.removeFromTail(); + var key_1 = tailNode.key; + delete this.nodeMap[key_1]; + } + var newNode = new LinkedListNode(key, value); + this.nodeMap[key] = newNode; + this.prependToList(newNode); + }; + LRUCache.prototype.empty = function () { + var keys = Object.keys(this.nodeMap); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var node = this.nodeMap[key]; + this.detachFromList(node); + delete this.nodeMap[key]; + } + }; + return LRUCache; +}()); +exports.LRUCache = LRUCache; - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; +/***/ }), - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; +/***/ 83682: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); +var register = __nccwpck_require__(44670); +var addHook = __nccwpck_require__(5549); +var removeHook = __nccwpck_require__(6819); - /** Used to match leading whitespace. */ - var reTrimStart = /^\s+/; +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind; +var bindable = bind.bind(bind); - /** Used to match a single whitespace character. */ - var reWhitespace = /\s/; +function bindApi(hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply( + null, + name ? [state, name] : [state] + ); + hook.api = { remove: removeHookRef }; + hook.remove = removeHookRef; + ["before", "error", "after", "wrap"].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind]; + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); + }); +} - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; +function HookSingular() { + var singularHookName = "h"; + var singularHookState = { + registry: {}, + }; + var singularHook = register.bind(null, singularHookState, singularHookName); + bindApi(singularHook, singularHookState, singularHookName); + return singularHook; +} - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; +function HookCollection() { + var state = { + registry: {}, + }; - /** - * Used to validate the `validate` option in `_.template` variable. - * - * Forbids characters which could potentially change the meaning of the function argument definition: - * - "()," (modification of function parameters) - * - "=" (default value) - * - "[]{}" (destructuring of function parameters) - * - "/" (beginning of a comment) - * - whitespace - */ - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + var hook = register.bind(null, state); + bindApi(hook, state); - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; + return hook; +} - /** - * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; +var collectionHookDeprecationMessageDisplayed = false; +function Hook() { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn( + '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' + ); + collectionHookDeprecationMessageDisplayed = true; + } + return HookCollection(); +} - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; +Hook.Singular = HookSingular.bind(); +Hook.Collection = HookCollection.bind(); - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; +module.exports = Hook; +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook; +module.exports.Singular = Hook.Singular; +module.exports.Collection = Hook.Collection; - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; +/***/ }), - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; +/***/ 5549: +/***/ ((module) => { - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; +module.exports = addHook; - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; + } - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + if (kind === "after") { + hook = function (method, options) { + var result; + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_; + return orig(result, options); + }) + .then(function () { + return result; + }); + }; + } - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; + } - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; + state.registry[name].push({ + hook: hook, + orig: orig, + }); +} - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); +/***/ }), - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); +/***/ 44670: +/***/ ((module) => { - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); +module.exports = register; - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); + } - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + if (!options) { + options = {}; + } - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); + } - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); + } - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); +} - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; +/***/ }), - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; +/***/ 6819: +/***/ ((module) => { - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; +module.exports = removeHook; - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } + + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); + + if (index === -1) { + return; + } - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; + state.registry[name].splice(index, 1); +} - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +/***/ }), - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +/***/ 58932: +/***/ ((__unused_webpack_module, exports) => { - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); +"use strict"; - /** Detect free variable `exports`. */ - var freeExports = true && exports && !exports.nodeType && exports; - /** Detect free variable `module`. */ - var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; +Object.defineProperty(exports, "__esModule", ({ value: true })); - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; + /* istanbul ignore next */ - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } - if (types) { - return types; - } + this.name = 'Deprecation'; + } - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); +} - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; +exports.Deprecation = Deprecation; - /*--------------------------------------------------------------------------*/ - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } +/***/ }), - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; +/***/ 87783: +/***/ ((__unused_webpack_module, exports) => { - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); +(function(exports) { + "use strict"; + + function isArray(obj) { + if (obj !== null) { + return Object.prototype.toString.call(obj) === "[object Array]"; + } else { + return false; } - return accumulator; } - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } + function isObject(obj) { + if (obj !== null) { + return Object.prototype.toString.call(obj) === "[object Object]"; + } else { + return false; } - return array; } - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; + function strictDeepEqual(first, second) { + // Check the scalar case first. + if (first === second) { + return true; + } - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; + // Check if they are the same type. + var firstType = Object.prototype.toString.call(first); + if (firstType !== Object.prototype.toString.call(second)) { + return false; + } + // We know that first and second have the same type so we can just check the + // first type from now on. + if (isArray(first) === true) { + // Short circuit if they're not the same length; + if (first.length !== second.length) { + return false; + } + for (var i = 0; i < first.length; i++) { + if (strictDeepEqual(first[i], second[i]) === false) { + return false; + } } + return true; } - return array; + if (isObject(first) === true) { + // An object is equal if it has the same key/value pairs. + var keysSeen = {}; + for (var key in first) { + if (hasOwnProperty.call(first, key)) { + if (strictDeepEqual(first[key], second[key]) === false) { + return false; + } + keysSeen[key] = true; + } + } + // Now check that there aren't any keys in second that weren't + // in first. + for (var key2 in second) { + if (hasOwnProperty.call(second, key2)) { + if (keysSeen[key2] !== true) { + return false; + } + } + } + return true; + } + return false; } - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; + function isFalse(obj) { + // From the spec: + // A false value corresponds to the following values: + // Empty list + // Empty object + // Empty string + // False boolean + // null value - while (++index < length) { - if (!predicate(array[index], index, array)) { + // First check the scalar values. + if (obj === "" || obj === false || obj === null) { + return true; + } else if (isArray(obj) && obj.length === 0) { + // Check for an empty array. + return true; + } else if (isObject(obj)) { + // Check for an empty object. + for (var key in obj) { + // If there are any keys, then + // the object is not empty so the object + // is not false. + if (obj.hasOwnProperty(key)) { + return false; + } + } + return true; + } else { return false; - } } - return true; } - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + function objValues(obj) { + var keys = Object.keys(obj); + var values = []; + for (var i = 0; i < keys.length; i++) { + values.push(obj[keys[i]]); + } + return values; + } - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; + function merge(a, b) { + var merged = {}; + for (var key in a) { + merged[key] = a[key]; } - } - return result; + for (var key2 in b) { + merged[key2] = b[key2]; + } + return merged; + } + + var trimLeft; + if (typeof String.prototype.trimLeft === "function") { + trimLeft = function(str) { + return str.trimLeft(); + }; + } else { + trimLeft = function(str) { + return str.match(/^\s*(.*)/)[1]; + }; + } + + // Type constants used to define functions. + var TYPE_NUMBER = 0; + var TYPE_ANY = 1; + var TYPE_STRING = 2; + var TYPE_ARRAY = 3; + var TYPE_OBJECT = 4; + var TYPE_BOOLEAN = 5; + var TYPE_EXPREF = 6; + var TYPE_NULL = 7; + var TYPE_ARRAY_NUMBER = 8; + var TYPE_ARRAY_STRING = 9; + var TYPE_NAME_TABLE = { + 0: 'number', + 1: 'any', + 2: 'string', + 3: 'array', + 4: 'object', + 5: 'boolean', + 6: 'expression', + 7: 'null', + 8: 'Array', + 9: 'Array' + }; + + var TOK_EOF = "EOF"; + var TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier"; + var TOK_QUOTEDIDENTIFIER = "QuotedIdentifier"; + var TOK_RBRACKET = "Rbracket"; + var TOK_RPAREN = "Rparen"; + var TOK_COMMA = "Comma"; + var TOK_COLON = "Colon"; + var TOK_RBRACE = "Rbrace"; + var TOK_NUMBER = "Number"; + var TOK_CURRENT = "Current"; + var TOK_EXPREF = "Expref"; + var TOK_PIPE = "Pipe"; + var TOK_OR = "Or"; + var TOK_AND = "And"; + var TOK_EQ = "EQ"; + var TOK_GT = "GT"; + var TOK_LT = "LT"; + var TOK_GTE = "GTE"; + var TOK_LTE = "LTE"; + var TOK_NE = "NE"; + var TOK_FLATTEN = "Flatten"; + var TOK_STAR = "Star"; + var TOK_FILTER = "Filter"; + var TOK_DOT = "Dot"; + var TOK_NOT = "Not"; + var TOK_LBRACE = "Lbrace"; + var TOK_LBRACKET = "Lbracket"; + var TOK_LPAREN= "Lparen"; + var TOK_LITERAL= "Literal"; + + // The "&", "[", "<", ">" tokens + // are not in basicToken because + // there are two token variants + // ("&&", "[?", "<=", ">="). This is specially handled + // below. + + var basicTokens = { + ".": TOK_DOT, + "*": TOK_STAR, + ",": TOK_COMMA, + ":": TOK_COLON, + "{": TOK_LBRACE, + "}": TOK_RBRACE, + "]": TOK_RBRACKET, + "(": TOK_LPAREN, + ")": TOK_RPAREN, + "@": TOK_CURRENT + }; + + var operatorStartToken = { + "<": true, + ">": true, + "=": true, + "!": true + }; + + var skipChars = { + " ": true, + "\t": true, + "\n": true + }; + + + function isAlpha(ch) { + return (ch >= "a" && ch <= "z") || + (ch >= "A" && ch <= "Z") || + ch === "_"; + } + + function isNum(ch) { + return (ch >= "0" && ch <= "9") || + ch === "-"; + } + function isAlphaNum(ch) { + return (ch >= "a" && ch <= "z") || + (ch >= "A" && ch <= "Z") || + (ch >= "0" && ch <= "9") || + ch === "_"; } - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } + function Lexer() { + } + Lexer.prototype = { + tokenize: function(stream) { + var tokens = []; + this._current = 0; + var start; + var identifier; + var token; + while (this._current < stream.length) { + if (isAlpha(stream[this._current])) { + start = this._current; + identifier = this._consumeUnquotedIdentifier(stream); + tokens.push({type: TOK_UNQUOTEDIDENTIFIER, + value: identifier, + start: start}); + } else if (basicTokens[stream[this._current]] !== undefined) { + tokens.push({type: basicTokens[stream[this._current]], + value: stream[this._current], + start: this._current}); + this._current++; + } else if (isNum(stream[this._current])) { + token = this._consumeNumber(stream); + tokens.push(token); + } else if (stream[this._current] === "[") { + // No need to increment this._current. This happens + // in _consumeLBracket + token = this._consumeLBracket(stream); + tokens.push(token); + } else if (stream[this._current] === "\"") { + start = this._current; + identifier = this._consumeQuotedIdentifier(stream); + tokens.push({type: TOK_QUOTEDIDENTIFIER, + value: identifier, + start: start}); + } else if (stream[this._current] === "'") { + start = this._current; + identifier = this._consumeRawStringLiteral(stream); + tokens.push({type: TOK_LITERAL, + value: identifier, + start: start}); + } else if (stream[this._current] === "`") { + start = this._current; + var literal = this._consumeLiteral(stream); + tokens.push({type: TOK_LITERAL, + value: literal, + start: start}); + } else if (operatorStartToken[stream[this._current]] !== undefined) { + tokens.push(this._consumeOperator(stream)); + } else if (skipChars[stream[this._current]] !== undefined) { + // Ignore whitespace. + this._current++; + } else if (stream[this._current] === "&") { + start = this._current; + this._current++; + if (stream[this._current] === "&") { + this._current++; + tokens.push({type: TOK_AND, value: "&&", start: start}); + } else { + tokens.push({type: TOK_EXPREF, value: "&", start: start}); + } + } else if (stream[this._current] === "|") { + start = this._current; + this._current++; + if (stream[this._current] === "|") { + this._current++; + tokens.push({type: TOK_OR, value: "||", start: start}); + } else { + tokens.push({type: TOK_PIPE, value: "|", start: start}); + } + } else { + var error = new Error("Unknown character:" + stream[this._current]); + error.name = "LexerError"; + throw error; + } + } + return tokens; + }, + + _consumeUnquotedIdentifier: function(stream) { + var start = this._current; + this._current++; + while (this._current < stream.length && isAlphaNum(stream[this._current])) { + this._current++; + } + return stream.slice(start, this._current); + }, + + _consumeQuotedIdentifier: function(stream) { + var start = this._current; + this._current++; + var maxLength = stream.length; + while (stream[this._current] !== "\"" && this._current < maxLength) { + // You can escape a double quote and you can escape an escape. + var current = this._current; + if (stream[current] === "\\" && (stream[current + 1] === "\\" || + stream[current + 1] === "\"")) { + current += 2; + } else { + current++; + } + this._current = current; + } + this._current++; + return JSON.parse(stream.slice(start, this._current)); + }, + + _consumeRawStringLiteral: function(stream) { + var start = this._current; + this._current++; + var maxLength = stream.length; + while (stream[this._current] !== "'" && this._current < maxLength) { + // You can escape a single quote and you can escape an escape. + var current = this._current; + if (stream[current] === "\\" && (stream[current + 1] === "\\" || + stream[current + 1] === "'")) { + current += 2; + } else { + current++; + } + this._current = current; + } + this._current++; + var literal = stream.slice(start + 1, this._current - 1); + return literal.replace("\\'", "'"); + }, + + _consumeNumber: function(stream) { + var start = this._current; + this._current++; + var maxLength = stream.length; + while (isNum(stream[this._current]) && this._current < maxLength) { + this._current++; + } + var value = parseInt(stream.slice(start, this._current)); + return {type: TOK_NUMBER, value: value, start: start}; + }, - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; + _consumeLBracket: function(stream) { + var start = this._current; + this._current++; + if (stream[this._current] === "?") { + this._current++; + return {type: TOK_FILTER, value: "[?", start: start}; + } else if (stream[this._current] === "]") { + this._current++; + return {type: TOK_FLATTEN, value: "[]", start: start}; + } else { + return {type: TOK_LBRACKET, value: "[", start: start}; + } + }, - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } + _consumeOperator: function(stream) { + var start = this._current; + var startingChar = stream[start]; + this._current++; + if (startingChar === "!") { + if (stream[this._current] === "=") { + this._current++; + return {type: TOK_NE, value: "!=", start: start}; + } else { + return {type: TOK_NOT, value: "!", start: start}; + } + } else if (startingChar === "<") { + if (stream[this._current] === "=") { + this._current++; + return {type: TOK_LTE, value: "<=", start: start}; + } else { + return {type: TOK_LT, value: "<", start: start}; + } + } else if (startingChar === ">") { + if (stream[this._current] === "=") { + this._current++; + return {type: TOK_GTE, value: ">=", start: start}; + } else { + return {type: TOK_GT, value: ">", start: start}; + } + } else if (startingChar === "=") { + if (stream[this._current] === "=") { + this._current++; + return {type: TOK_EQ, value: "==", start: start}; + } + } + }, - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); + _consumeLiteral: function(stream) { + this._current++; + var start = this._current; + var maxLength = stream.length; + var literal; + while(stream[this._current] !== "`" && this._current < maxLength) { + // You can escape a literal char or you can escape the escape. + var current = this._current; + if (stream[current] === "\\" && (stream[current + 1] === "\\" || + stream[current + 1] === "`")) { + current += 2; + } else { + current++; + } + this._current = current; + } + var literalString = trimLeft(stream.slice(start, this._current)); + literalString = literalString.replace("\\`", "`"); + if (this._looksLikeJSON(literalString)) { + literal = JSON.parse(literalString); + } else { + // Try to JSON parse it as "" + literal = JSON.parse("\"" + literalString + "\""); + } + // +1 gets us to the ending "`", +1 to move on to the next char. + this._current++; + return literal; + }, - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } + _looksLikeJSON: function(literalString) { + var startingChars = "[{\""; + var jsonLiterals = ["true", "false", "null"]; + var numberLooking = "-0123456789"; - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; + if (literalString === "") { + return false; + } else if (startingChars.indexOf(literalString[0]) >= 0) { + return true; + } else if (jsonLiterals.indexOf(literalString) >= 0) { + return true; + } else if (numberLooking.indexOf(literalString[0]) >= 0) { + try { + JSON.parse(literalString); + return true; + } catch (ex) { + return false; + } + } else { + return false; + } + } + }; - while (++index < length) { - array[offset + index] = values[index]; - } - return array; + var bindingPower = {}; + bindingPower[TOK_EOF] = 0; + bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0; + bindingPower[TOK_QUOTEDIDENTIFIER] = 0; + bindingPower[TOK_RBRACKET] = 0; + bindingPower[TOK_RPAREN] = 0; + bindingPower[TOK_COMMA] = 0; + bindingPower[TOK_RBRACE] = 0; + bindingPower[TOK_NUMBER] = 0; + bindingPower[TOK_CURRENT] = 0; + bindingPower[TOK_EXPREF] = 0; + bindingPower[TOK_PIPE] = 1; + bindingPower[TOK_OR] = 2; + bindingPower[TOK_AND] = 3; + bindingPower[TOK_EQ] = 5; + bindingPower[TOK_GT] = 5; + bindingPower[TOK_LT] = 5; + bindingPower[TOK_GTE] = 5; + bindingPower[TOK_LTE] = 5; + bindingPower[TOK_NE] = 5; + bindingPower[TOK_FLATTEN] = 9; + bindingPower[TOK_STAR] = 20; + bindingPower[TOK_FILTER] = 21; + bindingPower[TOK_DOT] = 40; + bindingPower[TOK_NOT] = 45; + bindingPower[TOK_LBRACE] = 50; + bindingPower[TOK_LBRACKET] = 55; + bindingPower[TOK_LPAREN] = 60; + + function Parser() { } - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; + Parser.prototype = { + parse: function(expression) { + this._loadTokens(expression); + this.index = 0; + var ast = this.expression(0); + if (this._lookahead(0) !== TOK_EOF) { + var t = this._lookaheadToken(0); + var error = new Error( + "Unexpected token type: " + t.type + ", value: " + t.value); + error.name = "ParserError"; + throw error; + } + return ast; + }, - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } + _loadTokens: function(expression) { + var lexer = new Lexer(); + var tokens = lexer.tokenize(expression); + tokens.push({type: TOK_EOF, value: "", start: expression.length}); + this.tokens = tokens; + }, - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } + expression: function(rbp) { + var leftToken = this._lookaheadToken(0); + this._advance(); + var left = this.nud(leftToken); + var currentToken = this._lookahead(0); + while (rbp < bindingPower[currentToken]) { + this._advance(); + left = this.led(currentToken, left); + currentToken = this._lookahead(0); + } + return left; + }, - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; + _lookahead: function(number) { + return this.tokens[this.index + number].type; + }, - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } + _lookaheadToken: function(number) { + return this.tokens[this.index + number]; + }, - /** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - var asciiSize = baseProperty('length'); + _advance: function() { + this.index++; + }, - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } + nud: function(token) { + var left; + var right; + var expression; + switch (token.type) { + case TOK_LITERAL: + return {type: "Literal", value: token.value}; + case TOK_UNQUOTEDIDENTIFIER: + return {type: "Field", name: token.value}; + case TOK_QUOTEDIDENTIFIER: + var node = {type: "Field", name: token.value}; + if (this._lookahead(0) === TOK_LPAREN) { + throw new Error("Quoted identifier not allowed for function names."); + } + return node; + case TOK_NOT: + right = this.expression(bindingPower.Not); + return {type: "NotExpression", children: [right]}; + case TOK_STAR: + left = {type: "Identity"}; + right = null; + if (this._lookahead(0) === TOK_RBRACKET) { + // This can happen in a multiselect, + // [a, b, *] + right = {type: "Identity"}; + } else { + right = this._parseProjectionRHS(bindingPower.Star); + } + return {type: "ValueProjection", children: [left, right]}; + case TOK_FILTER: + return this.led(token.type, {type: "Identity"}); + case TOK_LBRACE: + return this._parseMultiselectHash(); + case TOK_FLATTEN: + left = {type: TOK_FLATTEN, children: [{type: "Identity"}]}; + right = this._parseProjectionRHS(bindingPower.Flatten); + return {type: "Projection", children: [left, right]}; + case TOK_LBRACKET: + if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) { + right = this._parseIndexExpression(); + return this._projectIfSlice({type: "Identity"}, right); + } else if (this._lookahead(0) === TOK_STAR && + this._lookahead(1) === TOK_RBRACKET) { + this._advance(); + this._advance(); + right = this._parseProjectionRHS(bindingPower.Star); + return {type: "Projection", + children: [{type: "Identity"}, right]}; + } + return this._parseMultiselectList(); + case TOK_CURRENT: + return {type: TOK_CURRENT}; + case TOK_EXPREF: + expression = this.expression(bindingPower.Expref); + return {type: "ExpressionReference", children: [expression]}; + case TOK_LPAREN: + var args = []; + while (this._lookahead(0) !== TOK_RPAREN) { + if (this._lookahead(0) === TOK_CURRENT) { + expression = {type: TOK_CURRENT}; + this._advance(); + } else { + expression = this.expression(0); + } + args.push(expression); + } + this._match(TOK_RPAREN); + return args[0]; + default: + this._errorToken(token); + } + }, - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } + led: function(tokenName, left) { + var right; + switch(tokenName) { + case TOK_DOT: + var rbp = bindingPower.Dot; + if (this._lookahead(0) !== TOK_STAR) { + right = this._parseDotRHS(rbp); + return {type: "Subexpression", children: [left, right]}; + } + // Creating a projection. + this._advance(); + right = this._parseProjectionRHS(rbp); + return {type: "ValueProjection", children: [left, right]}; + case TOK_PIPE: + right = this.expression(bindingPower.Pipe); + return {type: TOK_PIPE, children: [left, right]}; + case TOK_OR: + right = this.expression(bindingPower.Or); + return {type: "OrExpression", children: [left, right]}; + case TOK_AND: + right = this.expression(bindingPower.And); + return {type: "AndExpression", children: [left, right]}; + case TOK_LPAREN: + var name = left.name; + var args = []; + var expression, node; + while (this._lookahead(0) !== TOK_RPAREN) { + if (this._lookahead(0) === TOK_CURRENT) { + expression = {type: TOK_CURRENT}; + this._advance(); + } else { + expression = this.expression(0); + } + if (this._lookahead(0) === TOK_COMMA) { + this._match(TOK_COMMA); + } + args.push(expression); + } + this._match(TOK_RPAREN); + node = {type: "Function", name: name, children: args}; + return node; + case TOK_FILTER: + var condition = this.expression(0); + this._match(TOK_RBRACKET); + if (this._lookahead(0) === TOK_FLATTEN) { + right = {type: "Identity"}; + } else { + right = this._parseProjectionRHS(bindingPower.Filter); + } + return {type: "FilterProjection", children: [left, right, condition]}; + case TOK_FLATTEN: + var leftNode = {type: TOK_FLATTEN, children: [left]}; + var rightNode = this._parseProjectionRHS(bindingPower.Flatten); + return {type: "Projection", children: [leftNode, rightNode]}; + case TOK_EQ: + case TOK_NE: + case TOK_GT: + case TOK_GTE: + case TOK_LT: + case TOK_LTE: + return this._parseComparator(left, tokenName); + case TOK_LBRACKET: + var token = this._lookaheadToken(0); + if (token.type === TOK_NUMBER || token.type === TOK_COLON) { + right = this._parseIndexExpression(); + return this._projectIfSlice(left, right); + } + this._match(TOK_STAR); + this._match(TOK_RBRACKET); + right = this._parseProjectionRHS(bindingPower.Star); + return {type: "Projection", children: [left, right]}; + default: + this._errorToken(this._lookaheadToken(0)); + } + }, - /** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; - } + _match: function(tokenType) { + if (this._lookahead(0) === tokenType) { + this._advance(); + } else { + var t = this._lookaheadToken(0); + var error = new Error("Expected " + tokenType + ", got: " + t.type); + error.name = "ParserError"; + throw error; + } + }, - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); + _errorToken: function(token) { + var error = new Error("Invalid token (" + + token.type + "): \"" + + token.value + "\""); + error.name = "ParserError"; + throw error; + }, - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } + _parseIndexExpression: function() { + if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) { + return this._parseSliceExpression(); + } else { + var node = { + type: "Index", + value: this._lookaheadToken(0).value}; + this._advance(); + this._match(TOK_RBRACKET); + return node; + } + }, - /** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; + _projectIfSlice: function(left, right) { + var indexExpr = {type: "IndexExpression", children: [left, right]}; + if (right.type === "Slice") { + return { + type: "Projection", + children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)] + }; + } else { + return indexExpr; + } + }, - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; - } + _parseSliceExpression: function() { + // [start:end:step] where each part is optional, as well as the last + // colon. + var parts = [null, null, null]; + var index = 0; + var currentToken = this._lookahead(0); + while (currentToken !== TOK_RBRACKET && index < 3) { + if (currentToken === TOK_COLON) { + index++; + this._advance(); + } else if (currentToken === TOK_NUMBER) { + parts[index] = this._lookaheadToken(0).value; + this._advance(); + } else { + var t = this._lookahead(0); + var error = new Error("Syntax error, unexpected token: " + + t.value + "(" + t.type + ")"); + error.name = "Parsererror"; + throw error; + } + currentToken = this._lookahead(0); + } + this._match(TOK_RBRACKET); + return { + type: "Slice", + children: parts + }; + }, - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } + _parseComparator: function(left, comparator) { + var right = this.expression(bindingPower[comparator]); + return {type: "Comparator", name: comparator, children: [left, right]}; + }, - /** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; - } + _parseDotRHS: function(rbp) { + var lookahead = this._lookahead(0); + var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR]; + if (exprTokens.indexOf(lookahead) >= 0) { + return this.expression(rbp); + } else if (lookahead === TOK_LBRACKET) { + this._match(TOK_LBRACKET); + return this._parseMultiselectList(); + } else if (lookahead === TOK_LBRACE) { + this._match(TOK_LBRACE); + return this._parseMultiselectHash(); + } + }, - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } + _parseProjectionRHS: function(rbp) { + var right; + if (bindingPower[this._lookahead(0)] < 10) { + right = {type: "Identity"}; + } else if (this._lookahead(0) === TOK_LBRACKET) { + right = this.expression(rbp); + } else if (this._lookahead(0) === TOK_FILTER) { + right = this.expression(rbp); + } else if (this._lookahead(0) === TOK_DOT) { + this._match(TOK_DOT); + right = this._parseDotRHS(rbp); + } else { + var t = this._lookaheadToken(0); + var error = new Error("Sytanx error, unexpected token: " + + t.value + "(" + t.type + ")"); + error.name = "ParserError"; + throw error; + } + return right; + }, - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } + _parseMultiselectList: function() { + var expressions = []; + while (this._lookahead(0) !== TOK_RBRACKET) { + var expression = this.expression(0); + expressions.push(expression); + if (this._lookahead(0) === TOK_COMMA) { + this._match(TOK_COMMA); + if (this._lookahead(0) === TOK_RBRACKET) { + throw new Error("Unexpected token Rbracket"); + } + } + } + this._match(TOK_RBRACKET); + return {type: "MultiSelectList", children: expressions}; + }, - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } + _parseMultiselectHash: function() { + var pairs = []; + var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER]; + var keyToken, keyName, value, node; + for (;;) { + keyToken = this._lookaheadToken(0); + if (identifierTypes.indexOf(keyToken.type) < 0) { + throw new Error("Expecting an identifier token, got: " + + keyToken.type); + } + keyName = keyToken.value; + this._advance(); + this._match(TOK_COLON); + value = this.expression(0); + node = {type: "KeyValuePair", name: keyName, value: value}; + pairs.push(node); + if (this._lookahead(0) === TOK_COMMA) { + this._match(TOK_COMMA); + } else if (this._lookahead(0) === TOK_RBRACE) { + this._match(TOK_RBRACE); + break; + } + } + return {type: "MultiSelectHash", children: pairs}; + } + }; - /** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; + function TreeInterpreter(runtime) { + this.runtime = runtime; } - /** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; + TreeInterpreter.prototype = { + search: function(node, value) { + return this.visit(node, value); + }, - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; - } + visit: function(node, value) { + var matched, current, result, first, second, field, left, right, collected, i; + switch (node.type) { + case "Field": + if (value !== null && isObject(value)) { + field = value[node.name]; + if (field === undefined) { + return null; + } else { + return field; + } + } + return null; + case "Subexpression": + result = this.visit(node.children[0], value); + for (i = 1; i < node.children.length; i++) { + result = this.visit(node.children[1], result); + if (result === null) { + return null; + } + } + return result; + case "IndexExpression": + left = this.visit(node.children[0], value); + right = this.visit(node.children[1], left); + return right; + case "Index": + if (!isArray(value)) { + return null; + } + var index = node.value; + if (index < 0) { + index = value.length + index; + } + result = value[index]; + if (result === undefined) { + result = null; + } + return result; + case "Slice": + if (!isArray(value)) { + return null; + } + var sliceParams = node.children.slice(0); + var computed = this.computeSliceParams(value.length, sliceParams); + var start = computed[0]; + var stop = computed[1]; + var step = computed[2]; + result = []; + if (step > 0) { + for (i = start; i < stop; i += step) { + result.push(value[i]); + } + } else { + for (i = start; i > stop; i += step) { + result.push(value[i]); + } + } + return result; + case "Projection": + // Evaluate left child. + var base = this.visit(node.children[0], value); + if (!isArray(base)) { + return null; + } + collected = []; + for (i = 0; i < base.length; i++) { + current = this.visit(node.children[1], base[i]); + if (current !== null) { + collected.push(current); + } + } + return collected; + case "ValueProjection": + // Evaluate left child. + base = this.visit(node.children[0], value); + if (!isObject(base)) { + return null; + } + collected = []; + var values = objValues(base); + for (i = 0; i < values.length; i++) { + current = this.visit(node.children[1], values[i]); + if (current !== null) { + collected.push(current); + } + } + return collected; + case "FilterProjection": + base = this.visit(node.children[0], value); + if (!isArray(base)) { + return null; + } + var filtered = []; + var finalResults = []; + for (i = 0; i < base.length; i++) { + matched = this.visit(node.children[2], base[i]); + if (!isFalse(matched)) { + filtered.push(base[i]); + } + } + for (var j = 0; j < filtered.length; j++) { + current = this.visit(node.children[1], filtered[j]); + if (current !== null) { + finalResults.push(current); + } + } + return finalResults; + case "Comparator": + first = this.visit(node.children[0], value); + second = this.visit(node.children[1], value); + switch(node.name) { + case TOK_EQ: + result = strictDeepEqual(first, second); + break; + case TOK_NE: + result = !strictDeepEqual(first, second); + break; + case TOK_GT: + result = first > second; + break; + case TOK_GTE: + result = first >= second; + break; + case TOK_LT: + result = first < second; + break; + case TOK_LTE: + result = first <= second; + break; + default: + throw new Error("Unknown comparator: " + node.name); + } + return result; + case TOK_FLATTEN: + var original = this.visit(node.children[0], value); + if (!isArray(original)) { + return null; + } + var merged = []; + for (i = 0; i < original.length; i++) { + current = original[i]; + if (isArray(current)) { + merged.push.apply(merged, current); + } else { + merged.push(current); + } + } + return merged; + case "Identity": + return value; + case "MultiSelectList": + if (value === null) { + return null; + } + collected = []; + for (i = 0; i < node.children.length; i++) { + collected.push(this.visit(node.children[i], value)); + } + return collected; + case "MultiSelectHash": + if (value === null) { + return null; + } + collected = {}; + var child; + for (i = 0; i < node.children.length; i++) { + child = node.children[i]; + collected[child.name] = this.visit(child.value, value); + } + return collected; + case "OrExpression": + matched = this.visit(node.children[0], value); + if (isFalse(matched)) { + matched = this.visit(node.children[1], value); + } + return matched; + case "AndExpression": + first = this.visit(node.children[0], value); + + if (isFalse(first) === true) { + return first; + } + return this.visit(node.children[1], value); + case "NotExpression": + first = this.visit(node.children[0], value); + return isFalse(first); + case "Literal": + return node.value; + case TOK_PIPE: + left = this.visit(node.children[0], value); + return this.visit(node.children[1], left); + case TOK_CURRENT: + return value; + case "Function": + var resolvedArgs = []; + for (i = 0; i < node.children.length; i++) { + resolvedArgs.push(this.visit(node.children[i], value)); + } + return this.runtime.callFunction(node.name, resolvedArgs); + case "ExpressionReference": + var refNode = node.children[0]; + // Tag the node with a specific attribute so the type + // checker verify the type. + refNode.jmespathType = TOK_EXPREF; + return refNode; + default: + throw new Error("Unknown node type: " + node.type); + } + }, - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); + computeSliceParams: function(arrayLength, sliceParams) { + var start = sliceParams[0]; + var stop = sliceParams[1]; + var step = sliceParams[2]; + var computed = [null, null, null]; + if (step === null) { + step = 1; + } else if (step === 0) { + var error = new Error("Invalid slice, step cannot be 0"); + error.name = "RuntimeError"; + throw error; + } + var stepValueNegative = step < 0 ? true : false; - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } + if (start === null) { + start = stepValueNegative ? arrayLength - 1 : 0; + } else { + start = this.capSliceRange(arrayLength, start, step); + } - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } + if (stop === null) { + stop = stepValueNegative ? -1 : arrayLength; + } else { + stop = this.capSliceRange(arrayLength, stop, step); + } + computed[0] = start; + computed[1] = stop; + computed[2] = step; + return computed; + }, - /** - * The base implementation of `_.trim`. - * - * @private - * @param {string} string The string to trim. - * @returns {string} Returns the trimmed string. - */ - function baseTrim(string) { - return string - ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') - : string; - } + capSliceRange: function(arrayLength, actualValue, step) { + if (actualValue < 0) { + actualValue += arrayLength; + if (actualValue < 0) { + actualValue = step < 0 ? -1 : 0; + } + } else if (actualValue >= arrayLength) { + actualValue = step < 0 ? arrayLength - 1 : arrayLength; + } + return actualValue; + } - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); + }; + + function Runtime(interpreter) { + this._interpreter = interpreter; + this.functionTable = { + // name: [function, ] + // The can be: + // + // { + // args: [[type1, type2], [type1, type2]], + // variadic: true|false + // } + // + // Each arg in the arg list is a list of valid types + // (if the function is overloaded and supports multiple + // types. If the type is "any" then no type checking + // occurs on the argument. Variadic is optional + // and if not provided is assumed to be false. + abs: {_func: this._functionAbs, _signature: [{types: [TYPE_NUMBER]}]}, + avg: {_func: this._functionAvg, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, + ceil: {_func: this._functionCeil, _signature: [{types: [TYPE_NUMBER]}]}, + contains: { + _func: this._functionContains, + _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}, + {types: [TYPE_ANY]}]}, + "ends_with": { + _func: this._functionEndsWith, + _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, + floor: {_func: this._functionFloor, _signature: [{types: [TYPE_NUMBER]}]}, + length: { + _func: this._functionLength, + _signature: [{types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]}]}, + map: { + _func: this._functionMap, + _signature: [{types: [TYPE_EXPREF]}, {types: [TYPE_ARRAY]}]}, + max: { + _func: this._functionMax, + _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, + "merge": { + _func: this._functionMerge, + _signature: [{types: [TYPE_OBJECT], variadic: true}] + }, + "max_by": { + _func: this._functionMaxBy, + _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] + }, + sum: {_func: this._functionSum, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, + "starts_with": { + _func: this._functionStartsWith, + _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, + min: { + _func: this._functionMin, + _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, + "min_by": { + _func: this._functionMinBy, + _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] + }, + type: {_func: this._functionType, _signature: [{types: [TYPE_ANY]}]}, + keys: {_func: this._functionKeys, _signature: [{types: [TYPE_OBJECT]}]}, + values: {_func: this._functionValues, _signature: [{types: [TYPE_OBJECT]}]}, + sort: {_func: this._functionSort, _signature: [{types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]}]}, + "sort_by": { + _func: this._functionSortBy, + _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] + }, + join: { + _func: this._functionJoin, + _signature: [ + {types: [TYPE_STRING]}, + {types: [TYPE_ARRAY_STRING]} + ] + }, + reverse: { + _func: this._functionReverse, + _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}]}, + "to_array": {_func: this._functionToArray, _signature: [{types: [TYPE_ANY]}]}, + "to_string": {_func: this._functionToString, _signature: [{types: [TYPE_ANY]}]}, + "to_number": {_func: this._functionToNumber, _signature: [{types: [TYPE_ANY]}]}, + "not_null": { + _func: this._functionNotNull, + _signature: [{types: [TYPE_ANY], variadic: true}] + } }; } - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } + Runtime.prototype = { + callFunction: function(name, resolvedArgs) { + var functionEntry = this.functionTable[name]; + if (functionEntry === undefined) { + throw new Error("Unknown function: " + name + "()"); + } + this._validateArgs(name, resolvedArgs, functionEntry._signature); + return functionEntry._func.call(this, resolvedArgs); + }, - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } + _validateArgs: function(name, args, signature) { + // Validating the args requires validating + // the correct arity and the correct type of each arg. + // If the last argument is declared as variadic, then we need + // a minimum number of args to be required. Otherwise it has to + // be an exact amount. + var pluralized; + if (signature[signature.length - 1].variadic) { + if (args.length < signature.length) { + pluralized = signature.length === 1 ? " argument" : " arguments"; + throw new Error("ArgumentError: " + name + "() " + + "takes at least" + signature.length + pluralized + + " but received " + args.length); + } + } else if (args.length !== signature.length) { + pluralized = signature.length === 1 ? " argument" : " arguments"; + throw new Error("ArgumentError: " + name + "() " + + "takes " + signature.length + pluralized + + " but received " + args.length); + } + var currentSpec; + var actualType; + var typeMatched; + for (var i = 0; i < signature.length; i++) { + typeMatched = false; + currentSpec = signature[i].types; + actualType = this._getTypeName(args[i]); + for (var j = 0; j < currentSpec.length; j++) { + if (this._typeMatches(actualType, currentSpec[j], args[i])) { + typeMatched = true; + break; + } + } + if (!typeMatched) { + var expected = currentSpec + .map(function(typeIdentifier) { + return TYPE_NAME_TABLE[typeIdentifier]; + }) + .join(','); + throw new Error("TypeError: " + name + "() " + + "expected argument " + (i + 1) + + " to be type " + expected + + " but received type " + + TYPE_NAME_TABLE[actualType] + " instead."); + } + } + }, - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; + _typeMatches: function(actual, expected, argValue) { + if (expected === TYPE_ANY) { + return true; + } + if (expected === TYPE_ARRAY_STRING || + expected === TYPE_ARRAY_NUMBER || + expected === TYPE_ARRAY) { + // The expected type can either just be array, + // or it can require a specific subtype (array of numbers). + // + // The simplest case is if "array" with no subtype is specified. + if (expected === TYPE_ARRAY) { + return actual === TYPE_ARRAY; + } else if (actual === TYPE_ARRAY) { + // Otherwise we need to check subtypes. + // I think this has potential to be improved. + var subtype; + if (expected === TYPE_ARRAY_NUMBER) { + subtype = TYPE_NUMBER; + } else if (expected === TYPE_ARRAY_STRING) { + subtype = TYPE_STRING; + } + for (var i = 0; i < argValue.length; i++) { + if (!this._typeMatches( + this._getTypeName(argValue[i]), subtype, + argValue[i])) { + return false; + } + } + return true; + } + } else { + return actual === expected; + } + }, + _getTypeName: function(obj) { + switch (Object.prototype.toString.call(obj)) { + case "[object String]": + return TYPE_STRING; + case "[object Number]": + return TYPE_NUMBER; + case "[object Array]": + return TYPE_ARRAY; + case "[object Boolean]": + return TYPE_BOOLEAN; + case "[object Null]": + return TYPE_NULL; + case "[object Object]": + // Check if it's an expref. If it has, it's been + // tagged with a jmespathType attr of 'Expref'; + if (obj.jmespathType === TOK_EXPREF) { + return TYPE_EXPREF; + } else { + return TYPE_OBJECT; + } + } + }, - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } + _functionStartsWith: function(resolvedArgs) { + return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0; + }, - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; + _functionEndsWith: function(resolvedArgs) { + var searchStr = resolvedArgs[0]; + var suffix = resolvedArgs[1]; + return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1; + }, - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } + _functionReverse: function(resolvedArgs) { + var typeName = this._getTypeName(resolvedArgs[0]); + if (typeName === TYPE_STRING) { + var originalStr = resolvedArgs[0]; + var reversedStr = ""; + for (var i = originalStr.length - 1; i >= 0; i--) { + reversedStr += originalStr[i]; + } + return reversedStr; + } else { + var reversedArray = resolvedArgs[0].slice(0); + reversedArray.reverse(); + return reversedArray; + } + }, - /** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; + _functionAbs: function(resolvedArgs) { + return Math.abs(resolvedArgs[0]); + }, - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } + _functionCeil: function(resolvedArgs) { + return Math.ceil(resolvedArgs[0]); + }, - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); + _functionAvg: function(resolvedArgs) { + var sum = 0; + var inputArray = resolvedArgs[0]; + for (var i = 0; i < inputArray.length; i++) { + sum += inputArray[i]; + } + return sum / inputArray.length; + }, - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); + _functionContains: function(resolvedArgs) { + return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0; + }, - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } + _functionFloor: function(resolvedArgs) { + return Math.floor(resolvedArgs[0]); + }, - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } + _functionLength: function(resolvedArgs) { + if (!isObject(resolvedArgs[0])) { + return resolvedArgs[0].length; + } else { + // As far as I can tell, there's no way to get the length + // of an object without O(n) iteration through the object. + return Object.keys(resolvedArgs[0]).length; + } + }, - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } + _functionMap: function(resolvedArgs) { + var mapped = []; + var interpreter = this._interpreter; + var exprefNode = resolvedArgs[0]; + var elements = resolvedArgs[1]; + for (var i = 0; i < elements.length; i++) { + mapped.push(interpreter.visit(exprefNode, elements[i])); + } + return mapped; + }, - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } + _functionMerge: function(resolvedArgs) { + var merged = {}; + for (var i = 0; i < resolvedArgs.length; i++) { + var current = resolvedArgs[i]; + for (var key in current) { + merged[key] = current[key]; + } + } + return merged; + }, + + _functionMax: function(resolvedArgs) { + if (resolvedArgs[0].length > 0) { + var typeName = this._getTypeName(resolvedArgs[0][0]); + if (typeName === TYPE_NUMBER) { + return Math.max.apply(Math, resolvedArgs[0]); + } else { + var elements = resolvedArgs[0]; + var maxElement = elements[0]; + for (var i = 1; i < elements.length; i++) { + if (maxElement.localeCompare(elements[i]) < 0) { + maxElement = elements[i]; + } + } + return maxElement; + } + } else { + return null; + } + }, - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; + _functionMin: function(resolvedArgs) { + if (resolvedArgs[0].length > 0) { + var typeName = this._getTypeName(resolvedArgs[0][0]); + if (typeName === TYPE_NUMBER) { + return Math.min.apply(Math, resolvedArgs[0]); + } else { + var elements = resolvedArgs[0]; + var minElement = elements[0]; + for (var i = 1; i < elements.length; i++) { + if (elements[i].localeCompare(minElement) < 0) { + minElement = elements[i]; + } + } + return minElement; + } + } else { + return null; + } + }, - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } + _functionSum: function(resolvedArgs) { + var sum = 0; + var listToSum = resolvedArgs[0]; + for (var i = 0; i < listToSum.length; i++) { + sum += listToSum[i]; + } + return sum; + }, - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); + _functionType: function(resolvedArgs) { + switch (this._getTypeName(resolvedArgs[0])) { + case TYPE_NUMBER: + return "number"; + case TYPE_STRING: + return "string"; + case TYPE_ARRAY: + return "array"; + case TYPE_OBJECT: + return "object"; + case TYPE_BOOLEAN: + return "boolean"; + case TYPE_EXPREF: + return "expref"; + case TYPE_NULL: + return "null"; + } + }, - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } + _functionKeys: function(resolvedArgs) { + return Object.keys(resolvedArgs[0]); + }, - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } + _functionValues: function(resolvedArgs) { + var obj = resolvedArgs[0]; + var keys = Object.keys(obj); + var values = []; + for (var i = 0; i < keys.length; i++) { + values.push(obj[keys[i]]); + } + return values; + }, - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; + _functionJoin: function(resolvedArgs) { + var joinChar = resolvedArgs[0]; + var listJoin = resolvedArgs[1]; + return listJoin.join(joinChar); + }, - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; - } + _functionToArray: function(resolvedArgs) { + if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) { + return resolvedArgs[0]; + } else { + return [resolvedArgs[0]]; + } + }, - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); + _functionToString: function(resolvedArgs) { + if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) { + return resolvedArgs[0]; + } else { + return JSON.stringify(resolvedArgs[0]); + } + }, - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } + _functionToNumber: function(resolvedArgs) { + var typeName = this._getTypeName(resolvedArgs[0]); + var convertedValue; + if (typeName === TYPE_NUMBER) { + return resolvedArgs[0]; + } else if (typeName === TYPE_STRING) { + convertedValue = +resolvedArgs[0]; + if (!isNaN(convertedValue)) { + return convertedValue; + } + } + return null; + }, - /** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ - function setToPairs(set) { - var index = -1, - result = Array(set.size); + _functionNotNull: function(resolvedArgs) { + for (var i = 0; i < resolvedArgs.length; i++) { + if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) { + return resolvedArgs[i]; + } + } + return null; + }, - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } + _functionSort: function(resolvedArgs) { + var sortedArray = resolvedArgs[0].slice(0); + sortedArray.sort(); + return sortedArray; + }, - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; + _functionSortBy: function(resolvedArgs) { + var sortedArray = resolvedArgs[0].slice(0); + if (sortedArray.length === 0) { + return sortedArray; + } + var interpreter = this._interpreter; + var exprefNode = resolvedArgs[1]; + var requiredType = this._getTypeName( + interpreter.visit(exprefNode, sortedArray[0])); + if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) { + throw new Error("TypeError"); + } + var that = this; + // In order to get a stable sort out of an unstable + // sort algorithm, we decorate/sort/undecorate (DSU) + // by creating a new list of [index, element] pairs. + // In the cmp function, if the evaluated elements are + // equal, then the index will be used as the tiebreaker. + // After the decorated list has been sorted, it will be + // undecorated to extract the original elements. + var decorated = []; + for (var i = 0; i < sortedArray.length; i++) { + decorated.push([i, sortedArray[i]]); + } + decorated.sort(function(a, b) { + var exprA = interpreter.visit(exprefNode, a[1]); + var exprB = interpreter.visit(exprefNode, b[1]); + if (that._getTypeName(exprA) !== requiredType) { + throw new Error( + "TypeError: expected " + requiredType + ", received " + + that._getTypeName(exprA)); + } else if (that._getTypeName(exprB) !== requiredType) { + throw new Error( + "TypeError: expected " + requiredType + ", received " + + that._getTypeName(exprB)); + } + if (exprA > exprB) { + return 1; + } else if (exprA < exprB) { + return -1; + } else { + // If they're equal compare the items by their + // order to maintain relative order of equal keys + // (i.e. to get a stable sort). + return a[0] - b[0]; + } + }); + // Undecorate: extract out the original list elements. + for (var j = 0; j < decorated.length; j++) { + sortedArray[j] = decorated[j][1]; + } + return sortedArray; + }, - while (++index < length) { - if (array[index] === value) { - return index; + _functionMaxBy: function(resolvedArgs) { + var exprefNode = resolvedArgs[1]; + var resolvedArray = resolvedArgs[0]; + var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); + var maxNumber = -Infinity; + var maxRecord; + var current; + for (var i = 0; i < resolvedArray.length; i++) { + current = keyFunction(resolvedArray[i]); + if (current > maxNumber) { + maxNumber = current; + maxRecord = resolvedArray[i]; + } } - } - return -1; - } + return maxRecord; + }, - /** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; + _functionMinBy: function(resolvedArgs) { + var exprefNode = resolvedArgs[1]; + var resolvedArray = resolvedArgs[0]; + var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); + var minNumber = Infinity; + var minRecord; + var current; + for (var i = 0; i < resolvedArray.length; i++) { + current = keyFunction(resolvedArray[i]); + if (current < minNumber) { + minNumber = current; + minRecord = resolvedArray[i]; + } } + return minRecord; + }, + + createKeyFunction: function(exprefNode, allowedTypes) { + var that = this; + var interpreter = this._interpreter; + var keyFunc = function(x) { + var current = interpreter.visit(exprefNode, x); + if (allowedTypes.indexOf(that._getTypeName(current)) < 0) { + var msg = "TypeError: expected one of " + allowedTypes + + ", received " + that._getTypeName(current); + throw new Error(msg); + } + return current; + }; + return keyFunc; } - return index; + + }; + + function compile(stream) { + var parser = new Parser(); + var ast = parser.parse(stream); + return ast; } - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); + function tokenize(stream) { + var lexer = new Lexer(); + return lexer.tokenize(stream); } - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); + function search(data, expression) { + var parser = new Parser(); + // This needs to be improved. Both the interpreter and runtime depend on + // each other. The runtime needs the interpreter to support exprefs. + // There's likely a clean way to avoid the cyclic dependency. + var runtime = new Runtime(); + var interpreter = new TreeInterpreter(runtime); + runtime._interpreter = interpreter; + var node = parser.parse(expression); + return interpreter.search(node, data); } - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedEndIndex(string) { - var index = string.length; + exports.tokenize = tokenize; + exports.compile = compile; + exports.search = search; + exports.strictDeepEqual = strictDeepEqual; +})( false ? 0 : exports); - while (index-- && reWhitespace.test(string.charAt(index))) {} - return index; - } - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); +/***/ }), - /** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; - } +/***/ 90250: +/***/ (function(module, exports, __nccwpck_require__) { - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } +/* module decorator */ module = __nccwpck_require__.nmd(module); +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; - /*--------------------------------------------------------------------------*/ + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - var runInContext = (function runInContext(context) { - context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; - /** Built-in constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; - /** Used to detect overreaching core-js shims. */ - var coreJsData = context['__core-js_shared__']; + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; - /** Used to generate unique IDs. */ - var idCounter = 0; + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; - /** Built-in value references. */ - var Buffer = moduleExports ? context.Buffer : undefined, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, - symIterator = Symbol ? Symbol.iterator : undefined, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; - /** Mocked built-ins. */ - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - /* Built-in method references that are verified to be native. */ - var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - /** Used to lookup unminified function names. */ - var realNames = {}; + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; - /*------------------------------------------------------------------------*/ + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; - /** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; - } + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB) as well as ES2015 template strings. Change the - * following template settings to use alternative delimiters. - * - * @static - * @memberOf _ - * @type {Object} - */ - lodash.templateSettings = { + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'escape': reEscape, + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'evaluate': reEvaluate, + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'interpolate': reInterpolate, + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - 'variable': '', + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - 'imports': { + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - '_': lodash - } - }; + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - /*------------------------------------------------------------------------*/ + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @constructor - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - outer: - while (length-- && resIndex < takeCount) { - index += dir; + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); - var iterIndex = -1, - value = array[index]; + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; - /*------------------------------------------------------------------------*/ + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); - } + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - /*------------------------------------------------------------------------*/ + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + /** Detect free variable `exports`. */ + var freeExports = true && exports && !exports.nodeType && exports; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + /** Detect free variable `module`. */ + var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); + if (types) { + return types; + } - return index < 0 ? undefined : data[index][1]; - } + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); + /*--------------------------------------------------------------------------*/ - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); } + return func.apply(thisArg, args); + } - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; - /*------------------------------------------------------------------------*/ + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; } } + return array; + } - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } } + return array; + } - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } } + return true; + } - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } } + return result; + } - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /*------------------------------------------------------------------------*/ + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); + while (++index < length) { + if (comparator(value, array[index])) { + return true; } } + return false; + } - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); + while (++index < length) { + result[index] = iteratee(array[index], index, array); } + return result; + } - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; + while (++index < length) { + array[offset + index] = values[index]; } + return array; + } - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; - this.size = data.size; - return result; + if (initAccum && length) { + accumulator = array[++index]; } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); } + return accumulator; + } - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); } + return accumulator; + } - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; } - data.set(key, value); - this.size = data.size; - return this; } + return false; + } - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); - /*------------------------------------------------------------------------*/ + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; } - return result; - } + }); + return result; + } - /** - * A specialized version of `_.sample` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. - */ - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; - } + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); - /** - * A specialized version of `_.sampleSize` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } } + return -1; + } - /** - * A specialized version of `_.shuffle` for arrays. - * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); - } + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); + while (++index < length) { + if (comparator(array[index], value)) { + return index; } } + return -1; + } - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } - /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; - } + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } - } + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } - /** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. - */ - function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); - } - return result; + array.sort(comparer); + while (length--) { + array[length] = array[length].value; } + return array; + } - /** - * The base implementation of `_.clamp` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); } - return number; } + return result; + } - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } - /** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } - /** - * The base implementation of `_.conformsTo` which accepts `props` to check. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; - } + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } - /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; - /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } + while (length--) { + if (array[length] === placeholder) { + ++result; } - return result; } + return result; + } - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); - /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } - while (++index < length) { - var value = array[index], - current = iteratee(value); + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; + while (!(data = iterator.next()).done) { + result.push(data.value); } + return result; + } - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } - predicate || (predicate = isFlattenable); - result || (result = []); + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; } - return result; } + return result; + } - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); - /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = castPath(path, object); + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } - var index = 0, - length = path.length; + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; - while (object != null && index < length) { - object = object[toKey(path[index++])]; + while (++index < length) { + if (array[index] === value) { + return index; } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } + return -1; + } - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); } + return index; + } - /** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ - function baseGt(value, other) { - return value > other; - } + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); - } + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; - /** - * The base implementation of `_.inRange` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; } + return result; + } - /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } - var index = -1, - seen = caches[0]; + /*--------------------------------------------------------------------------*/ - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; - /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; - } + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); - } + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; - /** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - */ - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; - } + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; - /** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } + /** Used to generate unique IDs. */ + var idCounter = 0; - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); + var nativeObjectToString = objectProto.toString; - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); - } + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); - /** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; - } + /** Used to lookup unminified function names. */ + var realNames = {}; - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); - /** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; - /** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } + /*------------------------------------------------------------------------*/ /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - - /** - * The base implementation of `_.iteratee`. + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); } } - return result; - } - - /** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ - function baseLt(value, other) { - return value < other; + return new LodashWrapper(value); } /** - * The base implementation of `_.map` without support for iteratee shorthands. + * The base implementation of `_.create` without support for assigning + * properties to the created object. * * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); /** - * The base implementation of `_.matches` which doesn't clone `source`. + * The function whose prototype chain sequence wrappers inherit from. * * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; + function baseLodash() { + // No operation performed. } /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * The base constructor for creating `lodash` wrapper objects. * * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; } /** - * The base implementation of `_.merge` without support for multiple sources. + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. + * @static + * @memberOf _ + * @type {Object} */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; + lodash.templateSettings = { - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); - } + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, - var isCommon = newValue === undefined; + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash } - assignMergeValue(object, key, newValue); + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; } /** - * The base implementation of `_.nth` which doesn't coerce arguments. + * Creates a clone of the lazy wrapper object. * * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. */ - function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; } /** - * The base implementation of `_.orderBy` without param guards. + * Reverses the direction of lazy iteration. * * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. */ - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray(iteratee)) { - return function(value) { - return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } - } - return iteratee; - }); + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; } else { - iteratees = [identity]; + result = this.clone(); + result.__dir__ *= -1; } - - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); + return result; } /** - * The base implementation of `_.pick` without support for individual - * property identifiers. + * Extracts the unwrapped value from its lazy wrapper. * * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. */ - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; } + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. + * Creates a hash object. * * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ - function basePickBy(object, paths, predicate) { + function Hash(entries) { var index = -1, - length = paths.length, - result = {}; + length = entries == null ? 0 : entries.length; + this.clear(); while (++index < length) { - var path = paths[index], - value = baseGet(object, path); - - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return result; } /** - * A specialized version of `baseProperty` which supports deep paths. + * Removes all key-value entries from the hash. * * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. + * @name clear + * @memberOf Hash */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. + * Removes `key` and its value from the hash. * * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; - - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; } - return array; + return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. + * Checks if a hash value for `key` exists. * * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. + * Sets the hash `key` to `value`. * * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; } + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. + * Creates an list cache object. * * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ - function baseRange(start, end, step, fromRight) { + function ListCache(entries) { var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); + length = entries == null ? 0 : entries.length; - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return result; } /** - * The base implementation of `_.repeat` which doesn't coerce arguments. + * Removes all key-value entries from the list cache. * * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. + * @name clear + * @memberOf ListCache */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; + function listCacheClear() { + this.__data__ = []; + this.size = 0; } /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * Removes `key` and its value from the list cache. * * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; } /** - * The base implementation of `_.sample`. + * Gets the list cache value for `key`. * * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ - function baseSample(collection) { - return arraySample(values(collection)); + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; } /** - * The base implementation of `_.sampleSize` without param guards. + * Checks if a list cache value for `key` exists. * * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; } /** - * The base implementation of `_.set`. + * Sets the list cache `key` to `value`. * * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. + * @returns {Object} Returns the list cache instance. */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; } - path = castPath(path, object); + return this; + } - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; + /*------------------------------------------------------------------------*/ - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return object; - } + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return object; } /** - * The base implementation of `setData` without support for hot loop shorting. + * Removes all key-value entries from the map. * * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. + * @name clear + * @memberOf MapCache */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } /** - * The base implementation of `setToString` without support for hot loop shorting. + * Removes `key` and its value from the map. * * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } /** - * The base implementation of `_.shuffle`. + * Gets the map value for `key`. * * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ - function baseShuffle(collection) { - return shuffleSelf(values(collection)); + function mapCacheGet(key) { + return getMapData(this, key).get(key); } /** - * The base implementation of `_.slice` without an iteratee call guard. + * Checks if a map value for `key` exists. * * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; + function mapCacheHas(key) { + return getMapData(this, key).has(key); } /** - * The base implementation of `_.some` without support for iteratee shorthands. + * Sets the map `key` to `value`. * * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. */ - function baseSome(collection, predicate) { - var result; + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; } + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. + * + * Creates an array cache object to store unique values. * * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. + * @constructor + * @param {Array} [values] The values to cache. */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); } - return baseSortedIndexBy(array, value, identity, retHighest); } /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). + * Adds `value` to the array cache. * * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - var low = 0, - high = array == null ? 0 : array.length; - if (high === 0) { - return 0; - } - - value = iteratee(value); - var valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); - - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. + * Checks if `value` is in the array cache. * * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. */ - function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; + function setCacheHas(value) { + return this.__data__.has(value); + } - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; - } + /*------------------------------------------------------------------------*/ /** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. + * Creates a stack cache object to store key-value pairs. * * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ - function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - return +value; + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. + * Removes all key-value entries from the stack. * * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @name clear + * @memberOf Stack */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; } /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * Removes `key` and its value from the stack. * * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } + this.size = data.size; return result; } /** - * The base implementation of `_.unset`. + * Gets the stack value for `key`. * * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; + function stackGet(key) { + return this.__data__.get(key); } /** - * The base implementation of `_.update`. + * Checks if a stack value for `key` exists. * * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); + function stackHas(key) { + return this.__data__.has(key); } /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. + * Sets the stack `key` to `value`. * * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } + /*------------------------------------------------------------------------*/ /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. + * Creates an array of the enumerable property names of the array-like `value`. * * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); + return result; } /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. + * A specialized version of `_.sample` for arrays. * * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. */ - function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; - } - var index = -1, - result = Array(length); - - while (++index < length) { - var array = arrays[index], - othIndex = -1; + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } - } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * A specialized version of `_.shuffle` for arrays. * * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } - return result; } /** - * Casts `value` to an empty array if it's not an array like object. + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } } /** - * Casts `value` to `identity` if it's not a function. + * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. */ - function castFunction(value) { - return typeof value == 'function' ? value : identity; + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; } /** - * Casts `value` to a path array if it's not one. + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. * * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. */ - function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; } /** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. * * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ - var castRest = baseRest; + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } /** - * Casts `array` to a slice if it's needed. + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. * * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); } /** - * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. * * @private - * @param {number|Object} id The timer id or timeout object of the timer to clear. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } /** - * Creates a clone of `buffer`. + * The base implementation of `_.at` without support for individual paths. * * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; - buffer.copy(result); + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } return result; } /** - * Creates a clone of `arrayBuffer`. + * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; } /** - * Creates a clone of `dataView`. + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. * * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; } /** - * Creates a clone of `regexp`. + * The base implementation of `_.conforms` which doesn't clone `source`. * * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; } /** - * Creates a clone of the `symbol` object. + * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; } /** - * Creates a clone of `typedArray`. + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. * * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); } /** - * Compares values to sort them in ascending order. + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. * * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; + else if (!includes(values, computed, comparator)) { + result.push(value); } } - return 0; + return result; } /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. + * The base implementation of `_.forEach` without support for iteratee shorthands. * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; + var baseEachRight = createBaseEach(baseForOwnRight, true); - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; } /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. * * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; } } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } return result; } /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. + * The base implementation of `_.fill` without an iteratee call guard. * * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. */ - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; + function baseFill(array, value, start, end) { + var length = array.length; - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; } - return result; + return array; } /** - * Copies the values of `source` to `array`. + * The base implementation of `_.filter` without support for iteratee shorthands. * * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; } /** - * Copies properties of `source` to `object`. + * The base implementation of `_.flatten` with support for restricting flattening. * * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - + function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; + length = array.length; - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; + predicate || (predicate = isFlattenable); + result || (result = []); - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; } } - return object; + return result; } /** - * Copies own symbols of `source` to `object`. + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } + var baseFor = createBaseFor(); /** - * Copies own and inherited symbols of `source` to `object`. + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. * * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } + var baseForRight = createBaseFor(true); /** - * Creates a function like `_.groupBy`. + * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, getIteratee(iteratee, 2), accumulator); - }; + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); } /** - * Creates a function like `_.assign`. + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); } /** - * Creates a `baseEach` or `baseEachRight` function. + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. * * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); } /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * The base implementation of `_.get` without support for default values. * * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } + function baseGet(object, path) { + path = castPath(path, object); - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); + var index = 0, + length = path.length; - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); + while (object != null && index < length) { + object = object[toKey(path[index++])]; } - return wrapper; + return (index && index == length) ? object : undefined; } /** - * Creates a function like `_.lowerFirst`. + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. * * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** - * Creates a function like `_.camelCase`. + * The base implementation of `getTag` without fallbacks for buggy environments. * * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * The base implementation of `_.gt` which doesn't coerce arguments. * * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; + function baseGt(value, other) { + return value > other; } /** - * Creates a function that wraps `func` to enable currying. + * The base implementation of `_.has` without support for deep paths. * * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. */ - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); - } - return wrapper; + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); } /** - * Creates a `_.find` or `_.findLast` function. + * The base implementation of `_.hasIn` without support for deep paths. * * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; + function baseHasIn(object, key) { + return object != null && key in Object(object); } /** - * Creates a `_.flow` or `_.flowRight` function. + * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. */ - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); } - return fn.apply(thisBinding, args); } - return wrapper; + return result; } /** - * Creates a function like `_.invertBy`. + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. * * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; } /** - * Creates a function that performs a mathematical operation on two values. + * The base implementation of `_.invoke` without support for individual + * method arguments. * * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. */ - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); } /** - * Creates a function like `_.over`. + * The base implementation of `_.isArguments`. * * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ - function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. + * The base implementation of `_.isDate` without Node.js optimizations. * * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; } - return wrapper; + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** - * Creates a `_.range` or `_.rangeRight` function. + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. * * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** - * Creates a function that performs a relational operation on two values. + * The base implementation of `_.isMap` without Node.js optimizations. * * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; } /** - * Creates a function that wraps `func` to continue currying. + * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + if (object == null) { + return !length; } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); + return true; } /** - * Creates a function like `_.round`. + * The base implementation of `_.isNative` without bad shim checks. * * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision && nativeIsFinite(number)) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** - * Creates a set object of `values`. + * The base implementation of `_.isSet` without Node.js optimizations. * * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); - }; + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } /** - * Creates a `_.toPairs` or `_.toPairsIn` function. + * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. + * The base implementation of `_.iteratee`. * * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. */ - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; + if (value == null) { + return identity; } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); } - var data = isBindKey ? undefined : getData(func); - - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; + return property(value); + } - if (data) { - mergeData(newData, data); + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); + return result; } /** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. + * The base implementation of `_.lt` which doesn't coerce arguments. * * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. */ - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); } - return objValue; + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; } /** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. */ - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); } - return objValue; + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; } /** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. + * The base implementation of `_.merge` without support for multiple sources. * * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. */ - function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); } /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. * * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; + if (stacked) { + assignMergeValue(object, key, stacked); + return; } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; - stack.set(array, other); - stack.set(other, array); + var isCommon = newValue === undefined; - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; } - result = false; - break; } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; + } + else { + isCommon = false; } } - stack['delete'](array); - stack['delete'](other); - return result; + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); } /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * The base implementation of `_.nth` which doesn't coerce arguments. * * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); + return iteratee; + }); + } else { + iteratees = [identity]; + } - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); } /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. + * The base implementation of `_.pick` without support for individual + * property identifiers. * * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Check that cyclic values are equal. - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; - } - var result = true; - stack.set(object, other); - stack.set(other, object); + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); } } - stack['delete'](object); - stack['delete'](other); return result; } /** - * A specialized version of `baseRest` which flattens the rest array. + * A specialized version of `baseProperty` which supports deep paths. * * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; } /** - * Creates an array of own enumerable property names and symbols of `object`. + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; } /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; } /** - * Gets metadata for `func`. + * The base implementation of `_.random` without support for returning + * floating-point numbers. * * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } /** - * Gets the name of `func`. + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. * * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } + result[fromRight ? length : ++index] = start; + start += step; } return result; } /** - * Gets the argument placeholder value for `func`. + * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. */ - function getHolder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); - /** - * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, - * this function returns the custom method, otherwise it returns `baseIteratee`. - * If arguments are provided, the chosen function is invoked with them and - * its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; + return result; } /** - * Gets the data for `map`. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); } /** - * Gets the property names, values, and compare flags of `object`. + * The base implementation of `_.sample`. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; + function baseSample(collection) { + return arraySample(values(collection)); } /** - * Gets the native function at `key` of `object`. + * The base implementation of `_.sampleSize` without param guards. * * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * The base implementation of `_.set`. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } } + assignValue(nested, key, newValue); + nested = nested[key]; } - return result; + return object; } /** - * Creates an array of the own enumerable symbols of `object`. + * The base implementation of `setData` without support for hot loop shorting. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; }; /** - * Creates an array of the own and inherited enumerable symbols of `object`. + * The base implementation of `setToString` without support for hot loop shorting. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); }; /** - * Gets the `toStringTag` of `value`. + * The base implementation of `_.shuffle`. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; + function baseShuffle(collection) { + return shuffleSelf(values(collection)); } /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. + * The base implementation of `_.slice` without an iteratee call guard. * * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. */ - function getView(start, end, transforms) { + function baseSlice(array, start, end) { var index = -1, - length = transforms.length; + length = array.length; - while (++index < length) { - var data = transforms[index], - size = data.size; + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; } - return { 'start': start, 'end': end }; + return result; } /** - * Extracts wrapper details from the `source` body comment. + * The base implementation of `_.some` without support for iteratee shorthands. * * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; } /** - * Checks if `path` exists on `object`. + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. * * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. */ - function hasPath(object, path, hasFunc) { - path = castPath(path, object); + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; - var index = -1, - length = path.length, - result = false; + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } } - object = object[key]; - } - if (result || ++index != length) { - return result; + return high; } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); + return baseSortedIndexBy(array, value, identity, retHighest); } /** - * Initializes an array clone. + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). * * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; - case symbolTag: - return cloneSymbol(object); - } - } + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); - /** - * Inserts wrapper `details` in a comment at the top of the `source` body. - * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. - */ - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + return nativeMin(high, MAX_ARRAY_INDEX); } /** - * Checks if `value` is a flattenable `arguments` object or array. + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); - } + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; } /** - * Checks if the given arguments are from an iteratee call. + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. * * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. + * @param {*} value The value to process. + * @returns {number} Returns the number. */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; + function baseToNumber(value) { + if (typeof value == 'number') { + return value; } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); + if (isSymbol(value)) { + return NAN; } - return false; + return +value; } /** - * Checks if `value` is a property name and not a property path. + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. * * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + * @param {*} value The value to process. + * @returns {string} Returns the string. */ - function isKey(value, object) { + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } if (isArray(value)) { - return false; + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** - * Checks if `func` has a lazy counterpart. + * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; } - if (func === other) { - return true; + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; } - var data = getData(other); - return !!data && func === data[0]; + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; } /** - * Checks if `func` has its source masked. + * The base implementation of `_.unset`. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; } /** - * Checks if `func` is capable of being masked. + * The base implementation of `_.update`. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. */ - var isMaskable = coreJsData ? isFunction : stubFalse; + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } /** - * Checks if `value` is likely a prototype object. + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; - return value === proto; + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. */ - function isStrictComparable(value) { - return value === value && !isObject(value); + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); } /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. * * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; - var cache = result.cache; + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } return result; } /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. + * Casts `value` to an empty array if it's not an array like object. * * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; - } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; } /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. + * Casts `value` to `identity` if it's not a function. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; + function castFunction(value) { + return typeof value == 'function' ? value : identity; } /** - * Converts `value` to a string using `Object.prototype.toString`. + * Casts `value` to a path array if it's not one. * * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. */ - function objectToString(value) { - return nativeObjectToString.call(value); + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** - * A specialized version of `baseRest` which transforms the rest array. + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. * * @private + * @type {Function} * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } + var castRest = baseRest; /** - * Gets the parent value at `path` of `object`. + * Casts `array` to a slice if it's needed. * * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. */ - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); } /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. + * @param {number|Object} id The timer id or timeout object of the timer to clear. */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; /** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * Creates a clone of `buffer`. * * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. */ - function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - if (key == '__proto__') { - return; - } + buffer.copy(result); + return result; + } - return object[key]; + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; } /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. + * Creates a clone of `dataView`. * * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. */ - var setData = shortOut(baseSetData); + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } /** - * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * Creates a clone of `regexp`. * * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @returns {number|Object} Returns the timer id or timeout object. + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. */ - var setTimeout = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); - }; + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } /** - * Sets the `toString` method of `func` to return `string`. + * Creates a clone of the `symbol` object. * * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. */ - var setToString = shortOut(baseSetToString); + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } /** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. + * Creates a clone of `typedArray`. * * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. */ - function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. + * Compares values to sort them in ascending order. * * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. */ - function shortOut(func) { - var count = 0, - lastCalled = 0; + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; } - return func.apply(undefined, arguments); - }; + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; } /** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. * * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. */ - function shuffleSelf(array, size) { + function compareMultiple(object, other, orders) { var index = -1, - length = array.length, - lastIndex = length - 1; - - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; - array[rand] = array[index]; - array[index] = value; + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } } - array.length = size; - return array; + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; } /** - * Converts `string` to a property path array. + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. * * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); return result; - }); + } /** - * Converts `value` to a string key if it's not a string or symbol. + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. * * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; } /** - * Converts `func` to its source code. + * Copies the values of `source` to `array`. * * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; } - return ''; + return array; } /** - * Updates wrapper `details` based on `bitmask` flags. + * Copies properties of `source` to `object`. * * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. */ - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; } - }); - return details.sort(); + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; } /** - * Creates a clone of `wrapper`. + * Copies own symbols of `source` to `object`. * * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); } - /*------------------------------------------------------------------------*/ - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] + * Copies own and inherited symbols of `source` to `object`. * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); } /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example + * Creates a function like `_.groupBy`. * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; } /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] + * Creates a function like `_.assign`. * - * console.log(array); - * // => [1] + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; - /** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; - /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * Creates a `baseEach` or `baseEachRight` function. * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; - }); + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] + * Creates a base function for methods like `_.forIn` and `_.forOwn`. * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; } /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); + return wrapper; } /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] + * Creates a function like `_.lowerFirst`. * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; } /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] + * Creates a function like `_.camelCase`. * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; } /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; } /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 + * Creates a function that wraps `func` to enable currying. * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); } - return baseFindIndex(array, getIteratee(predicate, 3), index); + return wrapper; } /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 + * Creates a `_.find` or `_.findLast` function. * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; } /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example + * Creates a `_.flow` or `_.flowRight` function. * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; - /** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); } /** - * Recursively flatten `array` up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * var array = [1, [2, [3, [4]], 5]]; - * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); } - return result; + return wrapper; } /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 + * Creates a function like `_.invertBy`. * - * _.head([]); - * // => undefined + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. */ - function head(array) { - return (array && array.length) ? array[0] : undefined; + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; } /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 + * Creates a function that performs a mathematical operation on two values. * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; } /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example + * Creates a function like `_.over`. * - * _.initial([1, 2, 3]); - * // => [1, 2] + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); } /** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersection([2, 1], [2, 3]); - * // => [2] - */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); + return wrapper; + } /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example + * Creates a `_.range` or `_.rangeRight` function. * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; } /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example + * Creates a function that performs a relational operation on two values. * - * _.last([1, 2, 3]); - * // => 3 + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; } /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 + * Creates a function that wraps `func` to continue currying. * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; } /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth - * element from the end is returned. - * - * @static - * @memberOf _ - * @since 4.11.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=0] The index of the element to return. - * @returns {*} Returns the nth element of `array`. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * - * _.nth(array, 1); - * // => 'b' + * Creates a set object of `values`. * - * _.nth(array, -2); - * // => 'c'; + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; - } + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; /** - * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` - * to remove elements from an array by predicate. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * Creates a `_.toPairs` or `_.toPairsIn` function. * - * _.pull(array, 'a', 'c'); - * console.log(array); - * // => ['b', 'b'] + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. */ - var pull = baseRest(pullAll); + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. * - * _.pullAll(array, ['a', 'c']); - * console.log(array); - * // => ['b', 'b'] + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); } /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; } /** - * This method is like `_.pullAll` except that it accepts `comparator` which - * is invoked to compare elements of `array` to `values`. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined, comparator) - : array; + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; } /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * var pulled = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => ['a', 'c'] + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. * - * console.log(pulled); - * // => ['b', 'd'] + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); - - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - - return result; - }); + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked - * with three arguments: (value, index, array). - * - * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` - * to pull elements from an array by value. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. * - * console.log(evens); - * // => [2, 4] + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; } var index = -1, - indexes = [], - length = array.length; + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; } } - basePullAt(array, indexes); + stack['delete'](array); + stack['delete'](other); return result; } /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. * - * _.reverse(array); - * // => [3, 2, 1] + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * - * console.log(array); - * // => [3, 2, 1] + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } } - return baseSlice(array, start, end); + return false; } /** - * Uses a binary search to determine the lowest index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. * - * _.sortedIndex([30, 50], 40); - * // => 1 + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; } /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 0 + * A specialized version of `baseRest` which flattens the rest array. * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); - * // => 0 + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); } /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example + * Creates an array of own enumerable property names and symbols of `object`. * - * _.sortedIndexOf([4, 5, 5, 5, 6], 5); - * // => 1 + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); } /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. * - * _.sortedLastIndex([4, 5, 5, 5, 6], 5); - * // => 4 + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 1 + * Gets metadata for `func`. * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); - * // => 1 + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example + * Gets the name of `func`. * - * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); - * // => 3 + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; } } - return -1; + return result; } /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example + * Gets the argument placeholder value for `func`. * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; } /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; } /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example + * Gets the data for `map`. * - * _.tail([1, 2, 3]); - * // => [2, 3] + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; } /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] + * Gets the property names, values, and compare flags of `object`. * - * _.take([1, 2, 3], 0); - * // => [] + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } + function getMatchData(object) { + var result = keys(object), + length = result.length; - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); + return result; } /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] + * Gets the native function at `key` of `object`. * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; } /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; - /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2], [1, 2]); - * // => [2, 1] - */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. Result values are chosen from the first - * array in which the value occurs. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1], [1.2, 2.3], Math.floor); - * // => [2.1, 1.2] + * Creates an array of the own enumerable symbols of `object`. * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. Result values are chosen from - * the first array in which the value occurs. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * Creates an array of the own and inherited enumerable symbols of `object`. * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); - }); + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. The order of result values is determined by the order they occur - * in the array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example + * Gets the `toStringTag` of `value`. * - * _.uniq([2, 1, 2]); - * // => [2, 1] + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; } /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The order of result values is determined by the - * order they occur in the array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] + * Gets the view, applying any `transforms` to the `start` and `end` positions. * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; } /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The order of result values is - * determined by the order they occur in the array.The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * Extracts wrapper details from the `source` body comment. * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined; - return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; } /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @since 1.2.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] + * Checks if `path` exists on `object`. * - * _.unzip(zipped); - * // => [['a', 'b'], [1, 2], [true, false]] + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); } /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine - * regrouped values. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] + * Initializes an array clone. * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); + return result; } /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor - * @example + * Initializes an object clone. * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } /** - * Creates an array of unique values that is the - * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. The order of result values is determined by the order - * they occur in the arrays. + * Initializes an object clone based on its `toStringTag`. * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.without - * @example + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * - * _.xor([2, 1], [2, 3]); - * // => [1, 3] + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. */ - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which by which they're compared. The order of result values is determined - * by the order they occur in the arrays. The iteratee is invoked with one - * argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2, 3.4] + * Inserts wrapper `details` in a comment at the top of the `source` body. * - * // The `_.property` iteratee shorthand. - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. */ - var xorBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); - }); + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The order of result values is - * determined by the order they occur in the arrays. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * Checks if `value` is a flattenable `arguments` object or array. * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); - }); + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } /** - * Creates an array of grouped elements, the first of which contains the - * first elements of the given arrays, the second of which contains the - * second elements of the given arrays, and so on. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example + * Checks if `value` is a valid array-like index. * - * _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ - var zip = baseRest(unzip); + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } /** - * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property identifiers and one of corresponding values. - * - * @static - * @memberOf _ - * @since 0.4.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example + * Checks if the given arguments are from an iteratee call. * - * _.zipObject(['a', 'b'], [1, 2]); - * // => { 'a': 1, 'b': 2 } + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; } /** - * This method is like `_.zipObject` except that it supports property paths. - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example + * Checks if `value` is a property name and not a property path. * - * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); - * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); } /** - * This method is like `_.zip` except that it accepts `iteratee` to specify - * how grouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee=_.identity] The function to combine - * grouped values. - * @returns {Array} Returns the new array of grouped elements. - * @example + * Checks if `value` is suitable for use as unique object key. * - * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - * return a + b + c; - * }); - * // => [111, 222] + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ - var zipWith = baseRest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined; - - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; - return unzipWith(arrays, iteratee); - }); - - /*------------------------------------------------------------------------*/ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } /** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; + * Checks if `func` has a lazy counterpart. * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; } /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example + * Checks if `func` has its source masked. * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ - function tap(value, interceptor) { - interceptor(value); - return value; + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); } /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain sequence. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example + * Checks if `func` is capable of being masked. * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ - function thru(value, interceptor) { - return interceptor(value); - } + var isMaskable = coreJsData ? isFunction : stubFalse; /** - * This method is the wrapper version of `_.at`. - * - * @name at - * @memberOf _ - * @since 1.0.0 - * @category Seq - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * Checks if `value` is likely a prototype object. * - * _(object).at(['a[0].b.c', 'a[1]']).value(); - * // => [3, 4] + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ - var wrapperAt = flatRest(function(paths) { - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - if (length > 1 || this.__actions__.length || - !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - 'func': thru, - 'args': [interceptor], - 'thisArg': undefined - }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined); - } - return array; - }); - }); + return value === proto; + } /** - * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. - * - * @name chain - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. */ - function wrapperChain() { - return chain(this); + function isStrictComparable(value) { + return value === value && !isObject(value); } /** - * Executes the chain sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. * - * console.log(array); - * // => [1, 2, 3] + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; } /** - * Gets the next value on a wrapped object following the - * [iterator protocol](https://mdn.io/iteration_protocols#iterator). - * - * @name next - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the next iterator value. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped.next(); - * // => { 'done': false, 'value': 1 } - * - * wrapped.next(); - * // => { 'done': false, 'value': 2 } + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. * - * wrapped.next(); - * // => { 'done': true, 'value': undefined } + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. */ - function wrapperNext() { - if (this.__values__ === undefined) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined : this.__values__[this.__index__++]; + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); - return { 'done': done, 'value': value }; + var cache = result.cache; + return result; } /** - * Enables the wrapper to be iterable. - * - * @name Symbol.iterator - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the wrapper object. - * @example - * - * var wrapped = _([1, 2]); + * Merges the function metadata of `source` into `data`. * - * wrapped[Symbol.iterator]() === wrapped; - * // => true + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. * - * Array.from(wrapped); - * // => [1, 2] + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. */ - function wrapperToIterator() { - return this; + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; } /** - * Creates a clone of the chain sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @param {*} value The value to plant. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2]).map(square); - * var other = wrapped.plant([3, 4]); - * - * other.value(); - * // => [9, 16] + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. * - * wrapped.value(); - * // => [1, 4] + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); } - var previous = clone; - parent = parent.__wrapped__; } - previous.__wrapped__ = value; return result; } /** - * This method is the wrapper version of `_.reverse`. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; + * Converts `value` to a string using `Object.prototype.toString`. * - * _(array).reverse().value() - * // => [3, 2, 1] + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. * - * console.log(array); - * // => [3, 2, 1] + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - 'func': thru, - 'args': [reverse], - 'thisArg': undefined - }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; } /** - * Executes the chain sequence to resolve the unwrapped value. - * - * @name value - * @memberOf _ - * @since 0.1.0 - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example + * Gets the parent value at `path` of `object`. * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } - /*------------------------------------------------------------------------*/ - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the number of times the key was returned by `iteratee`. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. */ - var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } - }); + return array; + } /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; } - return func(collection, getIteratee(predicate, 3)); + + if (key == '__proto__') { + return; + } + + return object[key]; } /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; + * Sets metadata for `func`. * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. * - * // Combining several predicates using `_.overEvery` or `_.overSome`. - * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); - * // => objects for ['fred', 'barney'] + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. */ - var find = createFind(findIndex); + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. */ - var findLast = createFind(findLastIndex); + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } /** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example + * Converts `string` to a property path array. * - * function duplicate(n) { - * return [n, n]; - * } + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. + * Converts `func` to its source code. * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. * - * function duplicate(n) { - * return [[[n, n]]]; - * } + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. */ - function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; } + /*------------------------------------------------------------------------*/ + /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. * * @static * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. * @example * - * function duplicate(n) { - * return [[[n, n]]]; - * } + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] */ - function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; } /** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. * @example * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] */ - function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee, 3)); + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; } /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. + * Creates a new array concatenating `array` with any additional arrays + * and/or values. * * @static * @memberOf _ - * @since 2.0.0 - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEach + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. * @example * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `2` then `1`. + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] */ - function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee, 3)); + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor * @example * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } + * _.difference([2, 1], [2, 3]); + * // => [1] */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; }); /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. * @example * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] * - * _.includes('abcd', 'bc'); - * // => true + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. * @example * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] */ - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; }); /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). + * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. * @example * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; + * _.drop([1, 2, 3]); + * // => [2, 3] * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * _.drop([1, 2, 3], 2); + * // => [3] * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] */ - var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); - }); + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } /** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. * @example * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] + * _.dropRight([1, 2, 3]); + * // => [1, 2] * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) + * _.dropRight([1, 2, 3], 2); + * // => [1] * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; + * _.dropRight([1, 2, 3], 5); + * // => [] * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); } /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). * * @static * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] - * The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {Array} Returns the new sorted array. + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. * @example * * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } * ]; * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; } /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. + * @category Array + * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. + * @returns {Array} Returns the slice of `array`. * @example * * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } * ]; * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` + * **Note:** This method mutates `array`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. * @example * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 + * var array = [1, 2, 3]; * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); } /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduce + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. * @example * - * var array = [[0, 1], [2, 3], [4, 5]]; + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); } /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } * ]; * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 * * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 * * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] + * _.findLastIndex(users, ['active', false]); + * // => 2 * * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] + * _.findLastIndex(users, 'active'); + * // => 0 */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** - * Gets a random element from `collection`. + * Flattens `array` a single level deep. * * @static * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. * @example * - * _.sample([1, 2, 3, 4]); - * // => 2 + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] */ - function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; } /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. + * Recursively flattens `array`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=1] The number of elements to sample. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the random elements. + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. * @example * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] - * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] */ - function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; } /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. * @example * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] */ - function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); } /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. * @example * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; } - return baseKeys(collection).length; + return result; } /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). + * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. * @example * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true + * _.head([1, 2, 3]); + * // => 1 * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true + * _.head([]); + * // => undefined */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); + function head(array) { + return (array && array.length) ? array[0] : undefined; } /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 30 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 */ - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); - - /*------------------------------------------------------------------------*/ + return baseIndexOf(array, value, index); + } /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). + * Gets all but the last element of `array`. * * @static * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. * @example * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. + * _.initial([1, 2, 3]); + * // => [1, 2] */ - var now = ctxNow || function() { - return root.Date.now(); - }; - - /*------------------------------------------------------------------------*/ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. * @example * - * var saves = ['profile', 'settings']; + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); /** - * Creates a function that invokes `func`, with up to `n` arguments, - * ignoring any additional arguments. + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new capped function. + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. * @example * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] */ - function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); - } + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. + * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. * @example * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); } /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. + * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. * @example * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' + * _.last([1, 2, 3]); + * // => 3 */ - var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); - }); + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } /** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. * * @static * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 */ - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; } - return createWrap(key, bitmask, object, partials, holders); - }); + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. * * @static * @memberOf _ - * @since 2.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. * @example * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] + * var array = ['a', 'b', 'c', 'd']; * - * curried(1, 2, 3); - * // => [1, 2, 3] + * _.nth(array, 1); + * // => 'b' * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] + * _.nth(array, -2); + * // => 'c'; */ - function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * - * **Note:** This method doesn't set the "length" property of curried functions. + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. * * @static * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. * @example * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * - * var curried = _.curryRight(abc); + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. * - * curried(3)(2)(1); - * // => [1, 2, 3] + * **Note:** Unlike `_.difference`, this method mutates `array`. * - * curried(2, 3)(1); - * // => [1, 2, 3] + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example * - * curried(1, 2, 3); - * // => [1, 2, 3] + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] */ - function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; } /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. * @example * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; } /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. * @example * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. * @example * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; }); /** - * Creates a function that invokes `func` with arguments reversed. + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. * * @static * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. * @example * - * var flipped = _.flip(function() { - * return _.toArray(arguments); + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; * }); * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] */ - function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; } /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). * - * values(other); - * // => [3, 4] + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example * - * object.a = 2; - * values(object); - * // => [1, 2] + * var array = [1, 2, 3]; * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] + * _.reverse(array); + * // => [3, 2, 1] * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; + * console.log(array); + * // => [3, 2, 1] */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; + function reverse(array) { + return array == null ? array : nativeReverse.call(array); } - // Expose `MapCache`. - memoize.Cache = MapCache; - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. * * @static * @memberOf _ * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); } /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once + * _.sortedIndex([30, 50], 40); + * // => 1 */ - function once(func) { - return before(2, func); + function sortedIndex(array, value) { + return baseSortedIndex(array, value); } /** - * Creates a function that invokes `func` with its arguments transformed. + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). * * @static - * @since 4.0.0 * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms=[_.identity]] - * The argument transforms. - * @returns {Function} Returns the new function. + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, [square, doubled]); + * var objects = [{ 'x': 4 }, { 'x': 5 }]; * - * func(9, 3); - * // => [81, 6] + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 * - * func(10, 5); - * // => [100, 10] + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 */ - var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); - - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } /** - * Creates a function that invokes `func` with `partials` prepended to the - * arguments it receives. This method is like `_.bind` except it does **not** - * alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. * * @static * @memberOf _ - * @since 0.2.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // Partially applied with placeholders. - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 */ - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); - }); + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } /** - * This method is like `_.partial` except that partially applied arguments - * are appended to the arguments it receives. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. * * @static * @memberOf _ - * @since 1.0.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 */ - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); - }); + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified `indexes` where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. * @example * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, [2, 0, 1]); + * var objects = [{ 'x': 4 }, { 'x': 5 }]; * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 */ - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); - }); + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } } - start = start === undefined ? start : toInteger(start); - return baseRest(func, start); + return -1; } /** - * Creates a function that invokes `func` with the `this` binding of the - * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). - * - * **Note:** This method is based on the - * [spread operator](https://mdn.io/spread_operator). + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. * * @static * @memberOf _ - * @since 3.2.0 - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. * @example * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); - - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; } /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. * * @static * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. * @example * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; } /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. + * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. * @example * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] + * _.tail([1, 2, 3]); + * // => [2, 3] */ - function unary(func) { - return ary(func, 1); + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; } /** - * Creates a function that provides `value` to `wrapper` as its first - * argument. Any additional arguments provided to the function are appended - * to those provided to the `wrapper`. The wrapper is invoked with the `this` - * binding of the created function. + * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 - * @category Function - * @param {*} value The value to wrap. - * @param {Function} [wrapper=identity] The wrapper function. - * @returns {Function} Returns the new function. + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. * @example * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); + * _.take([1, 2, 3]); + * // => [1] * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] */ - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); } - /*------------------------------------------------------------------------*/ - /** - * Casts `value` as an array if it's not one. + * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. * @example * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] + * _.takeRight([1, 2, 3]); + * // => [3] * - * _.castArray(null); - * // => [null] + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] * - * _.castArray(undefined); - * // => [undefined] + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] * - * _.castArray(); + * _.takeRight([1, 2, 3], 0); * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true */ - function castArray() { - if (!arguments.length) { + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { return []; } - var value = arguments[0]; - return isArray(value) ? value : [value]; + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); } /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. * @example * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] */ - function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; } /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined`, - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @see _.cloneDeepWith + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. * @example * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; * - * var el = _.cloneWith(document.body, customizer); + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] */ - function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; } /** - * This method is like `_.clone` except that it recursively clones `value`. + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * * @static * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. * @example * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false + * _.union([2], [1, 2]); + * // => [2, 1] */ - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); /** - * This method is like `_.cloneWith` except that it recursively clones `value`. + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ * @since 4.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @see _.cloneWith + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. * @example * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] */ - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); /** - * Checks if `object` conforms to `source` by invoking the predicate - * properties of `source` with the corresponding property values of `object`. - * - * **Note:** This method is equivalent to `_.conforms` when `source` is - * partially applied. + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). * * @static * @memberOf _ - * @since 4.14.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. * @example * - * var object = { 'a': 1, 'b': 2 }; - * - * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); - * // => true + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * - * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); - * // => false + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); - } + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); /** - * Performs a + * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. * @example * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true + * _.uniq([2, 1, 2]); + * // => [2, 1] */ - function eq(value, other) { - return value === other || (value !== value && other !== other); + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; } /** - * Checks if `value` is greater than `other`. + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - * @see _.lt + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. * @example * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] * - * _.gt(1, 3); - * // => false + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] */ - var gt = createRelationalOperation(baseGt); + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } /** - * Checks if `value` is greater than or equal to `other`. + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). * * @static * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to - * `other`, else `false`. - * @see _.lte + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. * @example * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * - * _.gte(1, 3); - * // => false + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } /** - * Checks if `value` is likely an `arguments` object. + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. * @example * - * _.isArguments(function() { return arguments; }()); - * // => true + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] * - * _.isArguments([1, 2, 3]); - * // => false + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } /** - * Checks if `value` is classified as an `Array` object. + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. * @example * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] * - * _.isArray(_.noop); - * // => false + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] */ - var isArray = Array.isArray; + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } /** - * Checks if `value` is classified as an `ArrayBuffer` object. + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor * @example * - * _.isArrayBuffer(new ArrayBuffer(2)); - * // => true - * - * _.isArrayBuffer(new Array(2)); - * // => false + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] */ - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without * @example * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false + * _.xor([2, 1], [2, 3]); + * // => [1, 3] */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). * * @static * @memberOf _ * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. * @example * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] * - * _.isArrayLikeObject(_.noop); - * // => false + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); /** - * Checks if `value` is classified as a boolean primitive or object. + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. * @example * - * _.isBoolean(false); - * // => true + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * - * _.isBoolean(null); - * // => false + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); - } + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); /** - * Checks if `value` is a buffer. + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. * * @static * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. * @example * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] */ - var isBuffer = nativeIsBuffer || stubFalse; + var zip = baseRest(unzip); /** - * Checks if `value` is classified as a `Date` object. + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. * @example * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } */ - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } /** - * Checks if `value` is likely a DOM element. + * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. * @example * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ - function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); } /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. * @example * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. * @example * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; * - * object === other; - * // => false + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' */ - function isEqual(value, other) { - return baseIsEqual(value, other); + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; } /** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. * @example * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + function tap(value, interceptor) { + interceptor(value); + return value; } /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. * @example * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] */ - function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + function thru(value, interceptor) { + return interceptor(value); } /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * This method is the wrapper version of `_.at`. * - * @static + * @name at * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. * @example * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * - * _.isFinite('3'); - * // => false + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); /** - * Checks if `value` is classified as a `Function` object. + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * - * @static + * @name chain * @memberOf _ * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. * @example * - * _.isFunction(_); - * // => true + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; * - * _.isFunction(/abc/); - * // => false + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + function wrapperChain() { + return chain(this); } /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * Executes the chain sequence and returns the wrapped result. * - * @static + * @name commit * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. * @example * - * _.isInteger(3); - * // => true + * var array = [1, 2]; + * var wrapped = _(array).push(3); * - * _.isInteger(Number.MIN_VALUE); - * // => false + * console.log(array); + * // => [1, 2] * - * _.isInteger(Infinity); - * // => false + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] * - * _.isInteger('3'); - * // => false + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); } /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * - * @static + * @name next * @memberOf _ * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @category Seq + * @returns {Object} Returns the next iterator value. * @example * - * _.isLength(3); - * // => true + * var wrapped = _([1, 2]); * - * _.isLength(Number.MIN_VALUE); - * // => false + * wrapped.next(); + * // => { 'done': false, 'value': 1 } * - * _.isLength(Infinity); - * // => false + * wrapped.next(); + * // => { 'done': false, 'value': 2 } * - * _.isLength('3'); - * // => false + * wrapped.next(); + * // => { 'done': true, 'value': undefined } */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; } /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * Enables the wrapper to be iterable. * - * @static + * @name Symbol.iterator * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. * @example * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true + * var wrapped = _([1, 2]); * - * _.isObject(_.noop); + * wrapped[Symbol.iterator]() === wrapped; * // => true * - * _.isObject(null); - * // => false + * Array.from(wrapped); + * // => [1, 2] */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); + function wrapperToIterator() { + return this; } /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * Creates a clone of the chain sequence planting `value` as the wrapped value. * - * @static + * @name plant * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. * @example * - * _.isObjectLike({}); - * // => true + * function square(n) { + * return n * n; + * } * - * _.isObjectLike([1, 2, 3]); - * // => true + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); * - * _.isObjectLike(_.noop); - * // => false + * other.value(); + * // => [9, 16] * - * _.isObjectLike(null); - * // => false + * wrapped.value(); + * // => [1, 4] */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; } /** - * Checks if `value` is classified as a `Map` object. + * This method is the wrapper version of `_.reverse`. * - * @static + * **Note:** This method mutates the wrapped array. + * + * @name reverse * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. * @example * - * _.isMap(new Map); - * // => true + * var array = [1, 2, 3]; * - * _.isMap(new WeakMap); - * // => false + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] */ - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } /** - * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. + * Executes the chain sequence to resolve the unwrapped value. * - * **Note:** This method is equivalent to `_.matches` when `source` is - * partially applied. + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). * * @static * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. * @example * - * var object = { 'a': 1, 'b': 2 }; - * - * _.isMatch(object, { 'b': 2 }); - * // => true + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } * - * _.isMatch(object, { 'b': 1 }); - * // => false + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. * @example * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } + * _.every([true, 1, null, 'yes'], Boolean); + * // => false * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false * - * _.isMatchWith(object, source, customizer); + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); } /** - * Checks if `value` is `NaN`. + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. + * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject * @example * - * _.isNaN(NaN); - * // => true + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; * - * _.isNaN(new Number(NaN)); - * // => true + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] * - * isNaN(undefined); - * // => true + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] * - * _.isNaN(undefined); - * // => false + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); } /** - * Checks if `value` is a pristine native function. - * - * **Note:** This method can't reliably detect native functions in the presence - * of the core-js package because core-js circumvents this kind of detection. - * Despite multiple requests, the core-js maintainer has made it clear: any - * attempt to fix the detection will be obstructed. As a result, we're left - * with little choice but to throw an error. Unfortunately, this also affects - * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on core-js. + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. * @example * - * _.isNative(Array.prototype.push); - * // => true + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; * - * _.isNative(_); - * // => false + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' */ - function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } + var find = createFind(findIndex); /** - * Checks if `value` is `null`. + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. * @example * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 */ - function isNull(value) { - return value === null; - } + var findLast = createFind(findLastIndex); /** - * Checks if `value` is `null` or `undefined`. + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. * @example * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true + * function duplicate(n) { + * return [n, n]; + * } * - * _.isNil(NaN); - * // => false + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] */ - function isNil(value) { - return value == null; + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); } /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. * * @static * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. * @example * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true + * function duplicate(n) { + * return [[[n, n]]]; + * } * - * _.isNumber('3'); - * // => false + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); } /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. * * @static * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. * @example * - * function Foo() { - * this.a = 1; + * function duplicate(n) { + * return [[[n, n]]]; * } * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); } /** - * Checks if `value` is classified as a `RegExp` object. + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight * @example * - * _.isRegExp(/abc/); - * // => true + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. * - * _.isRegExp('/abc/'); - * // => false + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on - * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach * @example * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); } /** - * Checks if `value` is classified as a `Set` object. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. * @example * - * _.isSet(new Set); - * // => true + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } * - * _.isSet(new WeakSet); - * // => false + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } */ - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); /** - * Checks if `value` is classified as a `String` primitive or object. + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. * * @static - * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * - * _.isString('abc'); + * _.includes([1, 2, 3], 1); * // => true * - * _.isString(1); + * _.includes([1, 2, 3], 1, 2); * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** - * Checks if `value` is classified as a `Symbol` primitive or object. + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. * @example * - * _.isSymbol(Symbol.iterator); - * // => true + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] * - * _.isSymbol('abc'); - * // => false + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); /** - * Checks if `value` is classified as a typed array. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). * * @static * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. * @example * - * _.isTypedArray(new Uint8Array); - * // => true + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; * - * _.isTypedArray([]); - * // => false + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); /** - * Checks if `value` is `undefined`. + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static - * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. * @example * - * _.isUndefined(void 0); - * // => true + * function square(n) { + * return n * n; + * } * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is classified as a `WeakMap` object. + * _.map([4, 8], square); + * // => [16, 64] * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. - * @example + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) * - * _.isWeakMap(new WeakMap); - * // => true + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; * - * _.isWeakMap(new Map); - * // => false + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] */ - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); } /** - * Checks if `value` is classified as a `WeakSet` object. + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. * @example * - * _.isWeakSet(new WeakSet); - * // => true + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; * - * _.isWeakSet(new Set); - * // => false + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); } /** - * Checks if `value` is less than `other`. + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). * * @static * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - * @see _.gt + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. * @example * - * _.lt(1, 3); - * // => true + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; * - * _.lt(3, 3); - * // => false + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] * - * _.lt(3, 1); - * // => false + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] */ - var lt = createRelationalOperation(baseLt); + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); /** - * Checks if `value` is less than or equal to `other`. + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` * * @static * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to - * `other`, else `false`. - * @see _.gte + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight * @example * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 * - * _.lte(3, 1); - * // => false + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } /** - * Converts `value` to an array. + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. * * @static - * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce * @example * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] + * var array = [[0, 1], [2, 3], [4, 5]]; * - * _.toArray(null); - * // => [] + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; - return func(value); + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** - * Converts `value` to a finite number. + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. * * @static * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter * @example * - * _.toFinite(3.2); - * // => 3.2 + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] * - * _.toFinite('3.2'); - * // => 3.2 + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); } /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * Gets a random element from `collection`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. * @example * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 + * _.sample([1, 2, 3, 4]); + * // => 2 */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); } /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. * @example * - * _.toLength(3.2); - * // => 3 + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] * - * _.toLength(Number.MIN_VALUE); - * // => 0 + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * - * _.toLength(Infinity); - * // => 4294967295 + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example * - * _.toLength('3.2'); - * // => 3 + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); } /** - * Converts `value` to a number. + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. * @example * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 + * _.size([1, 2, 3]); + * // => 3 * - * _.toNumber(Infinity); - * // => Infinity + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 * - * _.toNumber('3.2'); - * // => 3.2 + * _.size('pebbles'); + * // => 7 */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; + function size(collection) { + if (collection == null) { + return 0; } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; } - if (typeof value != 'string') { - return value === 0 ? value : +value; + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; } - value = baseTrim(value); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); + return baseKeys(collection).length; } /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. * @example * - * function Foo() { - * this.b = 2; - * } + * _.some([null, 0, 'yes', false], Boolean); + * // => true * - * Foo.prototype.c = 3; + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); } /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. * @example * - * _.toSafeInteger(3.2); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * - * _.toSafeInteger('3.2'); - * // => 3 + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ - function toSafeInteger(value) { - return value - ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : (value === 0 ? value : 0); - } + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. * @example * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. */ - function toString(value) { - return value == null ? '' : baseToString(value); - } + var now = ctxNow || function() { + return root.Date.now(); + }; /*------------------------------------------------------------------------*/ /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. * * @static * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. * @example * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } + * var saves = ['profile', 'settings']; * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. */ - var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); } - } - }); + }; + } /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. * * @static * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. * @example * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } /** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. * - * **Note:** This method mutates `object`. + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. * * @static * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. * @example * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; * } * - * var defaults = _.partialRight(_.assignInWith, customizer); + * var object = { 'user': 'fred' }; * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); }); /** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. * - * **Note:** This method mutates `object`. + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. * @example * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; * - * var defaults = _.partialRight(_.assignWith, customizer); + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); }); /** - * Creates an array of values corresponding to `paths` of `object`. + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. * @example * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] */ - var at = flatRest(baseAt); + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. * @example * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; * - * function Circle() { - * Shape.call(this); - * } + * var curried = _.curryRight(abc); * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); + * curried(3)(2)(1); + * // => [1, 2, 3] * - * var circle = new Circle; - * circle instanceof Circle; - * // => true + * curried(2, 3)(1); + * // => [1, 2, 3] * - * circle instanceof Shape; - * // => true + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; } /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. * - * **Note:** This method mutates `object`. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. * @example * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); */ - var defaults = baseRest(function(object, sources) { - object = Object(object); + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; } - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); } - return object; - }); + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ - * @since 3.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaults + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. * @example * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. */ - var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); }); /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. * * @static * @memberOf _ - * @since 1.1.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. * @example * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. */ - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. + * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. * @example * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] */ - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); } /** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forInRight + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ - function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn - * @example + * values(other); + * // => [3, 4] * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * object.a = 2; + * values(object); + * // => [1, 2] * - * Foo.prototype.c = 3; + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; */ - function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, getIteratee(iteratee, 3), keysIn); + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; } + // Expose `MapCache`. + memoize.Cache = MapCache; + /** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; + * function isEven(n) { + * return n % 2 == 0; * } * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee, 3)); + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; } /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + function once(func) { + return before(2, func); } /** - * Creates an array of function property names from own enumerable properties - * of `object`. + * Creates a function that invokes `func` with its arguments transformed. * * @static - * @since 0.1.0 + * @since 4.0.0 * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. * @example * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); + * function doubled(n) { + * return n * 2; * } * - * Foo.prototype.c = _.constant('c'); + * function square(n) { + * return n * n; + * } * - * _.functions(new Foo); - * // => ['a', 'b'] + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. * * @static * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. * @example * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); + * function greet(greeting, name) { + * return greeting + ' ' + name; * } * - * Foo.prototype.c = _.constant('c'); + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. * * @static * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. * @example * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); /** - * Checks if `path` is a direct property of `object`. + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. * @example * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); * - * _.has(other, 'a'); - * // => false + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] */ - function has(object, path) { - return object != null && hasPath(object, path, baseHas); - } + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); /** - * Checks if `path` is a direct or inherited property of `object`. + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. * @example * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); * - * _.hasIn(object, 'b'); - * // => false + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); } /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. * @example * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 */ - var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); - result[value] = key; - }, constant(identity)); + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. * @example * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); */ - var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } + function throttle(func, wait, options) { + var leading = true, + trailing = true; - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } - }, getIteratee); + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } /** - * Invokes the method at `path` of `object`. + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. * * @static * @memberOf _ * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. * @example * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] */ - var invoke = baseRest(baseInvoke); + function unary(func) { + return ary(func, 1); + } /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); * - * _.keys('hi'); - * // => ['0', '1'] + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); } + /*------------------------------------------------------------------------*/ + /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. + * Casts `value` as an array if it's not one. * * @static * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] * - * Foo.prototype.c = 3; + * _.castArray(undefined); + * // => [undefined] * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; } /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * string keyed property of `object` thru `iteratee`. The iteratee is invoked - * with three arguments: (value, key, object). + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ - * @since 3.8.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapValues + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep * @example * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); } /** - * Creates an object with the same keys as `object` and values generated - * by running each own enumerable string keyed property of `object` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, key, object). + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ - * @since 2.4.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapKeys + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith * @example * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * var el = _.cloneWith(document.body, customizer); * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. + * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone * @example * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; + * var objects = [{ 'a': 1 }, { 'b': 2 }]; * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined`, merging is handled by the - * method instead. The `customizer` is invoked with six arguments: - * (objValue, srcValue, key, object, source, stack). - * - * **Note:** This method mutates `object`. + * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith * @example * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); * } * } * - * var object = { 'a': [1], 'b': [2] }; - * var other = { 'a': [3], 'b': [4] }; + * var el = _.cloneDeepWith(document.body, customizer); * - * _.mergeWith(object, other, customizer); - * // => { 'a': [1, 3], 'b': [2, 4] } + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. * - * **Note:** This method is considerably slower than `_.pick`. + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * var object = { 'a': 1, 'b': 2 }; * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; - }); + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } /** - * The opposite of `_.pickBy`; this method creates an object composed of - * the own and inherited enumerable string keyed properties of `object` that - * `predicate` doesn't return truthy for. The predicate is invoked with two - * arguments: (value, key). + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true */ - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); + function eq(value, other) { + return value === other || (value !== value && other !== other); } /** - * Creates an object composed of the picked `object` properties. + * Checks if `value` is greater than `other`. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * _.gt(3, 1); + * // => true * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); + var gt = createRelationalOperation(baseGt); /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). + * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * _.gte(3, 1); + * // => true * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false */ - function pickBy(object, predicate) { - if (object == null) { - return {}; - } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; - }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); - }); - } + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. + * Checks if `value` is likely an `arguments` object. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. * @example * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' + * _.isArguments(function() { return arguments; }()); + * // => true * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' + * _.isArguments([1, 2, 3]); + * // => false */ - function result(object, path, defaultValue) { - path = castPath(path, object); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. + * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * _.isArray([1, 2, 3]); + * // => true * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 + * _.isArray(document.body.children); + * // => false * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } + var isArray = Array.isArray; /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. + * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * - * var object = {}; + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true * - * _.setWith(object, '[0][1]', 'a', Object); - * // => { '0': { '1': 'a' } } + * _.isArrayBuffer(new Array(2)); + * // => false */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); - } + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** - * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. If `object` is a map or set, its - * entries are returned. + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 - * @alias entries - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * _.isArrayLike([1, 2, 3]); + * // => true * - * Foo.prototype.c = 3; + * _.isArrayLike(document.body.children); + * // => true * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false */ - var toPairs = createToPairs(keys); - - /** - * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. If `object` is a map - * or set, its entries are returned. + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. * * @static * @memberOf _ * @since 4.0.0 - * @alias entriesIn - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * _.isArrayLikeObject([1, 2, 3]); + * // => true * - * Foo.prototype.c = 3; + * _.isArrayLikeObject(document.body.children); + * // => true * - * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false */ - var toPairsIn = createToPairs(keysIn); + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. + * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] + * _.isBoolean(false); + * // => true * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } + * _.isBoolean(null); + * // => false */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); - - iteratee = getIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); } /** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. + * Checks if `value` is a buffer. * * @static * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, ['a', '0', 'b', 'c']); + * _.isBuffer(new Buffer(2)); * // => true * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; + * _.isBuffer(new Uint8Array(2)); + * // => false */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } + var isBuffer = nativeIsBuffer || stubFalse; /** - * This method is like `_.set` except that accepts `updater` to produce the - * value to set. Use `_.updateWith` to customize `path` creation. The `updater` - * is invoked with one argument: (value). - * - * **Note:** This method mutates `object`. + * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @returns {Object} Returns `object`. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.update(object, 'a[0].b.c', function(n) { return n * n; }); - * console.log(object.a[0].b.c); - * // => 9 + * _.isDate(new Date); + * // => true * - * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); - * console.log(object.x[0].y.z); - * // => 0 + * _.isDate('Mon April 23 2012'); + * // => false */ - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. + * Checks if `value` is likely a DOM element. * * @static * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * - * var object = {}; + * _.isElement(document.body); + * // => true * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } + * _.isElement(''); + * // => false */ - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** - * Creates an array of the own enumerable string keyed property values of `object`. + * Checks if `value` is an empty object, collection, map, or set. * - * **Note:** Non-object values are coerced to objects. + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * _.isEmpty(null); + * // => true * - * Foo.prototype.c = 3; + * _.isEmpty(true); + * // => true * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) + * _.isEmpty(1); + * // => true * - * _.values('hi'); - * // => ['h', 'i'] + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; } /** - * Creates an array of the own and inherited enumerable string keyed property - * values of `object`. + * Performs a deep comparison between two values to determine if they are + * equivalent. * - * **Note:** Non-object values are coerced to objects. + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * - * Foo.prototype.c = 3; + * _.isEqual(object, other); + * // => true * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) + * object === other; + * // => false */ - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); + function isEqual(value, other) { + return baseIsEqual(value, other); } - /*------------------------------------------------------------------------*/ - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * _.clamp(-10, -5, 5); - * // => -5 + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } * - * _.clamp(10, -5, 5); - * // => 5 + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true */ - function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); + * _.isError(new Error); * // => true * - * _.inRange(5.2, 4); + * _.isError(Error); * // => false - * - * _.inRange(-3, -2, -6); - * // => true */ - function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); + function isError(value) { + if (!isObjectLike(value)) { + return false; } - number = toNumber(number); - return baseInRange(number, start, end); + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are - * floats, a floating-point number is returned instead of an integer. + * Checks if `value` is a finite primitive number. * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ - * @since 0.7.0 - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * - * _.random(0, 5); - * // => an integer between 0 and 5 + * _.isFinite(3); + * // => true * - * _.random(5); - * // => also an integer between 0 and 5 + * _.isFinite(Number.MIN_VALUE); + * // => true * - * _.random(5, true); - * // => a floating-point number between 0 and 5 + * _.isFinite(Infinity); + * // => false * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 + * _.isFinite('3'); + * // => false */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); } - /*------------------------------------------------------------------------*/ - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' + * _.isFunction(_); + * // => true * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' + * _.isFunction(/abc/); + * // => false */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * - * _.capitalize('FRED'); - * // => 'Fred' + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); } /** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * - * _.deburr('déjà vu'); - * // => 'deja vu' + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** - * Checks if `string` ends with the given target string. + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search up to. - * @returns {boolean} Returns `true` if `string` ends with `target`, - * else `false`. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * - * _.endsWith('abc', 'c'); + * _.isObject({}); * // => true * - * _.endsWith('abc', 'b'); - * // => false + * _.isObject([1, 2, 3]); + * // => true * - * _.endsWith('abc', 'b', 2); + * _.isObject(_.noop); * // => true + * + * _.isObject(null); + * // => false */ - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); } /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". * * @static - * @since 0.1.0 * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; + function isObjectLike(value) { + return value != null && typeof value == 'object'; } /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** - * Converts `string` to - * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' + * var object = { 'a': 1, 'b': 2 }; * - * _.kebabCase('fooBar'); - * // => 'foo-bar' + * _.isMatch(object, { 'b': 2 }); + * // => true * - * _.kebabCase('__FOO_BAR__'); - * // => 'foo-bar' + * _.isMatch(object, { 'b': 1 }); + * // => false */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } /** - * Converts `string`, as space separated words, to lower case. + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the lower cased string. + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * - * _.lowerCase('--Foo-Bar--'); - * // => 'foo bar' + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } * - * _.lowerCase('fooBar'); - * // => 'foo bar' + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } * - * _.lowerCase('__FOO_BAR__'); - * // => 'foo bar' + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } /** - * Converts the first character of `string` to lower case. + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. * * @static * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * - * _.lowerFirst('Fred'); - * // => 'fred' + * _.isNaN(NaN); + * // => true * - * _.lowerFirst('FRED'); - * // => 'fRED' + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false */ - var lowerFirst = createCaseFirst('toLowerCase'); + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. * @example * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' + * _.isNative(Array.prototype.push); + * // => true * - * _.pad('abc', 3); - * // => 'abc' + * _.isNative(_); + * // => false */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); + return baseIsNative(value); } /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. + * Checks if `value` is `null`. * * @static * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' + * _.isNull(null); + * // => true * - * _.padEnd('abc', 3); - * // => 'abc' + * _.isNull(void 0); + * // => false */ - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; + function isNull(value) { + return value === null; } /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. + * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * - * _.padStart('abc', 6); - * // => ' abc' + * _.isNil(null); + * // => true * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' + * _.isNil(void 0); + * // => true * - * _.padStart('abc', 3); - * // => 'abc' + * _.isNil(NaN); + * // => false */ - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; + function isNil(value) { + return value == null; } /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a - * hexadecimal, in which case a `radix` of `16` is used. + * Checks if `value` is classified as a `Number` primitive or object. * - * **Note:** This method aligns with the - * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ - * @since 1.1.0 - * @category String - * @param {string} string The string to convert. - * @param {number} [radix=10] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {number} Returns the converted integer. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * - * _.parseInt('08'); - * // => 8 + * _.isNumber(3); + * // => true * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false */ - function parseInt(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); } /** - * Repeats the given string `n` times. + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=1] The number of times to repeat the string. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the repeated string. + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' + * function Foo() { + * this.a = 1; + * } * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n, guard) { - if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - return baseRepeat(toString(string), n); - } - - /** - * Replaces matches for `pattern` in `string` with `replacement`. + * _.isPlainObject(new Foo); + * // => false * - * **Note:** This method is based on - * [`String#replace`](https://mdn.io/String/replace). + * _.isPlainObject([1, 2, 3]); + * // => false * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' + * _.isPlainObject(Object.create(null)); + * // => true */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; } /** - * Converts `string` to - * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' + * _.isRegExp(/abc/); + * // => true * - * _.snakeCase('--FOO-BAR--'); - * // => 'foo_bar' + * _.isRegExp('/abc/'); + * // => false */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** - * Splits `string` by `separator`. + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on - * [`String#split`](https://mdn.io/String/split). + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to split. - * @param {RegExp|string} separator The separator pattern to split by. - * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the string segments. + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * - * _.split('a-b-c', '-', 2); - * // => ['a', 'b'] + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false */ - function split(string, separator, limit) { - if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined; - } - limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); - } - } - return string.split(separator, limit); + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** - * Converts `string` to - * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ - * @since 3.1.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * - * _.startCase('--foo-bar--'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' + * _.isSet(new Set); + * // => true * - * _.startCase('__FOO_BAR__'); - * // => 'FOO BAR' + * _.isSet(new WeakSet); + * // => false */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + upperFirst(word); - }); + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** - * Checks if `string` starts with the given target string. + * Checks if `value` is classified as a `String` primitive or object. * * @static + * @since 0.1.0 * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, - * else `false`. + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * - * _.startsWith('abc', 'a'); + * _.isString('abc'); * // => true * - * _.startsWith('abc', 'b'); + * _.isString(1); * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true */ - function startsWith(string, target, position) { - string = toString(string); - position = position == null - ? 0 - : baseClamp(toInteger(position), 0, string.length); - - target = baseToString(target); - return string.slice(position, position + target.length) == target; + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is given, it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * Checks if `value` is classified as a `Symbol` primitive or object. * * @static - * @since 0.1.0 * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options={}] The options object. - * @param {RegExp} [options.escape=_.templateSettings.escape] - * The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] - * The "evaluate" delimiter. - * @param {Object} [options.imports=_.templateSettings.imports] - * An object to import into the template as free variables. - * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] - * The "interpolate" delimiter. - * @param {string} [options.sourceURL='lodash.templateSources[n]'] - * The sourceURL of the compiled template. - * @param {string} [options.variable='obj'] - * The data object variable name. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the compiled template function. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * - * // Use the "interpolate" delimiter to create a compiled template. - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // Use the HTML "escape" delimiter to escape data property values. - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': '