Bump @actions/core from 1.6.0 to 1.9.1 (#133)

1fddfab · dependabot[bot] · 2022-08-22 10:20

3 files +1419 -278
Message
{commit_body(@commit)}

Files changed

modified dist/index.js
+1386 −260
@@ -140,6 +140,7 @@ const file_command_1 = __nccwpck_require__(717);
140 140 const utils_1 = __nccwpck_require__(5278);
141 141 const os = __importStar(__nccwpck_require__(2037));
142 142 const path = __importStar(__nccwpck_require__(1017));
143 +const uuid_1 = __nccwpck_require__(5840);
143 144 const oidc_utils_1 = __nccwpck_require__(8041);
144 145 /**
145 146 * The code to exit an action
@@ -169,7 +170,14 @@ function exportVariable(name, val) {
169 170 process.env[name] = convertedVal;
170 171 const filePath = process.env['GITHUB_ENV'] || '';
171 172 if (filePath) {
172 const delimiter = '_GitHubActionsFileCommandDelimeter_';
173 + const delimiter = `ghadelimiter_${uuid_1.v4()}`;
174 + // These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
175 + if (name.includes(delimiter)) {
176 + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
177 + }
178 + if (convertedVal.includes(delimiter)) {
179 + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
180 + }
173 181 const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
174 182 file_command_1.issueCommand('ENV', commandValue);
175 183 }
@@ -415,6 +423,23 @@ function getIDToken(aud) {
415 423 });
416 424 }
417 425 exports.getIDToken = getIDToken;
426 +/**
427 + * Summary exports
428 + */
429 +var summary_1 = __nccwpck_require__(1327);
430 +Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
431 +/**
432 + * @deprecated use core.summary
433 + */
434 +var summary_2 = __nccwpck_require__(1327);
435 +Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
436 +/**
437 + * Path exports
438 + */
439 +var path_utils_1 = __nccwpck_require__(2981);
440 +Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
441 +Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
442 +Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
418 443 //# sourceMappingURL=core.js.map
419 444
420 445 /***/ }),
@@ -484,8 +509,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
484 509 };
485 510 Object.defineProperty(exports, "__esModule", ({ value: true }));
486 511 exports.OidcClient = void 0;
487 const http_client_1 = __nccwpck_require__(9925);
488 const auth_1 = __nccwpck_require__(3702);
512 +const http_client_1 = __nccwpck_require__(6255);
513 +const auth_1 = __nccwpck_require__(5526);
489 514 const core_1 = __nccwpck_require__(2186);
490 515 class OidcClient {
491 516 static createHttpClient(allowRetry = true, maxRetry = 10) {
@@ -552,6 +577,361 @@ exports.OidcClient = OidcClient;
552 577
553 578 /***/ }),
554 579
580 +/***/ 2981:
581 +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
582 +
583 +"use strict";
584 +
585 +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
586 + if (k2 === undefined) k2 = k;
587 + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
588 +}) : (function(o, m, k, k2) {
589 + if (k2 === undefined) k2 = k;
590 + o[k2] = m[k];
591 +}));
592 +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
593 + Object.defineProperty(o, "default", { enumerable: true, value: v });
594 +}) : function(o, v) {
595 + o["default"] = v;
596 +});
597 +var __importStar = (this && this.__importStar) || function (mod) {
598 + if (mod && mod.__esModule) return mod;
599 + var result = {};
600 + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
601 + __setModuleDefault(result, mod);
602 + return result;
603 +};
604 +Object.defineProperty(exports, "__esModule", ({ value: true }));
605 +exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
606 +const path = __importStar(__nccwpck_require__(1017));
607 +/**
608 + * toPosixPath converts the given path to the posix form. On Windows, \\ will be
609 + * replaced with /.
610 + *
611 + * @param pth. Path to transform.
612 + * @return string Posix path.
613 + */
614 +function toPosixPath(pth) {
615 + return pth.replace(/[\\]/g, '/');
616 +}
617 +exports.toPosixPath = toPosixPath;
618 +/**
619 + * toWin32Path converts the given path to the win32 form. On Linux, / will be
620 + * replaced with \\.
621 + *
622 + * @param pth. Path to transform.
623 + * @return string Win32 path.
624 + */
625 +function toWin32Path(pth) {
626 + return pth.replace(/[/]/g, '\\');
627 +}
628 +exports.toWin32Path = toWin32Path;
629 +/**
630 + * toPlatformPath converts the given path to a platform-specific path. It does
631 + * this by replacing instances of / and \ with the platform-specific path
632 + * separator.
633 + *
634 + * @param pth The path to platformize.
635 + * @return string The platform-specific path.
636 + */
637 +function toPlatformPath(pth) {
638 + return pth.replace(/[/\\]/g, path.sep);
639 +}
640 +exports.toPlatformPath = toPlatformPath;
641 +//# sourceMappingURL=path-utils.js.map
642 +
643 +/***/ }),
644 +
645 +/***/ 1327:
646 +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
647 +
648 +"use strict";
649 +
650 +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
651 + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
652 + return new (P || (P = Promise))(function (resolve, reject) {
653 + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
654 + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
655 + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
656 + step((generator = generator.apply(thisArg, _arguments || [])).next());
657 + });
658 +};
659 +Object.defineProperty(exports, "__esModule", ({ value: true }));
660 +exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
661 +const os_1 = __nccwpck_require__(2037);
662 +const fs_1 = __nccwpck_require__(7147);
663 +const { access, appendFile, writeFile } = fs_1.promises;
664 +exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
665 +exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
666 +class Summary {
667 + constructor() {
668 + this._buffer = '';
669 + }
670 + /**
671 + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
672 + * Also checks r/w permissions.
673 + *
674 + * @returns step summary file path
675 + */
676 + filePath() {
677 + return __awaiter(this, void 0, void 0, function* () {
678 + if (this._filePath) {
679 + return this._filePath;
680 + }
681 + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
682 + if (!pathFromEnv) {
683 + throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
684 + }
685 + try {
686 + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
687 + }
688 + catch (_a) {
689 + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
690 + }
691 + this._filePath = pathFromEnv;
692 + return this._filePath;
693 + });
694 + }
695 + /**
696 + * Wraps content in an HTML tag, adding any HTML attributes
697 + *
698 + * @param {string} tag HTML tag to wrap
699 + * @param {string | null} content content within the tag
700 + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
701 + *
702 + * @returns {string} content wrapped in HTML element
703 + */
704 + wrap(tag, content, attrs = {}) {
705 + const htmlAttrs = Object.entries(attrs)
706 + .map(([key, value]) => ` ${key}="${value}"`)
707 + .join('');
708 + if (!content) {
709 + return `<${tag}${htmlAttrs}>`;
710 + }
711 + return `<${tag}${htmlAttrs}>${content}</${tag}>`;
712 + }
713 + /**
714 + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
715 + *
716 + * @param {SummaryWriteOptions} [options] (optional) options for write operation
717 + *
718 + * @returns {Promise<Summary>} summary instance
719 + */
720 + write(options) {
721 + return __awaiter(this, void 0, void 0, function* () {
722 + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
723 + const filePath = yield this.filePath();
724 + const writeFunc = overwrite ? writeFile : appendFile;
725 + yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
726 + return this.emptyBuffer();
727 + });
728 + }
729 + /**
730 + * Clears the summary buffer and wipes the summary file
731 + *
732 + * @returns {Summary} summary instance
733 + */
734 + clear() {
735 + return __awaiter(this, void 0, void 0, function* () {
736 + return this.emptyBuffer().write({ overwrite: true });
737 + });
738 + }
739 + /**
740 + * Returns the current summary buffer as a string
741 + *
742 + * @returns {string} string of summary buffer
743 + */
744 + stringify() {
745 + return this._buffer;
746 + }
747 + /**
748 + * If the summary buffer is empty
749 + *
750 + * @returns {boolen} true if the buffer is empty
751 + */
752 + isEmptyBuffer() {
753 + return this._buffer.length === 0;
754 + }
755 + /**
756 + * Resets the summary buffer without writing to summary file
757 + *
758 + * @returns {Summary} summary instance
759 + */
760 + emptyBuffer() {
761 + this._buffer = '';
762 + return this;
763 + }
764 + /**
765 + * Adds raw text to the summary buffer
766 + *
767 + * @param {string} text content to add
768 + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
769 + *
770 + * @returns {Summary} summary instance
771 + */
772 + addRaw(text, addEOL = false) {
773 + this._buffer += text;
774 + return addEOL ? this.addEOL() : this;
775 + }
776 + /**
777 + * Adds the operating system-specific end-of-line marker to the buffer
778 + *
779 + * @returns {Summary} summary instance
780 + */
781 + addEOL() {
782 + return this.addRaw(os_1.EOL);
783 + }
784 + /**
785 + * Adds an HTML codeblock to the summary buffer
786 + *
787 + * @param {string} code content to render within fenced code block
788 + * @param {string} lang (optional) language to syntax highlight code
789 + *
790 + * @returns {Summary} summary instance
791 + */
792 + addCodeBlock(code, lang) {
793 + const attrs = Object.assign({}, (lang && { lang }));
794 + const element = this.wrap('pre', this.wrap('code', code), attrs);
795 + return this.addRaw(element).addEOL();
796 + }
797 + /**
798 + * Adds an HTML list to the summary buffer
799 + *
800 + * @param {string[]} items list of items to render
801 + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
802 + *
803 + * @returns {Summary} summary instance
804 + */
805 + addList(items, ordered = false) {
806 + const tag = ordered ? 'ol' : 'ul';
807 + const listItems = items.map(item => this.wrap('li', item)).join('');
808 + const element = this.wrap(tag, listItems);
809 + return this.addRaw(element).addEOL();
810 + }
811 + /**
812 + * Adds an HTML table to the summary buffer
813 + *
814 + * @param {SummaryTableCell[]} rows table rows
815 + *
816 + * @returns {Summary} summary instance
817 + */
818 + addTable(rows) {
819 + const tableBody = rows
820 + .map(row => {
821 + const cells = row
822 + .map(cell => {
823 + if (typeof cell === 'string') {
824 + return this.wrap('td', cell);
825 + }
826 + const { header, data, colspan, rowspan } = cell;
827 + const tag = header ? 'th' : 'td';
828 + const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
829 + return this.wrap(tag, data, attrs);
830 + })
831 + .join('');
832 + return this.wrap('tr', cells);
833 + })
834 + .join('');
835 + const element = this.wrap('table', tableBody);
836 + return this.addRaw(element).addEOL();
837 + }
838 + /**
839 + * Adds a collapsable HTML details element to the summary buffer
840 + *
841 + * @param {string} label text for the closed state
842 + * @param {string} content collapsable content
843 + *
844 + * @returns {Summary} summary instance
845 + */
846 + addDetails(label, content) {
847 + const element = this.wrap('details', this.wrap('summary', label) + content);
848 + return this.addRaw(element).addEOL();
849 + }
850 + /**
851 + * Adds an HTML image tag to the summary buffer
852 + *
853 + * @param {string} src path to the image you to embed
854 + * @param {string} alt text description of the image
855 + * @param {SummaryImageOptions} options (optional) addition image attributes
856 + *
857 + * @returns {Summary} summary instance
858 + */
859 + addImage(src, alt, options) {
860 + const { width, height } = options || {};
861 + const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
862 + const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
863 + return this.addRaw(element).addEOL();
864 + }
865 + /**
866 + * Adds an HTML section heading element
867 + *
868 + * @param {string} text heading text
869 + * @param {number | string} [level=1] (optional) the heading level, default: 1
870 + *
871 + * @returns {Summary} summary instance
872 + */
873 + addHeading(text, level) {
874 + const tag = `h${level}`;
875 + const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
876 + ? tag
877 + : 'h1';
878 + const element = this.wrap(allowedTag, text);
879 + return this.addRaw(element).addEOL();
880 + }
881 + /**
882 + * Adds an HTML thematic break (<hr>) to the summary buffer
883 + *
884 + * @returns {Summary} summary instance
885 + */
886 + addSeparator() {
887 + const element = this.wrap('hr', null);
888 + return this.addRaw(element).addEOL();
889 + }
890 + /**
891 + * Adds an HTML line break (<br>) to the summary buffer
892 + *
893 + * @returns {Summary} summary instance
894 + */
895 + addBreak() {
896 + const element = this.wrap('br', null);
897 + return this.addRaw(element).addEOL();
898 + }
899 + /**
900 + * Adds an HTML blockquote to the summary buffer
901 + *
902 + * @param {string} text quote text
903 + * @param {string} cite (optional) citation url
904 + *
905 + * @returns {Summary} summary instance
906 + */
907 + addQuote(text, cite) {
908 + const attrs = Object.assign({}, (cite && { cite }));
909 + const element = this.wrap('blockquote', text, attrs);
910 + return this.addRaw(element).addEOL();
911 + }
912 + /**
913 + * Adds an HTML anchor tag to the summary buffer
914 + *
915 + * @param {string} text link text/content
916 + * @param {string} href hyperlink
917 + *
918 + * @returns {Summary} summary instance
919 + */
920 + addLink(text, href) {
921 + const element = this.wrap('a', text, { href });
922 + return this.addRaw(element).addEOL();
923 + }
924 +}
925 +const _summary = new Summary();
926 +/**
927 + * @deprecated use `core.summary`
928 + */
929 +exports.markdownSummary = _summary;
930 +exports.summary = _summary;
931 +//# sourceMappingURL=summary.js.map
932 +
933 +/***/ }),
934 +
555 935 /***/ 5278:
556 936 /***/ ((__unused_webpack_module, exports) => {
557 937
@@ -1334,28 +1714,41 @@ class ExecState extends events.EventEmitter {
1334 1714
1335 1715 /***/ }),
1336 1716
1337 /***/ 3702:
1338 /***/ ((__unused_webpack_module, exports) => {
1717 +/***/ 5526:
1718 +/***/ (function(__unused_webpack_module, exports) {
1339 1719
1340 1720 "use strict";
1341 1721
1722 +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1723 + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1724 + return new (P || (P = Promise))(function (resolve, reject) {
1725 + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1726 + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1727 + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1728 + step((generator = generator.apply(thisArg, _arguments || [])).next());
1729 + });
1730 +};
1342 1731 Object.defineProperty(exports, "__esModule", ({ value: true }));
1732 +exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
1343 1733 class BasicCredentialHandler {
1344 1734 constructor(username, password) {
1345 1735 this.username = username;
1346 1736 this.password = password;
1347 1737 }
1348 1738 prepareRequest(options) {
1349 options.headers['Authorization'] =
1350 'Basic ' +
1351 Buffer.from(this.username + ':' + this.password).toString('base64');
1739 + if (!options.headers) {
1740 + throw Error('The request has no headers');
1741 + }
1742 + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
1352 1743 }
1353 1744 // This handler cannot handle 401
1354 canHandleAuthentication(response) {
1745 + canHandleAuthentication() {
1355 1746 return false;
1356 1747 }
1357 handleAuthentication(httpClient, requestInfo, objs) {
1358 return null;
1748 + handleAuthentication() {
1749 + return __awaiter(this, void 0, void 0, function* () {
1750 + throw new Error('not implemented');
1751 + });
1359 1752 }
1360 1753 }
1361 1754 exports.BasicCredentialHandler = BasicCredentialHandler;
@@ -1366,14 +1759,19 @@ class BearerCredentialHandler {
1366 1759 // currently implements pre-authorization
1367 1760 // TODO: support preAuth = false where it hooks on 401
1368 1761 prepareRequest(options) {
1369 options.headers['Authorization'] = 'Bearer ' + this.token;
1762 + if (!options.headers) {
1763 + throw Error('The request has no headers');
1764 + }
1765 + options.headers['Authorization'] = `Bearer ${this.token}`;
1370 1766 }
1371 1767 // This handler cannot handle 401
1372 canHandleAuthentication(response) {
1768 + canHandleAuthentication() {
1373 1769 return false;
1374 1770 }
1375 handleAuthentication(httpClient, requestInfo, objs) {
1376 return null;
1771 + handleAuthentication() {
1772 + return __awaiter(this, void 0, void 0, function* () {
1773 + throw new Error('not implemented');
1774 + });
1377 1775 }
1378 1776 }
1379 1777 exports.BearerCredentialHandler = BearerCredentialHandler;
@@ -1384,32 +1782,66 @@ class PersonalAccessTokenCredentialHandler {
1384 1782 // currently implements pre-authorization
1385 1783 // TODO: support preAuth = false where it hooks on 401
1386 1784 prepareRequest(options) {
1387 options.headers['Authorization'] =
1388 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
1785 + if (!options.headers) {
1786 + throw Error('The request has no headers');
1787 + }
1788 + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
1389 1789 }
1390 1790 // This handler cannot handle 401
1391 canHandleAuthentication(response) {
1791 + canHandleAuthentication() {
1392 1792 return false;
1393 1793 }
1394 handleAuthentication(httpClient, requestInfo, objs) {
1395 return null;
1794 + handleAuthentication() {
1795 + return __awaiter(this, void 0, void 0, function* () {
1796 + throw new Error('not implemented');
1797 + });
1396 1798 }
1397 1799 }
1398 1800 exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
1399
1801 +//# sourceMappingURL=auth.js.map
1400 1802
1401 1803 /***/ }),
1402 1804
1403 /***/ 9925:
1404 /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1805 +/***/ 6255:
1806 +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
1405 1807
1406 1808 "use strict";
1407 1809
1810 +/* eslint-disable @typescript-eslint/no-explicit-any */
1811 +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1812 + if (k2 === undefined) k2 = k;
1813 + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1814 +}) : (function(o, m, k, k2) {
1815 + if (k2 === undefined) k2 = k;
1816 + o[k2] = m[k];
1817 +}));
1818 +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1819 + Object.defineProperty(o, "default", { enumerable: true, value: v });
1820 +}) : function(o, v) {
1821 + o["default"] = v;
1822 +});
1823 +var __importStar = (this && this.__importStar) || function (mod) {
1824 + if (mod && mod.__esModule) return mod;
1825 + var result = {};
1826 + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1827 + __setModuleDefault(result, mod);
1828 + return result;
1829 +};
1830 +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1831 + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1832 + return new (P || (P = Promise))(function (resolve, reject) {
1833 + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1834 + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1835 + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1836 + step((generator = generator.apply(thisArg, _arguments || [])).next());
1837 + });
1838 +};
1408 1839 Object.defineProperty(exports, "__esModule", ({ value: true }));
1409 const http = __nccwpck_require__(3685);
1410 const https = __nccwpck_require__(5687);
1411 const pm = __nccwpck_require__(6443);
1412 let tunnel;
1840 +exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
1841 +const http = __importStar(__nccwpck_require__(3685));
1842 +const https = __importStar(__nccwpck_require__(5687));
1843 +const pm = __importStar(__nccwpck_require__(9835));
1844 +const tunnel = __importStar(__nccwpck_require__(4294));
1413 1845 var HttpCodes;
1414 1846 (function (HttpCodes) {
1415 1847 HttpCodes[HttpCodes["OK"] = 200] = "OK";
@@ -1454,7 +1886,7 @@ var MediaTypes;
1454 1886 * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
1455 1887 */
1456 1888 function getProxyUrl(serverUrl) {
1457 let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
1889 + const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
1458 1890 return proxyUrl ? proxyUrl.href : '';
1459 1891 }
1460 1892 exports.getProxyUrl = getProxyUrl;
@@ -1487,20 +1919,22 @@ class HttpClientResponse {
1487 1919 this.message = message;
1488 1920 }
1489 1921 readBody() {
1490 return new Promise(async (resolve, reject) => {
1491 let output = Buffer.alloc(0);
1492 this.message.on('data', (chunk) => {
1493 output = Buffer.concat([output, chunk]);
1494 });
1495 this.message.on('end', () => {
1496 resolve(output.toString());
1497 });
1922 + return __awaiter(this, void 0, void 0, function* () {
1923 + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
1924 + let output = Buffer.alloc(0);
1925 + this.message.on('data', (chunk) => {
1926 + output = Buffer.concat([output, chunk]);
1927 + });
1928 + this.message.on('end', () => {
1929 + resolve(output.toString());
1930 + });
1931 + }));
1498 1932 });
1499 1933 }
1500 1934 }
1501 1935 exports.HttpClientResponse = HttpClientResponse;
1502 1936 function isHttps(requestUrl) {
1503 let parsedUrl = new URL(requestUrl);
1937 + const parsedUrl = new URL(requestUrl);
1504 1938 return parsedUrl.protocol === 'https:';
1505 1939 }
1506 1940 exports.isHttps = isHttps;
@@ -1543,141 +1977,169 @@ class HttpClient {
1543 1977 }
1544 1978 }
1545 1979 options(requestUrl, additionalHeaders) {
1546 return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
1980 + return __awaiter(this, void 0, void 0, function* () {
1981 + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
1982 + });
1547 1983 }
1548 1984 get(requestUrl, additionalHeaders) {
1549 return this.request('GET', requestUrl, null, additionalHeaders || {});
1985 + return __awaiter(this, void 0, void 0, function* () {
1986 + return this.request('GET', requestUrl, null, additionalHeaders || {});
1987 + });
1550 1988 }
1551 1989 del(requestUrl, additionalHeaders) {
1552 return this.request('DELETE', requestUrl, null, additionalHeaders || {});
1990 + return __awaiter(this, void 0, void 0, function* () {
1991 + return this.request('DELETE', requestUrl, null, additionalHeaders || {});
1992 + });
1553 1993 }
1554 1994 post(requestUrl, data, additionalHeaders) {
1555 return this.request('POST', requestUrl, data, additionalHeaders || {});
1995 + return __awaiter(this, void 0, void 0, function* () {
1996 + return this.request('POST', requestUrl, data, additionalHeaders || {});
1997 + });
1556 1998 }
1557 1999 patch(requestUrl, data, additionalHeaders) {
1558 return this.request('PATCH', requestUrl, data, additionalHeaders || {});
2000 + return __awaiter(this, void 0, void 0, function* () {
2001 + return this.request('PATCH', requestUrl, data, additionalHeaders || {});
2002 + });
1559 2003 }
1560 2004 put(requestUrl, data, additionalHeaders) {
1561 return this.request('PUT', requestUrl, data, additionalHeaders || {});
2005 + return __awaiter(this, void 0, void 0, function* () {
2006 + return this.request('PUT', requestUrl, data, additionalHeaders || {});
2007 + });
1562 2008 }
1563 2009 head(requestUrl, additionalHeaders) {
1564 return this.request('HEAD', requestUrl, null, additionalHeaders || {});
2010 + return __awaiter(this, void 0, void 0, function* () {
2011 + return this.request('HEAD', requestUrl, null, additionalHeaders || {});
2012 + });
1565 2013 }
1566 2014 sendStream(verb, requestUrl, stream, additionalHeaders) {
1567 return this.request(verb, requestUrl, stream, additionalHeaders);
2015 + return __awaiter(this, void 0, void 0, function* () {
2016 + return this.request(verb, requestUrl, stream, additionalHeaders);
2017 + });
1568 2018 }
1569 2019 /**
1570 2020 * Gets a typed object from an endpoint
1571 2021 * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
1572 2022 */
1573 async getJson(requestUrl, additionalHeaders = {}) {
1574 additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
1575 let res = await this.get(requestUrl, additionalHeaders);
1576 return this._processResponse(res, this.requestOptions);
1577 }
1578 async postJson(requestUrl, obj, additionalHeaders = {}) {
1579 let data = JSON.stringify(obj, null, 2);
1580 additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
1581 additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
1582 let res = await this.post(requestUrl, data, additionalHeaders);
1583 return this._processResponse(res, this.requestOptions);
1584 }
1585 async putJson(requestUrl, obj, additionalHeaders = {}) {
1586 let data = JSON.stringify(obj, null, 2);
1587 additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
1588 additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
1589 let res = await this.put(requestUrl, data, additionalHeaders);
1590 return this._processResponse(res, this.requestOptions);
1591 }
1592 async patchJson(requestUrl, obj, additionalHeaders = {}) {
1593 let data = JSON.stringify(obj, null, 2);
1594 additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
1595 additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
1596 let res = await this.patch(requestUrl, data, additionalHeaders);
1597 return this._processResponse(res, this.requestOptions);
2023 + getJson(requestUrl, additionalHeaders = {}) {
2024 + return __awaiter(this, void 0, void 0, function* () {
2025 + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
2026 + const res = yield this.get(requestUrl, additionalHeaders);
2027 + return this._processResponse(res, this.requestOptions);
2028 + });
1598 2029 }
1599 /**
1600 * Makes a raw http request.
1601 * All other methods such as get, post, patch, and request ultimately call this.
1602 * Prefer get, del, post and patch
1603 */
1604 async request(verb, requestUrl, data, headers) {
1605 if (this._disposed) {
1606 throw new Error('Client has already been disposed.');
1607 }
1608 let parsedUrl = new URL(requestUrl);
1609 let info = this._prepareRequest(verb, parsedUrl, headers);
1610 // Only perform retries on reads since writes may not be idempotent.
1611 let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
1612 ? this._maxRetries + 1
1613 : 1;
1614 let numTries = 0;
1615 let response;
1616 while (numTries < maxTries) {
1617 response = await this.requestRaw(info, data);
1618 // Check if it's an authentication challenge
1619 if (response &&
1620 response.message &&
1621 response.message.statusCode === HttpCodes.Unauthorized) {
1622 let authenticationHandler;
1623 for (let i = 0; i < this.handlers.length; i++) {
1624 if (this.handlers[i].canHandleAuthentication(response)) {
1625 authenticationHandler = this.handlers[i];
1626 break;
1627 }
1628 }
1629 if (authenticationHandler) {
1630 return authenticationHandler.handleAuthentication(this, info, data);
1631 }
1632 else {
1633 // We have received an unauthorized response but have no handlers to handle it.
1634 // Let the response return to the caller.
1635 return response;
1636 }
2030 + postJson(requestUrl, obj, additionalHeaders = {}) {
2031 + return __awaiter(this, void 0, void 0, function* () {
2032 + const data = JSON.stringify(obj, null, 2);
2033 + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
2034 + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
2035 + const res = yield this.post(requestUrl, data, additionalHeaders);
2036 + return this._processResponse(res, this.requestOptions);
2037 + });
2038 + }
2039 + putJson(requestUrl, obj, additionalHeaders = {}) {
2040 + return __awaiter(this, void 0, void 0, function* () {
2041 + const data = JSON.stringify(obj, null, 2);
2042 + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
2043 + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
2044 + const res = yield this.put(requestUrl, data, additionalHeaders);
2045 + return this._processResponse(res, this.requestOptions);
2046 + });
2047 + }
2048 + patchJson(requestUrl, obj, additionalHeaders = {}) {
2049 + return __awaiter(this, void 0, void 0, function* () {
2050 + const data = JSON.stringify(obj, null, 2);
2051 + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
2052 + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
2053 + const res = yield this.patch(requestUrl, data, additionalHeaders);
2054 + return this._processResponse(res, this.requestOptions);
2055 + });
2056 + }
2057 + /**
2058 + * Makes a raw http request.
2059 + * All other methods such as get, post, patch, and request ultimately call this.
2060 + * Prefer get, del, post and patch
2061 + */
2062 + request(verb, requestUrl, data, headers) {
2063 + return __awaiter(this, void 0, void 0, function* () {
2064 + if (this._disposed) {
2065 + throw new Error('Client has already been disposed.');
1637 2066 }
1638 let redirectsRemaining = this._maxRedirects;
1639 while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
1640 this._allowRedirects &&
1641 redirectsRemaining > 0) {
1642 const redirectUrl = response.message.headers['location'];
1643 if (!redirectUrl) {
1644 // if there's no location to redirect to, we won't
1645 break;
1646 }
1647 let parsedRedirectUrl = new URL(redirectUrl);
1648 if (parsedUrl.protocol == 'https:' &&
1649 parsedUrl.protocol != parsedRedirectUrl.protocol &&
1650 !this._allowRedirectDowngrade) {
1651 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.');
2067 + const parsedUrl = new URL(requestUrl);
2068 + let info = this._prepareRequest(verb, parsedUrl, headers);
2069 + // Only perform retries on reads since writes may not be idempotent.
2070 + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
2071 + ? this._maxRetries + 1
2072 + : 1;
2073 + let numTries = 0;
2074 + let response;
2075 + do {
2076 + response = yield this.requestRaw(info, data);
2077 + // Check if it's an authentication challenge
2078 + if (response &&
2079 + response.message &&
2080 + response.message.statusCode === HttpCodes.Unauthorized) {
2081 + let authenticationHandler;
2082 + for (const handler of this.handlers) {
2083 + if (handler.canHandleAuthentication(response)) {
2084 + authenticationHandler = handler;
2085 + break;
2086 + }
2087 + }
2088 + if (authenticationHandler) {
2089 + return authenticationHandler.handleAuthentication(this, info, data);
2090 + }
2091 + else {
2092 + // We have received an unauthorized response but have no handlers to handle it.
2093 + // Let the response return to the caller.
2094 + return response;
2095 + }
1652 2096 }
1653 // we need to finish reading the response before reassigning response
1654 // which will leak the open socket.
1655 await response.readBody();
1656 // strip authorization header if redirected to a different hostname
1657 if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
1658 for (let header in headers) {
1659 // header names are case insensitive
1660 if (header.toLowerCase() === 'authorization') {
1661 delete headers[header];
2097 + let redirectsRemaining = this._maxRedirects;
2098 + while (response.message.statusCode &&
2099 + HttpRedirectCodes.includes(response.message.statusCode) &&
2100 + this._allowRedirects &&
2101 + redirectsRemaining > 0) {
2102 + const redirectUrl = response.message.headers['location'];
2103 + if (!redirectUrl) {
2104 + // if there's no location to redirect to, we won't
2105 + break;
2106 + }
2107 + const parsedRedirectUrl = new URL(redirectUrl);
2108 + if (parsedUrl.protocol === 'https:' &&
2109 + parsedUrl.protocol !== parsedRedirectUrl.protocol &&
2110 + !this._allowRedirectDowngrade) {
2111 + 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.');
2112 + }
2113 + // we need to finish reading the response before reassigning response
2114 + // which will leak the open socket.
2115 + yield response.readBody();
2116 + // strip authorization header if redirected to a different hostname
2117 + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
2118 + for (const header in headers) {
2119 + // header names are case insensitive
2120 + if (header.toLowerCase() === 'authorization') {
2121 + delete headers[header];
2122 + }
1662 2123 }
1663 2124 }
2125 + // let's make the request with the new redirectUrl
2126 + info = this._prepareRequest(verb, parsedRedirectUrl, headers);
2127 + response = yield this.requestRaw(info, data);
2128 + redirectsRemaining--;
1664 2129 }
1665 // let's make the request with the new redirectUrl
1666 info = this._prepareRequest(verb, parsedRedirectUrl, headers);
1667 response = await this.requestRaw(info, data);
1668 redirectsRemaining--;
1669 }
1670 if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
1671 // If not a retry code, return immediately instead of retrying
1672 return response;
1673 }
1674 numTries += 1;
1675 if (numTries < maxTries) {
1676 await response.readBody();
1677 await this._performExponentialBackoff(numTries);
1678 }
1679 }
1680 return response;
2130 + if (!response.message.statusCode ||
2131 + !HttpResponseRetryCodes.includes(response.message.statusCode)) {
2132 + // If not a retry code, return immediately instead of retrying
2133 + return response;
2134 + }
2135 + numTries += 1;
2136 + if (numTries < maxTries) {
2137 + yield response.readBody();
2138 + yield this._performExponentialBackoff(numTries);
2139 + }
2140 + } while (numTries < maxTries);
2141 + return response;
2142 + });
1681 2143 }
1682 2144 /**
1683 2145 * Needs to be called if keepAlive is set to true in request options.
@@ -1694,14 +2156,22 @@ class HttpClient {
1694 2156 * @param data
1695 2157 */
1696 2158 requestRaw(info, data) {
1697 return new Promise((resolve, reject) => {
1698 let callbackForResult = function (err, res) {
1699 if (err) {
1700 reject(err);
2159 + return __awaiter(this, void 0, void 0, function* () {
2160 + return new Promise((resolve, reject) => {
2161 + function callbackForResult(err, res) {
2162 + if (err) {
2163 + reject(err);
2164 + }
2165 + else if (!res) {
2166 + // If `err` is not passed, then `res` must be passed.
2167 + reject(new Error('Unknown error'));
2168 + }
2169 + else {
2170 + resolve(res);
2171 + }
1701 2172 }
1702 resolve(res);
1703 };
1704 this.requestRawWithCallback(info, data, callbackForResult);
2173 + this.requestRawWithCallback(info, data, callbackForResult);
2174 + });
1705 2175 });
1706 2176 }
1707 2177 /**
@@ -1711,21 +2181,24 @@ class HttpClient {
1711 2181 * @param onResult
1712 2182 */
1713 2183 requestRawWithCallback(info, data, onResult) {
1714 let socket;
1715 2184 if (typeof data === 'string') {
2185 + if (!info.options.headers) {
2186 + info.options.headers = {};
2187 + }
1716 2188 info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
1717 2189 }
1718 2190 let callbackCalled = false;
1719 let handleResult = (err, res) => {
2191 + function handleResult(err, res) {
1720 2192 if (!callbackCalled) {
1721 2193 callbackCalled = true;
1722 2194 onResult(err, res);
1723 2195 }
1724 };
1725 let req = info.httpModule.request(info.options, (msg) => {
1726 let res = new HttpClientResponse(msg);
1727 handleResult(null, res);
2196 + }
2197 + const req = info.httpModule.request(info.options, (msg) => {
2198 + const res = new HttpClientResponse(msg);
2199 + handleResult(undefined, res);
1728 2200 });
2201 + let socket;
1729 2202 req.on('socket', sock => {
1730 2203 socket = sock;
1731 2204 });
@@ -1734,12 +2207,12 @@ class HttpClient {
1734 2207 if (socket) {
1735 2208 socket.end();
1736 2209 }
1737 handleResult(new Error('Request timeout: ' + info.options.path), null);
2210 + handleResult(new Error(`Request timeout: ${info.options.path}`));
1738 2211 });
1739 2212 req.on('error', function (err) {
1740 2213 // err has statusCode property
1741 2214 // res should have headers
1742 handleResult(err, null);
2215 + handleResult(err);
1743 2216 });
1744 2217 if (data && typeof data === 'string') {
1745 2218 req.write(data, 'utf8');
@@ -1760,7 +2233,7 @@ class HttpClient {
1760 2233 * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
1761 2234 */
1762 2235 getAgent(serverUrl) {
1763 let parsedUrl = new URL(serverUrl);
2236 + const parsedUrl = new URL(serverUrl);
1764 2237 return this._getAgent(parsedUrl);
1765 2238 }
1766 2239 _prepareRequest(method, requestUrl, headers) {
@@ -1784,21 +2257,19 @@ class HttpClient {
1784 2257 info.options.agent = this._getAgent(info.parsedUrl);
1785 2258 // gives handlers an opportunity to participate
1786 2259 if (this.handlers) {
1787 this.handlers.forEach(handler => {
2260 + for (const handler of this.handlers) {
1788 2261 handler.prepareRequest(info.options);
1789 });
2262 + }
1790 2263 }
1791 2264 return info;
1792 2265 }
1793 2266 _mergeHeaders(headers) {
1794 const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
1795 2267 if (this.requestOptions && this.requestOptions.headers) {
1796 return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
2268 + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
1797 2269 }
1798 2270 return lowercaseKeys(headers || {});
1799 2271 }
1800 2272 _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
1801 const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
1802 2273 let clientHeader;
1803 2274 if (this.requestOptions && this.requestOptions.headers) {
1804 2275 clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
@@ -1807,8 +2278,8 @@ class HttpClient {
1807 2278 }
1808 2279 _getAgent(parsedUrl) {
1809 2280 let agent;
1810 let proxyUrl = pm.getProxyUrl(parsedUrl);
1811 let useProxy = proxyUrl && proxyUrl.hostname;
2281 + const proxyUrl = pm.getProxyUrl(parsedUrl);
2282 + const useProxy = proxyUrl && proxyUrl.hostname;
1812 2283 if (this._keepAlive && useProxy) {
1813 2284 agent = this._proxyAgent;
1814 2285 }
@@ -1816,29 +2287,22 @@ class HttpClient {
1816 2287 agent = this._agent;
1817 2288 }
1818 2289 // if agent is already assigned use that agent.
1819 if (!!agent) {
2290 + if (agent) {
1820 2291 return agent;
1821 2292 }
1822 2293 const usingSsl = parsedUrl.protocol === 'https:';
1823 2294 let maxSockets = 100;
1824 if (!!this.requestOptions) {
2295 + if (this.requestOptions) {
1825 2296 maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
1826 2297 }
1827 if (useProxy) {
1828 // If using proxy, need tunnel
1829 if (!tunnel) {
1830 tunnel = __nccwpck_require__(4294);
1831 }
2298 + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
2299 + if (proxyUrl && proxyUrl.hostname) {
1832 2300 const agentOptions = {
1833 maxSockets: maxSockets,
2301 + maxSockets,
1834 2302 keepAlive: this._keepAlive,
1835 proxy: {
1836 ...((proxyUrl.username || proxyUrl.password) && {
1837 proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
1838 }),
1839 host: proxyUrl.hostname,
1840 port: proxyUrl.port
1841 }
2303 + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
2304 + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
2305 + })), { host: proxyUrl.hostname, port: proxyUrl.port })
1842 2306 };
1843 2307 let tunnelAgent;
1844 2308 const overHttps = proxyUrl.protocol === 'https:';
@@ -1853,7 +2317,7 @@ class HttpClient {
1853 2317 }
1854 2318 // if reusing agent across request and tunneling agent isn't assigned create a new agent
1855 2319 if (this._keepAlive && !agent) {
1856 const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
2320 + const options = { keepAlive: this._keepAlive, maxSockets };
1857 2321 agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
1858 2322 this._agent = agent;
1859 2323 }
@@ -1872,109 +2336,117 @@ class HttpClient {
1872 2336 return agent;
1873 2337 }
1874 2338 _performExponentialBackoff(retryNumber) {
1875 retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
1876 const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
1877 return new Promise(resolve => setTimeout(() => resolve(), ms));
1878 }
1879 static dateTimeDeserializer(key, value) {
1880 if (typeof value === 'string') {
1881 let a = new Date(value);
1882 if (!isNaN(a.valueOf())) {
1883 return a;
1884 }
1885 }
1886 return value;
2339 + return __awaiter(this, void 0, void 0, function* () {
2340 + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
2341 + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
2342 + return new Promise(resolve => setTimeout(() => resolve(), ms));
2343 + });
1887 2344 }
1888 async _processResponse(res, options) {
1889 return new Promise(async (resolve, reject) => {
1890 const statusCode = res.message.statusCode;
1891 const response = {
1892 statusCode: statusCode,
1893 result: null,
1894 headers: {}
1895 };
1896 // not found leads to null obj returned
1897 if (statusCode == HttpCodes.NotFound) {
1898 resolve(response);
1899 }
1900 let obj;
1901 let contents;
1902 // get the result from the body
1903 try {
1904 contents = await res.readBody();
1905 if (contents && contents.length > 0) {
1906 if (options && options.deserializeDates) {
1907 obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
2345 + _processResponse(res, options) {
2346 + return __awaiter(this, void 0, void 0, function* () {
2347 + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
2348 + const statusCode = res.message.statusCode || 0;
2349 + const response = {
2350 + statusCode,
2351 + result: null,
2352 + headers: {}
2353 + };
2354 + // not found leads to null obj returned
2355 + if (statusCode === HttpCodes.NotFound) {
2356 + resolve(response);
2357 + }
2358 + // get the result from the body
2359 + function dateTimeDeserializer(key, value) {
2360 + if (typeof value === 'string') {
2361 + const a = new Date(value);
2362 + if (!isNaN(a.valueOf())) {
2363 + return a;
2364 + }
1908 2365 }
1909 else {
1910 obj = JSON.parse(contents);
2366 + return value;
2367 + }
2368 + let obj;
2369 + let contents;
2370 + try {
2371 + contents = yield res.readBody();
2372 + if (contents && contents.length > 0) {
2373 + if (options && options.deserializeDates) {
2374 + obj = JSON.parse(contents, dateTimeDeserializer);
2375 + }
2376 + else {
2377 + obj = JSON.parse(contents);
2378 + }
2379 + response.result = obj;
1911 2380 }
1912 response.result = obj;
2381 + response.headers = res.message.headers;
1913 2382 }
1914 response.headers = res.message.headers;
1915 }
1916 catch (err) {
1917 // Invalid resource (contents not json); leaving result obj null
1918 }
1919 // note that 3xx redirects are handled by the http layer.
1920 if (statusCode > 299) {
1921 let msg;
1922 // if exception/error in body, attempt to get better error
1923 if (obj && obj.message) {
1924 msg = obj.message;
2383 + catch (err) {
2384 + // Invalid resource (contents not json); leaving result obj null
1925 2385 }
1926 else if (contents && contents.length > 0) {
1927 // it may be the case that the exception is in the body message as string
1928 msg = contents;
2386 + // note that 3xx redirects are handled by the http layer.
2387 + if (statusCode > 299) {
2388 + let msg;
2389 + // if exception/error in body, attempt to get better error
2390 + if (obj && obj.message) {
2391 + msg = obj.message;
2392 + }
2393 + else if (contents && contents.length > 0) {
2394 + // it may be the case that the exception is in the body message as string
2395 + msg = contents;
2396 + }
2397 + else {
2398 + msg = `Failed request: (${statusCode})`;
2399 + }
2400 + const err = new HttpClientError(msg, statusCode);
2401 + err.result = response.result;
2402 + reject(err);
1929 2403 }
1930 2404 else {
1931 msg = 'Failed request: (' + statusCode + ')';
2405 + resolve(response);
1932 2406 }
1933 let err = new HttpClientError(msg, statusCode);
1934 err.result = response.result;
1935 reject(err);
1936 }
1937 else {
1938 resolve(response);
1939 }
2407 + }));
1940 2408 });
1941 2409 }
1942 2410 }
1943 2411 exports.HttpClient = HttpClient;
1944
2412 +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
2413 +//# sourceMappingURL=index.js.map
1945 2414
1946 2415 /***/ }),
1947 2416
1948 /***/ 6443:
2417 +/***/ 9835:
1949 2418 /***/ ((__unused_webpack_module, exports) => {
1950 2419
1951 2420 "use strict";
1952 2421
1953 2422 Object.defineProperty(exports, "__esModule", ({ value: true }));
2423 +exports.checkBypass = exports.getProxyUrl = void 0;
1954 2424 function getProxyUrl(reqUrl) {
1955 let usingSsl = reqUrl.protocol === 'https:';
1956 let proxyUrl;
2425 + const usingSsl = reqUrl.protocol === 'https:';
1957 2426 if (checkBypass(reqUrl)) {
1958 return proxyUrl;
2427 + return undefined;
1959 2428 }
1960 let proxyVar;
1961 if (usingSsl) {
1962 proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
2429 + const proxyVar = (() => {
2430 + if (usingSsl) {
2431 + return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
2432 + }
2433 + else {
2434 + return process.env['http_proxy'] || process.env['HTTP_PROXY'];
2435 + }
2436 + })();
2437 + if (proxyVar) {
2438 + return new URL(proxyVar);
1963 2439 }
1964 2440 else {
1965 proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
2441 + return undefined;
1966 2442 }
1967 if (proxyVar) {
1968 proxyUrl = new URL(proxyVar);
1969 }
1970 return proxyUrl;
1971 2443 }
1972 2444 exports.getProxyUrl = getProxyUrl;
1973 2445 function checkBypass(reqUrl) {
1974 2446 if (!reqUrl.hostname) {
1975 2447 return false;
1976 2448 }
1977 let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
2449 + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
1978 2450 if (!noProxy) {
1979 2451 return false;
1980 2452 }
@@ -1990,12 +2462,12 @@ function checkBypass(reqUrl) {
1990 2462 reqPort = 443;
1991 2463 }
1992 2464 // Format the request hostname and hostname with port
1993 let upperReqHosts = [reqUrl.hostname.toUpperCase()];
2465 + const upperReqHosts = [reqUrl.hostname.toUpperCase()];
1994 2466 if (typeof reqPort === 'number') {
1995 2467 upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
1996 2468 }
1997 2469 // Compare request host against noproxy
1998 for (let upperNoProxyItem of noProxy
2470 + for (const upperNoProxyItem of noProxy
1999 2471 .split(',')
2000 2472 .map(x => x.trim().toUpperCase())
2001 2473 .filter(x => x)) {
@@ -2006,7 +2478,7 @@ function checkBypass(reqUrl) {
2006 2478 return false;
2007 2479 }
2008 2480 exports.checkBypass = checkBypass;
2009
2481 +//# sourceMappingURL=proxy.js.map
2010 2482
2011 2483 /***/ }),
2012 2484
@@ -5959,6 +6431,652 @@ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
5959 6431 exports.debug = debug; // for test
5960 6432
5961 6433
6434 +/***/ }),
6435 +
6436 +/***/ 5840:
6437 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6438 +
6439 +"use strict";
6440 +
6441 +
6442 +Object.defineProperty(exports, "__esModule", ({
6443 + value: true
6444 +}));
6445 +Object.defineProperty(exports, "v1", ({
6446 + enumerable: true,
6447 + get: function () {
6448 + return _v.default;
6449 + }
6450 +}));
6451 +Object.defineProperty(exports, "v3", ({
6452 + enumerable: true,
6453 + get: function () {
6454 + return _v2.default;
6455 + }
6456 +}));
6457 +Object.defineProperty(exports, "v4", ({
6458 + enumerable: true,
6459 + get: function () {
6460 + return _v3.default;
6461 + }
6462 +}));
6463 +Object.defineProperty(exports, "v5", ({
6464 + enumerable: true,
6465 + get: function () {
6466 + return _v4.default;
6467 + }
6468 +}));
6469 +Object.defineProperty(exports, "NIL", ({
6470 + enumerable: true,
6471 + get: function () {
6472 + return _nil.default;
6473 + }
6474 +}));
6475 +Object.defineProperty(exports, "version", ({
6476 + enumerable: true,
6477 + get: function () {
6478 + return _version.default;
6479 + }
6480 +}));
6481 +Object.defineProperty(exports, "validate", ({
6482 + enumerable: true,
6483 + get: function () {
6484 + return _validate.default;
6485 + }
6486 +}));
6487 +Object.defineProperty(exports, "stringify", ({
6488 + enumerable: true,
6489 + get: function () {
6490 + return _stringify.default;
6491 + }
6492 +}));
6493 +Object.defineProperty(exports, "parse", ({
6494 + enumerable: true,
6495 + get: function () {
6496 + return _parse.default;
6497 + }
6498 +}));
6499 +
6500 +var _v = _interopRequireDefault(__nccwpck_require__(8628));
6501 +
6502 +var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
6503 +
6504 +var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
6505 +
6506 +var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
6507 +
6508 +var _nil = _interopRequireDefault(__nccwpck_require__(5332));
6509 +
6510 +var _version = _interopRequireDefault(__nccwpck_require__(1595));
6511 +
6512 +var _validate = _interopRequireDefault(__nccwpck_require__(6900));
6513 +
6514 +var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
6515 +
6516 +var _parse = _interopRequireDefault(__nccwpck_require__(2746));
6517 +
6518 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6519 +
6520 +/***/ }),
6521 +
6522 +/***/ 4569:
6523 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6524 +
6525 +"use strict";
6526 +
6527 +
6528 +Object.defineProperty(exports, "__esModule", ({
6529 + value: true
6530 +}));
6531 +exports["default"] = void 0;
6532 +
6533 +var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
6534 +
6535 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6536 +
6537 +function md5(bytes) {
6538 + if (Array.isArray(bytes)) {
6539 + bytes = Buffer.from(bytes);
6540 + } else if (typeof bytes === 'string') {
6541 + bytes = Buffer.from(bytes, 'utf8');
6542 + }
6543 +
6544 + return _crypto.default.createHash('md5').update(bytes).digest();
6545 +}
6546 +
6547 +var _default = md5;
6548 +exports["default"] = _default;
6549 +
6550 +/***/ }),
6551 +
6552 +/***/ 5332:
6553 +/***/ ((__unused_webpack_module, exports) => {
6554 +
6555 +"use strict";
6556 +
6557 +
6558 +Object.defineProperty(exports, "__esModule", ({
6559 + value: true
6560 +}));
6561 +exports["default"] = void 0;
6562 +var _default = '00000000-0000-0000-0000-000000000000';
6563 +exports["default"] = _default;
6564 +
6565 +/***/ }),
6566 +
6567 +/***/ 2746:
6568 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6569 +
6570 +"use strict";
6571 +
6572 +
6573 +Object.defineProperty(exports, "__esModule", ({
6574 + value: true
6575 +}));
6576 +exports["default"] = void 0;
6577 +
6578 +var _validate = _interopRequireDefault(__nccwpck_require__(6900));
6579 +
6580 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6581 +
6582 +function parse(uuid) {
6583 + if (!(0, _validate.default)(uuid)) {
6584 + throw TypeError('Invalid UUID');
6585 + }
6586 +
6587 + let v;
6588 + const arr = new Uint8Array(16); // Parse ########-....-....-....-............
6589 +
6590 + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
6591 + arr[1] = v >>> 16 & 0xff;
6592 + arr[2] = v >>> 8 & 0xff;
6593 + arr[3] = v & 0xff; // Parse ........-####-....-....-............
6594 +
6595 + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
6596 + arr[5] = v & 0xff; // Parse ........-....-####-....-............
6597 +
6598 + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
6599 + arr[7] = v & 0xff; // Parse ........-....-....-####-............
6600 +
6601 + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
6602 + arr[9] = v & 0xff; // Parse ........-....-....-....-############
6603 + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
6604 +
6605 + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
6606 + arr[11] = v / 0x100000000 & 0xff;
6607 + arr[12] = v >>> 24 & 0xff;
6608 + arr[13] = v >>> 16 & 0xff;
6609 + arr[14] = v >>> 8 & 0xff;
6610 + arr[15] = v & 0xff;
6611 + return arr;
6612 +}
6613 +
6614 +var _default = parse;
6615 +exports["default"] = _default;
6616 +
6617 +/***/ }),
6618 +
6619 +/***/ 814:
6620 +/***/ ((__unused_webpack_module, exports) => {
6621 +
6622 +"use strict";
6623 +
6624 +
6625 +Object.defineProperty(exports, "__esModule", ({
6626 + value: true
6627 +}));
6628 +exports["default"] = void 0;
6629 +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;
6630 +exports["default"] = _default;
6631 +
6632 +/***/ }),
6633 +
6634 +/***/ 807:
6635 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6636 +
6637 +"use strict";
6638 +
6639 +
6640 +Object.defineProperty(exports, "__esModule", ({
6641 + value: true
6642 +}));
6643 +exports["default"] = rng;
6644 +
6645 +var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
6646 +
6647 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6648 +
6649 +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
6650 +
6651 +let poolPtr = rnds8Pool.length;
6652 +
6653 +function rng() {
6654 + if (poolPtr > rnds8Pool.length - 16) {
6655 + _crypto.default.randomFillSync(rnds8Pool);
6656 +
6657 + poolPtr = 0;
6658 + }
6659 +
6660 + return rnds8Pool.slice(poolPtr, poolPtr += 16);
6661 +}
6662 +
6663 +/***/ }),
6664 +
6665 +/***/ 5274:
6666 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6667 +
6668 +"use strict";
6669 +
6670 +
6671 +Object.defineProperty(exports, "__esModule", ({
6672 + value: true
6673 +}));
6674 +exports["default"] = void 0;
6675 +
6676 +var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
6677 +
6678 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6679 +
6680 +function sha1(bytes) {
6681 + if (Array.isArray(bytes)) {
6682 + bytes = Buffer.from(bytes);
6683 + } else if (typeof bytes === 'string') {
6684 + bytes = Buffer.from(bytes, 'utf8');
6685 + }
6686 +
6687 + return _crypto.default.createHash('sha1').update(bytes).digest();
6688 +}
6689 +
6690 +var _default = sha1;
6691 +exports["default"] = _default;
6692 +
6693 +/***/ }),
6694 +
6695 +/***/ 8950:
6696 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6697 +
6698 +"use strict";
6699 +
6700 +
6701 +Object.defineProperty(exports, "__esModule", ({
6702 + value: true
6703 +}));
6704 +exports["default"] = void 0;
6705 +
6706 +var _validate = _interopRequireDefault(__nccwpck_require__(6900));
6707 +
6708 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6709 +
6710 +/**
6711 + * Convert array of 16 byte values to UUID string format of the form:
6712 + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
6713 + */
6714 +const byteToHex = [];
6715 +
6716 +for (let i = 0; i < 256; ++i) {
6717 + byteToHex.push((i + 0x100).toString(16).substr(1));
6718 +}
6719 +
6720 +function stringify(arr, offset = 0) {
6721 + // Note: Be careful editing this code! It's been tuned for performance
6722 + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
6723 + 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
6724 + // of the following:
6725 + // - One or more input array values don't map to a hex octet (leading to
6726 + // "undefined" in the uuid)
6727 + // - Invalid input values for the RFC `version` or `variant` fields
6728 +
6729 + if (!(0, _validate.default)(uuid)) {
6730 + throw TypeError('Stringified UUID is invalid');
6731 + }
6732 +
6733 + return uuid;
6734 +}
6735 +
6736 +var _default = stringify;
6737 +exports["default"] = _default;
6738 +
6739 +/***/ }),
6740 +
6741 +/***/ 8628:
6742 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6743 +
6744 +"use strict";
6745 +
6746 +
6747 +Object.defineProperty(exports, "__esModule", ({
6748 + value: true
6749 +}));
6750 +exports["default"] = void 0;
6751 +
6752 +var _rng = _interopRequireDefault(__nccwpck_require__(807));
6753 +
6754 +var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
6755 +
6756 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6757 +
6758 +// **`v1()` - Generate time-based UUID**
6759 +//
6760 +// Inspired by https://github.com/LiosK/UUID.js
6761 +// and http://docs.python.org/library/uuid.html
6762 +let _nodeId;
6763 +
6764 +let _clockseq; // Previous uuid creation time
6765 +
6766 +
6767 +let _lastMSecs = 0;
6768 +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
6769 +
6770 +function v1(options, buf, offset) {
6771 + let i = buf && offset || 0;
6772 + const b = buf || new Array(16);
6773 + options = options || {};
6774 + let node = options.node || _nodeId;
6775 + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
6776 + // specified. We do this lazily to minimize issues related to insufficient
6777 + // system entropy. See #189
6778 +
6779 + if (node == null || clockseq == null) {
6780 + const seedBytes = options.random || (options.rng || _rng.default)();
6781 +
6782 + if (node == null) {
6783 + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
6784 + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
6785 + }
6786 +
6787 + if (clockseq == null) {
6788 + // Per 4.2.2, randomize (14 bit) clockseq
6789 + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
6790 + }
6791 + } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
6792 + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
6793 + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
6794 + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
6795 +
6796 +
6797 + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
6798 + // cycle to simulate higher resolution clock
6799 +
6800 + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
6801 +
6802 + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
6803 +
6804 + if (dt < 0 && options.clockseq === undefined) {
6805 + clockseq = clockseq + 1 & 0x3fff;
6806 + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
6807 + // time interval
6808 +
6809 +
6810 + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
6811 + nsecs = 0;
6812 + } // Per 4.2.1.2 Throw error if too many uuids are requested
6813 +
6814 +
6815 + if (nsecs >= 10000) {
6816 + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
6817 + }
6818 +
6819 + _lastMSecs = msecs;
6820 + _lastNSecs = nsecs;
6821 + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
6822 +
6823 + msecs += 12219292800000; // `time_low`
6824 +
6825 + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
6826 + b[i++] = tl >>> 24 & 0xff;
6827 + b[i++] = tl >>> 16 & 0xff;
6828 + b[i++] = tl >>> 8 & 0xff;
6829 + b[i++] = tl & 0xff; // `time_mid`
6830 +
6831 + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
6832 + b[i++] = tmh >>> 8 & 0xff;
6833 + b[i++] = tmh & 0xff; // `time_high_and_version`
6834 +
6835 + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
6836 +
6837 + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
6838 +
6839 + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
6840 +
6841 + b[i++] = clockseq & 0xff; // `node`
6842 +
6843 + for (let n = 0; n < 6; ++n) {
6844 + b[i + n] = node[n];
6845 + }
6846 +
6847 + return buf || (0, _stringify.default)(b);
6848 +}
6849 +
6850 +var _default = v1;
6851 +exports["default"] = _default;
6852 +
6853 +/***/ }),
6854 +
6855 +/***/ 6409:
6856 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6857 +
6858 +"use strict";
6859 +
6860 +
6861 +Object.defineProperty(exports, "__esModule", ({
6862 + value: true
6863 +}));
6864 +exports["default"] = void 0;
6865 +
6866 +var _v = _interopRequireDefault(__nccwpck_require__(5998));
6867 +
6868 +var _md = _interopRequireDefault(__nccwpck_require__(4569));
6869 +
6870 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6871 +
6872 +const v3 = (0, _v.default)('v3', 0x30, _md.default);
6873 +var _default = v3;
6874 +exports["default"] = _default;
6875 +
6876 +/***/ }),
6877 +
6878 +/***/ 5998:
6879 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6880 +
6881 +"use strict";
6882 +
6883 +
6884 +Object.defineProperty(exports, "__esModule", ({
6885 + value: true
6886 +}));
6887 +exports["default"] = _default;
6888 +exports.URL = exports.DNS = void 0;
6889 +
6890 +var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
6891 +
6892 +var _parse = _interopRequireDefault(__nccwpck_require__(2746));
6893 +
6894 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6895 +
6896 +function stringToBytes(str) {
6897 + str = unescape(encodeURIComponent(str)); // UTF8 escape
6898 +
6899 + const bytes = [];
6900 +
6901 + for (let i = 0; i < str.length; ++i) {
6902 + bytes.push(str.charCodeAt(i));
6903 + }
6904 +
6905 + return bytes;
6906 +}
6907 +
6908 +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
6909 +exports.DNS = DNS;
6910 +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
6911 +exports.URL = URL;
6912 +
6913 +function _default(name, version, hashfunc) {
6914 + function generateUUID(value, namespace, buf, offset) {
6915 + if (typeof value === 'string') {
6916 + value = stringToBytes(value);
6917 + }
6918 +
6919 + if (typeof namespace === 'string') {
6920 + namespace = (0, _parse.default)(namespace);
6921 + }
6922 +
6923 + if (namespace.length !== 16) {
6924 + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
6925 + } // Compute hash of namespace and value, Per 4.3
6926 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
6927 + // hashfunc([...namespace, ... value])`
6928 +
6929 +
6930 + let bytes = new Uint8Array(16 + value.length);
6931 + bytes.set(namespace);
6932 + bytes.set(value, namespace.length);
6933 + bytes = hashfunc(bytes);
6934 + bytes[6] = bytes[6] & 0x0f | version;
6935 + bytes[8] = bytes[8] & 0x3f | 0x80;
6936 +
6937 + if (buf) {
6938 + offset = offset || 0;
6939 +
6940 + for (let i = 0; i < 16; ++i) {
6941 + buf[offset + i] = bytes[i];
6942 + }
6943 +
6944 + return buf;
6945 + }
6946 +
6947 + return (0, _stringify.default)(bytes);
6948 + } // Function#name is not settable on some platforms (#270)
6949 +
6950 +
6951 + try {
6952 + generateUUID.name = name; // eslint-disable-next-line no-empty
6953 + } catch (err) {} // For CommonJS default export support
6954 +
6955 +
6956 + generateUUID.DNS = DNS;
6957 + generateUUID.URL = URL;
6958 + return generateUUID;
6959 +}
6960 +
6961 +/***/ }),
6962 +
6963 +/***/ 5122:
6964 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6965 +
6966 +"use strict";
6967 +
6968 +
6969 +Object.defineProperty(exports, "__esModule", ({
6970 + value: true
6971 +}));
6972 +exports["default"] = void 0;
6973 +
6974 +var _rng = _interopRequireDefault(__nccwpck_require__(807));
6975 +
6976 +var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
6977 +
6978 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6979 +
6980 +function v4(options, buf, offset) {
6981 + options = options || {};
6982 +
6983 + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
6984 +
6985 +
6986 + rnds[6] = rnds[6] & 0x0f | 0x40;
6987 + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
6988 +
6989 + if (buf) {
6990 + offset = offset || 0;
6991 +
6992 + for (let i = 0; i < 16; ++i) {
6993 + buf[offset + i] = rnds[i];
6994 + }
6995 +
6996 + return buf;
6997 + }
6998 +
6999 + return (0, _stringify.default)(rnds);
7000 +}
7001 +
7002 +var _default = v4;
7003 +exports["default"] = _default;
7004 +
7005 +/***/ }),
7006 +
7007 +/***/ 9120:
7008 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7009 +
7010 +"use strict";
7011 +
7012 +
7013 +Object.defineProperty(exports, "__esModule", ({
7014 + value: true
7015 +}));
7016 +exports["default"] = void 0;
7017 +
7018 +var _v = _interopRequireDefault(__nccwpck_require__(5998));
7019 +
7020 +var _sha = _interopRequireDefault(__nccwpck_require__(5274));
7021 +
7022 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7023 +
7024 +const v5 = (0, _v.default)('v5', 0x50, _sha.default);
7025 +var _default = v5;
7026 +exports["default"] = _default;
7027 +
7028 +/***/ }),
7029 +
7030 +/***/ 6900:
7031 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7032 +
7033 +"use strict";
7034 +
7035 +
7036 +Object.defineProperty(exports, "__esModule", ({
7037 + value: true
7038 +}));
7039 +exports["default"] = void 0;
7040 +
7041 +var _regex = _interopRequireDefault(__nccwpck_require__(814));
7042 +
7043 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7044 +
7045 +function validate(uuid) {
7046 + return typeof uuid === 'string' && _regex.default.test(uuid);
7047 +}
7048 +
7049 +var _default = validate;
7050 +exports["default"] = _default;
7051 +
7052 +/***/ }),
7053 +
7054 +/***/ 1595:
7055 +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7056 +
7057 +"use strict";
7058 +
7059 +
7060 +Object.defineProperty(exports, "__esModule", ({
7061 + value: true
7062 +}));
7063 +exports["default"] = void 0;
7064 +
7065 +var _validate = _interopRequireDefault(__nccwpck_require__(6900));
7066 +
7067 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7068 +
7069 +function version(uuid) {
7070 + if (!(0, _validate.default)(uuid)) {
7071 + throw TypeError('Invalid UUID');
7072 + }
7073 +
7074 + return parseInt(uuid.substr(14, 1), 16);
7075 +}
7076 +
7077 +var _default = version;
7078 +exports["default"] = _default;
7079 +
5962 7080 /***/ }),
5963 7081
5964 7082 /***/ 2127:
@@ -6559,6 +7677,14 @@ module.exports = require("child_process");
6559 7677
6560 7678 /***/ }),
6561 7679
7680 +/***/ 6113:
7681 +/***/ ((module) => {
7682 +
7683 +"use strict";
7684 +module.exports = require("crypto");
7685 +
7686 +/***/ }),
7687 +
6562 7688 /***/ 2361:
6563 7689 /***/ ((module) => {
6564 7690
modified package-lock.json
+32 −17
@@ -7,7 +7,7 @@
7 7 "name": "setup-beam",
8 8 "license": "MIT",
9 9 "dependencies": {
10 "@actions/core": "1.6.0",
10 + "@actions/core": "1.9.1",
11 11 "@actions/exec": "1.1.1",
12 12 "semver": "7.3.6"
13 13 },
@@ -30,11 +30,12 @@
30 30 }
31 31 },
32 32 "node_modules/@actions/core": {
33 "version": "1.6.0",
34 "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
35 "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
33 + "version": "1.9.1",
34 + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
35 + "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
36 36 "dependencies": {
37 "@actions/http-client": "^1.0.11"
37 + "@actions/http-client": "^2.0.1",
38 + "uuid": "^8.3.2"
38 39 }
39 40 },
40 41 "node_modules/@actions/exec": {
@@ -46,11 +47,11 @@
46 47 }
47 48 },
48 49 "node_modules/@actions/http-client": {
49 "version": "1.0.11",
50 "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
51 "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
50 + "version": "2.0.1",
51 + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
52 + "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
52 53 "dependencies": {
53 "tunnel": "0.0.6"
54 + "tunnel": "^0.0.6"
54 55 }
55 56 },
56 57 "node_modules/@actions/io": {
@@ -2724,6 +2725,14 @@
2724 2725 "punycode": "^2.1.0"
2725 2726 }
2726 2727 },
2728 + "node_modules/uuid": {
2729 + "version": "8.3.2",
2730 + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
2731 + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
2732 + "bin": {
2733 + "uuid": "dist/bin/uuid"
2734 + }
2735 + },
2727 2736 "node_modules/v8-compile-cache": {
2728 2737 "version": "2.3.0",
2729 2738 "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
@@ -2861,11 +2870,12 @@
2861 2870 },
2862 2871 "dependencies": {
2863 2872 "@actions/core": {
2864 "version": "1.6.0",
2865 "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
2866 "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
2873 + "version": "1.9.1",
2874 + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
2875 + "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
2867 2876 "requires": {
2868 "@actions/http-client": "^1.0.11"
2877 + "@actions/http-client": "^2.0.1",
2878 + "uuid": "^8.3.2"
2869 2879 }
2870 2880 },
2871 2881 "@actions/exec": {
@@ -2877,11 +2887,11 @@
2877 2887 }
2878 2888 },
2879 2889 "@actions/http-client": {
2880 "version": "1.0.11",
2881 "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
2882 "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
2890 + "version": "2.0.1",
2891 + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
2892 + "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
2883 2893 "requires": {
2884 "tunnel": "0.0.6"
2894 + "tunnel": "^0.0.6"
2885 2895 }
2886 2896 },
2887 2897 "@actions/io": {
@@ -4872,6 +4882,11 @@
4872 4882 "punycode": "^2.1.0"
4873 4883 }
4874 4884 },
4885 + "uuid": {
4886 + "version": "8.3.2",
4887 + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
4888 + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
4889 + },
4875 4890 "v8-compile-cache": {
4876 4891 "version": "2.3.0",
4877 4892 "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
modified package.json
+1 −1
@@ -19,7 +19,7 @@
19 19 }
20 20 },
21 21 "dependencies": {
22 "@actions/core": "1.6.0",
22 + "@actions/core": "1.9.1",
23 23 "@actions/exec": "1.1.1",
24 24 "semver": "7.3.6"
25 25 },

Parents: 6942ea2