diff --git a/.github/workflows/check-dist.yaml b/.github/workflows/check-dist.yaml new file mode 100644 index 0000000..c952291 --- /dev/null +++ b/.github/workflows/check-dist.yaml @@ -0,0 +1,17 @@ +name: Check dist/ + +on: + push: + branches: + - main + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' + workflow_dispatch: + +jobs: + call-check-dist: + name: Check dist/ + uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml new file mode 100644 index 0000000..fe42877 --- /dev/null +++ b/.github/workflows/linter.yaml @@ -0,0 +1,30 @@ +name: Linter + +on: + pull_request: + push: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + linter: + name: Linter + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4.0.0 + + - name: Setup Node.js + uses: actions/setup-node@v3.8.1 + with: + node-version-file: .nvmrc + cache: npm + + - name: Install dependencies + run: npm ci --ignore-scripts + + - name: Check code style + run: npm run lint diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..4f2d164 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + branches: [ main ] + tags: [ 'v*.*.*' ] + pull_request: + types: [ labeled ] + +jobs: + release: + name: Create Release + if: github.event.action != 'labeled' + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout Code + uses: actions/checkout@v4.0.0 + + - name: Bump version + if: "!startsWith(github.ref, 'refs/tags/')" + id: bumpr + uses: haya14busa/action-bumpr@v1 + + - name: Update tag + if: "!steps.bumpr.outputs.skip" + uses: haya14busa/action-update-semver@v1 + with: + tag: ${{ steps.bumpr.outputs.next_version }} + + - name: Get tag name + id: tag + uses: haya14busa/action-cond@v1 + with: + cond: "${{ startsWith(github.ref, 'refs/tags/') }}" + if_true: "${{ github.ref }}" + if_false: "${{ steps.bumpr.outputs.next_version }}" + + - name: Setup Node.js + uses: actions/setup-node@v3.8.1 + with: + node-version-file: .nvmrc + cache: npm + + - name: Install dependencies + run: npm ci --ignore-scripts + + - name: Build prod assets + if: "steps.tag.outputs.value != ''" + run: npm run build + + - name: Create release + uses: softprops/action-gh-release@v0.1.15 + if: "steps.tag.outputs.value != ''" + with: + name: Release ${{ steps.tag.outputs.value }} + body: ${{ steps.bumpr.outputs.message }} + tag_name: ${{ steps.tag.outputs.value }} + + release-check: + if: github.event.action == 'labeled' + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4.0.0 + + - name: Post bumpr status comment + uses: haya14busa/action-bumpr@v1 diff --git a/.github/workflows/sync-templates.yaml b/.github/workflows/sync-templates.yaml new file mode 100644 index 0000000..03de067 --- /dev/null +++ b/.github/workflows/sync-templates.yaml @@ -0,0 +1,20 @@ +name: Sync labels + +on: + workflow_dispatch: + schedule: + - cron: "0 0 1 * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + sync-labels: + name: Sync labels + runs-on: ubuntu-latest + steps: + - name: Sync labels + uses: EndBug/label-sync@v2.3.1 + with: + config-file: https://gist.githubusercontent.com/Ic3w0lf/f5520c5f19d7098966f692c120f7a197/raw/75b134f76fbc55e2e64bd66f04e571d6d74b815e/terraform-aws-module-labels.yaml diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..b1b396b --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.7 diff --git a/README.md b/README.md index aae0d1c..591fd40 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,10 @@ This action is great for executing migrations or other pre/post deployment steps override-container-command: | /bin/sh -c - php artisan migrate --force --ansi && \ - php artisan db:seed --force --ansi && \ - php artisan config:clear --ansi + php artisan migrate --force --ansi && php artisan db:seed --force --ansi + override-container-environment: | + AWS_REGION=us-east-1 + FOO=baz ``` #### Minimal example @@ -55,6 +56,33 @@ This action is great for executing migrations or other pre/post deployment steps security-group-ids: sg-123456789101112 ``` +#### Appending multiple lines into a single command + +You can use the backslash character `\` to append multiple lines into a single line. This is useful if you have many +commands to execute and want to keep the YAML file readable. Otherwise, each line will be passed to the AWS ECS Fargate +task as a separate argument. + +> **Note:** Make sure to use the `|` character to make sure the YAML parser interprets the value as a multiline string. +> You can read more about this in the [YAML documentation](https://yaml.org/spec/1.2/spec.html#id2794534). + +For example: + +``` yaml +... +override-container-command: | + /bin/sh + -c + php artisan down && \ + php artisan migrate --force --ansi && \ + php artisan db:seed --force --ansi && \ + php artisan cache:clear --ansi +``` + +Will pass the following command to the container on the AWS ECS Fargate task: +``` +["sh", "-c", "php artisan down && php artisan migrate --force --ansi && php artisan db:seed --force --ansi && php artisan cache:clear --ansi"] +``` + ## Inputs diff --git a/action.yml b/action.yml index f9103de..9770d30 100644 --- a/action.yml +++ b/action.yml @@ -40,6 +40,10 @@ inputs: description: >- The command to run on the container if `override-container` is passed. required: false + override-container-environment: + description: >- + Add or override existing environment variables if `override-container` is passed. Provide one per line in key=value format. + required: false tail-logs: description: >- If set to true, will try to extract the logConfiguration for the first container in the task definition. If @@ -57,5 +61,5 @@ outputs: description: 'The log output of the task that was ran, if `tail-logs` was set to true.' runs: - using: 'node16' + using: 'node20' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 6b73fdb..5b1d6d8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -474,7 +474,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__(78974); +const uuid_1 = __nccwpck_require__(75840); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -558,7 +558,7 @@ class OidcClient { .catch(error => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n - Error Message: ${error.result.message}`); + Error Message: ${error.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -994,652 +994,6 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 78974: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -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 }; } - -/***/ }), - -/***/ 5842: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -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(); -} - -var _default = md5; -exports["default"] = _default; - -/***/ }), - -/***/ 32381: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports["default"] = _default; - -/***/ }), - -/***/ 26385: -/***/ ((__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 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; -} - -var _default = parse; -exports["default"] = _default; - -/***/ }), - -/***/ 86230: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -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); -} - -/***/ }), - -/***/ 38844: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -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 }; } - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -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; -} - -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]]; - } - - 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); -} - -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; -} - -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); - } - - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); - } - - 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; - } - - 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; - -/***/ }), - /***/ 35526: /***/ (function(__unused_webpack_module, exports) { @@ -1857,6 +1211,19 @@ class HttpClientResponse { })); }); } + 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)); + }); + })); + }); + } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { @@ -2361,7 +1728,13 @@ function getProxyUrl(reqUrl) { } })(); if (proxyVar) { - return new URL(proxyVar); + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } } else { return undefined; @@ -2904,7 +2277,13 @@ module.exports = { PaymentCryptography: __nccwpck_require__(11594), PaymentCryptographyData: __nccwpck_require__(96559), CodeGuruSecurity: __nccwpck_require__(32620), - VerifiedPermissions: __nccwpck_require__(35604) + 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) }; /***/ }), @@ -3135,6 +2514,32 @@ Object.defineProperty(apiLoader.services['appconfigdata'], '2021-11-11', { 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; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.AppFabric; + + /***/ }), /***/ 60844: @@ -5910,6 +5315,31 @@ Object.defineProperty(apiLoader.services['emrserverless'], '2021-07-13', { module.exports = AWS.EMRServerless; +/***/ }), + +/***/ 22697: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +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', { + get: function get() { + var model = __nccwpck_require__(61033); + model.paginators = (__nccwpck_require__(37403)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.EntityResolution; + + /***/ }), /***/ 84462: @@ -8060,6 +7490,32 @@ Object.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', { module.exports = AWS.ManagedBlockchain; +/***/ }), + +/***/ 51046: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +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', { + get: function get() { + 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.ManagedBlockchainQuery; + + /***/ }), /***/ 2609: @@ -8388,6 +7844,32 @@ Object.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', { module.exports = AWS.MediaTailor; +/***/ }), + +/***/ 79712: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +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', { + get: function get() { + 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.MedicalImaging; + + /***/ }), /***/ 50782: @@ -8715,6 +8197,31 @@ Object.defineProperty(apiLoader.services['neptune'], '2014-10-31', { module.exports = AWS.Neptune; +/***/ }), + +/***/ 25737: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +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', { + get: function get() { + var model = __nccwpck_require__(31008); + model.paginators = (__nccwpck_require__(2363)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.Neptunedata; + + /***/ }), /***/ 84626: @@ -9094,6 +8601,31 @@ Object.defineProperty(apiLoader.services['paymentcryptographydata'], '2022-02-03 module.exports = AWS.PaymentCryptographyData; +/***/ }), + +/***/ 55959: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +__nccwpck_require__(73639); +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', { + get: function get() { + var model = __nccwpck_require__(6901); + model.paginators = (__nccwpck_require__(33158)/* .pagination */ .o); + return model; + }, + enumerable: true, + configurable: true +}); + +module.exports = AWS.PcaConnectorAd; + + /***/ }), /***/ 33696: @@ -9360,6 +8892,7 @@ Object.defineProperty(apiLoader.services['pricing'], '2017-10-15', { get: function get() { var model = __nccwpck_require__(22484); model.paginators = (__nccwpck_require__(60369)/* .pagination */ .o); + model.waiters = (__nccwpck_require__(41996)/* .waiters */ .V); return model; }, enumerable: true, @@ -12830,7 +12363,7 @@ AWS.util.update(AWS, { /** * @constant */ - VERSION: '2.1397.0', + VERSION: '2.1464.0', /** * @api private @@ -15025,6 +14558,7 @@ AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { 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: // @@ -15079,6 +14613,7 @@ AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { }); var roleParams = { + DurationSeconds: durationSeconds, RoleArn: roleArn, RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() }; @@ -19095,13 +18630,14 @@ AWS.NodeHttpClient = AWS.util.inherit({ 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 }); } - AWS.util.update(options, httpOptions); delete options.proxy; // proxy isn't an HTTP option delete options.timeout; // timeout isn't an HTTP option @@ -30014,7 +29550,7 @@ AWS.SSOTokenProvider = AWS.util.inherit(AWS.Token, { ); } else if (!profile['sso_session']) { throw AWS.util.error( - new Error('Profile "' + profileName + '" is missing required property "sso_session".'), + new Error('Profile "' + this.profile + '" is missing required property "sso_session".'), { code: 'SSOTokenProviderFailure' } ); } @@ -30030,12 +29566,12 @@ AWS.SSOTokenProvider = AWS.util.inherit(AWS.Token, { ); } else if (!ssoSession['sso_start_url']) { throw AWS.util.error( - new Error('Sso session "' + profileName + '" is missing required property "sso_start_url".'), + 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 "' + profileName + '" is missing required property "sso_region".'), + new Error('Sso session "' + this.profile + '" is missing required property "sso_region".'), { code: 'SSOTokenProviderFailure' } ); } @@ -31264,7 +30800,7 @@ var util = { */ uuid: { v4: function uuidV4() { - return (__nccwpck_require__(75840).v4)(); + return (__nccwpck_require__(57821).v4)(); } }, @@ -31807,6 +31343,450 @@ module.exports = { }; +/***/ }), + +/***/ 35827: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +var byteToHex = []; + +for (var i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} + +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 + + 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(''); +} + +var _default = bytesToUuid; +exports["default"] = _default; + +/***/ }), + +/***/ 57821: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__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; + } +}); + +var _v = _interopRequireDefault(__nccwpck_require__(67668)); + +var _v2 = _interopRequireDefault(__nccwpck_require__(98573)); + +var _v3 = _interopRequireDefault(__nccwpck_require__(7811)); + +var _v4 = _interopRequireDefault(__nccwpck_require__(46508)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), + +/***/ 93525: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +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(); +} + +var _default = md5; +exports["default"] = _default; + +/***/ }), + +/***/ 49788: +/***/ ((__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 }; } + +function rng() { + return _crypto.default.randomBytes(16); +} + +/***/ }), + +/***/ 7387: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +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; + +/***/ }), + +/***/ 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; + +var _clockseq; // Previous uuid creation time + + +var _lastMSecs = 0; +var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +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 + + if (node == null || clockseq == null) { + var 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]]; + } + + 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. + + + 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) + + var 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` + + 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` + + var 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 (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf ? buf : (0, _bytesToUuid.default)(b); +} + +var _default = v1; +exports["default"] = _default; + +/***/ }), + +/***/ 98573: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(36097)); + +var _md = _interopRequireDefault(__nccwpck_require__(93525)); + +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; + +/***/ }), + +/***/ 36097: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = _default; +exports.URL = exports.DNS = void 0; + +var _bytesToUuid = _interopRequireDefault(__nccwpck_require__(35827)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +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; +} + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + var bytes = new Array(str.length); + + for (var i = 0; i < str.length; i++) { + bytes[i] = str.charCodeAt(i); + } + + return bytes; +} + +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) { + 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 bytes = hashfunc(namespace.concat(value)); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + for (var idx = 0; idx < 16; ++idx) { + buf[off + idx] = bytes[idx]; + } + } + + return buf || (0, _bytesToUuid.default)(bytes); + }; // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} + +/***/ }), + +/***/ 7811: +/***/ ((__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 }; } + +function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof options == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + + options = options || {}; + + var 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) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || (0, _bytesToUuid.default)(rnds); +} + +var _default = v4; +exports["default"] = _default; + +/***/ }), + +/***/ 46508: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(36097)); + +var _sha = _interopRequireDefault(__nccwpck_require__(7387)); + +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; + /***/ }), /***/ 96323: @@ -35734,3343 +35714,3556 @@ return Q; /***/ }), -/***/ 45601: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var cwlog = __nccwpck_require__(57010); - -module.exports = { - CWLogFilter : cwlog.CWLogFilter, - CWLogFilterEventStream : cwlog.CWLogFilterEventStream, - CWLogEventToMessage : cwlog.CWLogEventToMessage -}; +/***/ 72043: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +;(function (sax) { // wrapper for non-node envs + sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } + sax.SAXParser = SAXParser + sax.SAXStream = SAXStream + sax.createStream = createStream -/***/ }), + // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. + // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), + // since that's the earliest that a buffer overrun could occur. This way, checks are + // as rare as required, but as often as necessary to ensure never crossing this bound. + // Furthermore, buffers are only tested at most once per write(), so passing a very + // large string into write() might have undesirable effects, but this is manageable by + // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme + // edge case, result in creating at most one complete copy of the string passed in. + // Set to Infinity to have unlimited buffers. + sax.MAX_BUFFER_LENGTH = 64 * 1024 -/***/ 57010: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var buffers = [ + 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', + 'procInstName', 'procInstBody', 'entity', 'attribName', + 'attribValue', 'cdata', 'script' + ] -var aws = __nccwpck_require__(71786), - util = __nccwpck_require__(73837), - Readable = (__nccwpck_require__(12781).Readable), - Transform = (__nccwpck_require__(12781).Transform), - q = __nccwpck_require__(56172), - isArray = util.isArray, - lib = {}; + sax.EVENTS = [ + 'text', + 'processinginstruction', + 'sgmldeclaration', + 'doctype', + 'comment', + 'opentagstart', + 'attribute', + 'opentag', + 'closetag', + 'opencdata', + 'cdata', + 'closecdata', + 'error', + 'end', + 'ready', + 'script', + 'opennamespace', + 'closenamespace' + ] -/** - * CWLogFilter - * A simple cursor type wrapper for the aws CloudWatchLogs filterLogEvents method. - * - * @class CWLogFilter - * @constructor - * @param {Object} [opts={apiVersion:'2014-03-28',region:'us-east-1'} ] Configuration options - * for the instance. This will be passed to the AWS.CloudWatchLogs constructor. - * See [AWS Javascript SDK documentation](http://docs.aws.amazon.com/AWSJavaScriptSDK/ - * latest/AWS/CloudWatchLogs.html#constructor-property) for full description of - * available settings. - */ + function SAXParser (strict, opt) { + if (!(this instanceof SAXParser)) { + return new SAXParser(strict, opt) + } -function CWLogFilter(opts){ - opts = opts || { }; - opts.apiVersion = '2014-03-28'; - opts.region = opts.region || 'us-east-1'; + var parser = this + clearBuffers(parser) + parser.q = parser.c = '' + parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH + parser.opt = opt || {} + parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags + parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' + parser.tags = [] + parser.closed = parser.closedRoot = parser.sawRoot = false + parser.tag = parser.error = null + parser.strict = !!strict + parser.noscript = !!(strict || parser.opt.noscript) + parser.state = S.BEGIN + parser.strictEntities = parser.opt.strictEntities + parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) + parser.attribList = [] - if (opts.profile) { - aws.config.credentials = new aws.SharedIniFileCredentials(opts); + // namespaces form a prototype chain. + // it always points at the current tag, + // which protos to its parent tag. + if (parser.opt.xmlns) { + parser.ns = Object.create(rootNS) } - this._cwLogs = new aws.CloudWatchLogs(opts); - this._params = null; -} - -/** - * Make initial call to filterLogEvents. - * - * @method open - * @param {Object} params The parameters to pass to the filterLogEvents call. See - * [AWS Documentation](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ - * CloudWatchLogs.html#filterLogEvents-property) for all supported options. - * @return {Promise} A promise that will be resolved with the result of filterLogEvents. - */ -CWLogFilter.prototype.open = function(params) { - var self = this, myParams = null; - self._params = null; - myParams = lib.copyFilterParams(params); - - return q.ninvoke(this._cwLogs,'filterLogEvents',myParams) - .then(function(res){ - self._params = myParams; - self._params.nextToken = res.nextToken; - return res; - }); -}; + // mostly just for error reporting + parser.trackPosition = parser.opt.position !== false + if (parser.trackPosition) { + parser.position = parser.line = parser.column = 0 + } + emit(parser, 'onready') + } -/** - * Calls to next will re-call the aws api, using the params passed to the open method, - * along with the nextToken received on the previous aws response. - * - * @method next - * @return {Promise} A promise that will be resolved with the result of filterLogEvents. - */ -CWLogFilter.prototype.next = function(){ - var self = this; - - if ((!this._params) || (!this._params.nextToken)) { - return q(); + if (!Object.create) { + Object.create = function (o) { + function F () {} + F.prototype = o + var newf = new F() + return newf } - - return q.ninvoke(this._cwLogs,'filterLogEvents',this._params) - .then(function(res){ - if (res.nextToken) { - self._params.nextToken = res.nextToken; - } else { - delete self._params.nextToken; - } - return res; - }); -}; + } -/** - * Detect whether there are subsequent records left on the filter. - * - * @method eof - * @return {boolean} True if there are no more records (last aws response contained no nextToken). - */ -CWLogFilter.prototype.eof = function(){ - return ((!this._params) || (!this._params.nextToken)); + if (!Object.keys) { + Object.keys = function (o) { + var a = [] + for (var i in o) if (o.hasOwnProperty(i)) a.push(i) + return a + } + } -}; + function checkBufferLength (parser) { + var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) + var maxActual = 0 + for (var i = 0, l = buffers.length; i < l; i++) { + var len = parser[buffers[i]].length + if (len > maxAllowed) { + // Text/cdata nodes can get big, and since they're buffered, + // we can get here under normal conditions. + // Avoid issues by emitting the text node now, + // so at least it won't get any bigger. + switch (buffers[i]) { + case 'textNode': + closeText(parser) + break -/** - * CWLogFilterEventStream - * Implements a readable stream for getting CloudWatch Log Events via the filterLogEvents - * API. All standard Readable Streaming methods and events should be supported, however - * the data returned are unencoded Event objects returned by the AWS api. - * - * @class CWLogFilterEventStream - * @constructor - * @param {Object} params Parameters that will be passed to AWS filterLogEvents API call, with - * an additional supported option, "follow". If follow is set to true, the stream - * will remain open and make periodic calls (default is 1 second intervals) to re-using - * the initial filter Parameters to check for additional log data, using the max last - * received event time + 1 as the start time. To override default inteval, use - * "followInterval" with your desired interval (in milliseconds). See [AWS Documentation] - * (http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudWatchLogs.html# - * filterLogEvents-property) for all supported options. - * @param {Object} [opts={apiVersion:'2014-03-28',region:'us-east-1'} ] AWS config options - * for the instance. This will be passed to the AWS.CloudWatchLogs constructor. - * See [AWS Javascript SDK documentation](http://docs.aws.amazon.com/AWSJavaScriptSDK/ - * latest/AWS/CloudWatchLogs.html#constructor-property) for full description of - * available settings. - */ + case 'cdata': + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' + break -function CWLogFilterEventStream(filterParams, cwOpts) { - Readable.call(this, { highWaterMark: 102400, objectMode : true }); - this._cwOpts = cwOpts; - this._filterParams = lib.copyFilterParams(filterParams); - this._follow = !!filterParams.follow; - this._followInterval = filterParams.followInterval || 1000; - this._reading = false; - this._ival = null; - this._closed = false; - var self = this; + case 'script': + emitNode(parser, 'onscript', parser.script) + parser.script = '' + break - this.on('pause',function(){ - if (self._closed) { - self.emit('error',new Error('Unable to pause a closed stream.')); - } else { - self._stopFollow(); - } - }); - - this.on('resume',function(){ - if (self._closed) { - self.emit('error',new Error('Unable to resume a closed stream.')); - } else { - self._startFollow(); + default: + error(parser, 'Max buffer length exceeded: ' + buffers[i]) } - }); -} - -util.inherits(CWLogFilterEventStream, Readable); + } + maxActual = Math.max(maxActual, len) + } + // schedule the next check for the earliest possible buffer overrun. + var m = sax.MAX_BUFFER_LENGTH - maxActual + parser.bufferCheckPosition = m + parser.position + } -/** - * Stops checks for further logs and invalidates the stream. Will emit a 'close' event, - * and 'end' event. After close has been called, the stream is invalid and cannot be - * re-used. - * - * @method close - */ -CWLogFilterEventStream.prototype.close = function(){ - this._closed = true; - this._stopFollow(); - this.push(null); - this.emit('close'); -}; + function clearBuffers (parser) { + for (var i = 0, l = buffers.length; i < l; i++) { + parser[buffers[i]] = '' + } + } -/* Stream API */ -CWLogFilterEventStream.prototype._read = function(){ - if (this._closed) { - this.emit('error',new Error('Unable to read a closed stream.')); - } else { - this._startFollow(); + function flushBuffers (parser) { + closeText(parser) + if (parser.cdata !== '') { + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' } -}; + if (parser.script !== '') { + emitNode(parser, 'onscript', parser.script) + parser.script = '' + } + } + + SAXParser.prototype = { + end: function () { end(this) }, + write: write, + resume: function () { this.error = null; return this }, + close: function () { return this.write(null) }, + flush: function () { flushBuffers(this) } + } -CWLogFilterEventStream.prototype._startFollow = function(){ - var self = this; - if ((self._follow) && (!self._ival) && (!self._closed)) { - self._ival = setInterval(function(){ - self._readFilter(); - },self._followInterval); - } - this._readFilter(); -}; + var Stream + try { + Stream = (__nccwpck_require__(12781).Stream) + } catch (ex) { + Stream = function () {} + } -CWLogFilterEventStream.prototype._stopFollow = function(){ - if (this._ival) { - clearInterval(this._ival); - this._ival = null; - } -}; + var streamWraps = sax.EVENTS.filter(function (ev) { + return ev !== 'error' && ev !== 'end' + }) -CWLogFilterEventStream.prototype._readFilter = function() { - if (this._reading) { - return q(); + function createStream (strict, opt) { + return new SAXStream(strict, opt) + } + + function SAXStream (strict, opt) { + if (!(this instanceof SAXStream)) { + return new SAXStream(strict, opt) } - var self = this, filter = lib.createCWLogFilter(this._cwOpts), lastTimestamp = 0; + Stream.apply(this) - function iterateFilter(res){ - var idx, eventCount, data; - if (!res || !res.events) { - return filter; - } - eventCount = res.events.length; - for (idx = 0; idx < eventCount; idx++) { - data = res.events[idx]; - lastTimestamp = Math.max(lastTimestamp,data.timestamp); - if (!self.push(data)){ - return filter; - } - } + this._parser = new SAXParser(strict, opt) + this.writable = true + this.readable = true - if (filter.eof()){ - return filter; - } + var me = this - return filter.next().then(iterateFilter); + this._parser.onend = function () { + me.emit('end') } - this._reading = true; - return filter.open(this._filterParams) - .then(iterateFilter) - .then(function(){ - if (!self._follow) { - self.close(); - } else { - if (lastTimestamp > (self._filterParams.startTime || 0 )) { - self._filterParams.startTime = lastTimestamp + 1; - } - } - - self._reading = false; - }) - .catch(function(err){ - self.emit('error',err); - self._reading = false; - }); -}; + this._parser.onerror = function (er) { + me.emit('error', er) -/** - * CWLogEventToMessage - * Transforms CWFilterEventStream log event objects into strings. - * - * @class CWLogEventToMessage - * @constructor - * @param {Object} opts Options for how to format the results. - * opts.crunchTabs - If true, will convert tabs to spaces. - */ -function CWLogEventToMessage(opts){ - if (opts && opts.crunchTabs) { - this._crunchTabs = true; + // if didn't throw, then means error was handled. + // go ahead and clear error, so we can write again. + me._parser.error = null } - Transform.call(this, { objectMode : true }); -} -util.inherits(CWLogEventToMessage, Transform); + this._decoder = null -CWLogEventToMessage.prototype._transform = function(chunk, encoding, done) { - if ((chunk.message === undefined) || (chunk.timestamp === undefined)){ - return done(); + streamWraps.forEach(function (ev) { + Object.defineProperty(me, 'on' + ev, { + get: function () { + return me._parser['on' + ev] + }, + set: function (h) { + if (!h) { + me.removeAllListeners(ev) + me._parser['on' + ev] = h + return h + } + me.on(ev, h) + }, + enumerable: true, + configurable: false + }) + }) + } + + SAXStream.prototype = Object.create(Stream.prototype, { + constructor: { + value: SAXStream } + }) - var message = chunk.message; - if (this._crunchTabs) { - message = chunk.message.replace(/\t/,' '); + SAXStream.prototype.write = function (data) { + if (typeof Buffer === 'function' && + typeof Buffer.isBuffer === 'function' && + Buffer.isBuffer(data)) { + if (!this._decoder) { + var SD = (__nccwpck_require__(71576).StringDecoder) + this._decoder = new SD('utf8') + } + data = this._decoder.write(data) } - if (message.charAt(message.length - 1) !== '\n') { - message += '\n'; + this._parser.write(data.toString()) + this.emit('data', data) + return true + } + + SAXStream.prototype.end = function (chunk) { + if (chunk && chunk.length) { + this.write(chunk) } + this._parser.end() + return true + } - if (message.match(/^\d\d\d\d-\d\d-\d\d\D/)){ - this.push(message); - } else { - this.push((new Date(chunk.timestamp)).toISOString() + ' ' + message); + SAXStream.prototype.on = function (ev, handler) { + var me = this + if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { + me._parser['on' + ev] = function () { + var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) + args.splice(0, 0, ev) + me.emit.apply(me, args) + } } - done(); -}; -/****************************** - * Utils - */ + return Stream.prototype.on.call(me, ev, handler) + } + + // character classes and tokens + var whitespace = '\r\n\t ' + + // this really needs to be replaced with character classes. + // XML allows all manner of ridiculous numbers and digits. + var number = '0124356789' + var letter = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + + // (Letter | "_" | ":") + var quote = '\'"' + var attribEnd = whitespace + '>' + var CDATA = '[CDATA[' + var DOCTYPE = 'DOCTYPE' + var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' + var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' + var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } + + // turn all the string character sets into character class objects. + whitespace = charClass(whitespace) + number = charClass(number) + letter = charClass(letter) + + // http://www.w3.org/TR/REC-xml/#NT-NameStartChar + // This implementation works on strings, a single character at a time + // as such, it cannot ever support astral-plane characters (10000-EFFFF) + // without a significant breaking change to either this parser, or the + // JavaScript language. Implementation of an emoji-capable xml parser + // is left as an exercise for the reader. + var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + + var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/ + + var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/ + + quote = charClass(quote) + attribEnd = charClass(attribEnd) + + function charClass (str) { + return str.split('').reduce(function (s, c) { + s[c] = true + return s + }, {}) + } + + function isRegExp (c) { + return Object.prototype.toString.call(c) === '[object RegExp]' + } + + function is (charclass, c) { + return isRegExp(charclass) ? !!c.match(charclass) : charclass[c] + } + + function not (charclass, c) { + return !is(charclass, c) + } + + var S = 0 + sax.STATE = { + BEGIN: S++, // leading byte order mark or whitespace + BEGIN_WHITESPACE: S++, // leading whitespace + TEXT: S++, // general stuff + TEXT_ENTITY: S++, // & and such. + OPEN_WAKA: S++, // < + SGML_DECL: S++, // + SCRIPT: S++, //